prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>ammoToDmgPattern.py<|end_file_name|><|fim▁begin|># noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
class AmmoToDmgPattern(ContextMenuSingle):
visibilitySetting = 'ammoPattern'
... | activate |
<|file_name|>ammoToDmgPattern.py<|end_file_name|><|fim▁begin|># noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
import gui.mainFrame
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
class AmmoToDmgPattern(ContextMenuSingle):
visibilitySetting = 'ammoPattern'
... | getBitmap |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | assert credentials.access_key == 'access-key2'
assert credentials.secret_key == 'secret-key2'
assert credentials.token == 'session-token2' |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
<|fim_middle|>
<|fim▁end|> | @patch('quilt3.session.open_url')
@patch('quilt3.session.input', return_value='123456')
@patch('quilt3.session.login_with_token')
def test_login(self, mock_login_with_token, mock_input, mock_open_url):
quilt3.login()
url = quilt3.session.get_registry_url()
mock_open_url.assert_... |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | quilt3.login()
url = quilt3.session.get_registry_url()
mock_open_url.assert_called_with(f'{url}/login')
mock_login_with_token.assert_called_with('123456') |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | url = quilt3.session.get_registry_url()
mock_auth = dict(
refresh_token='refresh-token',
access_token='access-token',
expires_at=123456789
)
self.requests_mock.add(
responses.POST,
f'{url}/api/token',
json=mock_aut... |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | def format_date(date):
return date.replace(tzinfo=datetime.timezone.utc, microsecond=0).isoformat()
# Test good credentials.
future_date = datetime.datetime.utcnow() + datetime.timedelta(hours=1)
mock_load_credentials.return_value = dict(
access_key='access-key'... |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | return date.replace(tzinfo=datetime.timezone.utc, microsecond=0).isoformat() |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | registry_url = quilt3.session.get_registry_url()
other_registry_url = registry_url + 'other'
mock_auth = dict(
refresh_token='refresh-token',
access_token='access-token',
expires_at=123456789,
)
with patch('quilt3.session._load_auth', return_v... |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | test_login |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | test_login_with_token |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | test_create_botocore_session |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | format_date |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>"""
Tests for login and logout.
"""
import datetime
from unittest.mock import patch
import responses
import quilt3
from .utils import QuiltTestCase
class TestSession(QuiltTestCase):
@patch('quilt3.session.open_url')
@patch('quilt3.session.input', r... | test_logged_in |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | __tablename__ = 'member'
id = Column(Integer, primary_key=True)
first_name = Column(String)
last_name = Column(String)
clubs = relationship('Club', back_populates='members',
secondary=member_club_mapping)
def __init__(self, first_name, last_name):
self.first_nam... |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | self.first_name = first_name
self.last_name = last_name |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | __tablename__ = 'club'
id = Column(Integer, primary_key=True)
name = Column(String)
members = relationship('Member', back_populates='clubs',
secondary=member_club_mapping)
def __init__(self, name):
self.name = name |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | self.name = name |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | __init__ |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | __init__ |
<|file_name|>pos_config.py<|end_file_name|><|fim▁begin|># Copyright 2015 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
<|fim▁hole|>class PosConfig(models.Model):
_inherit = "pos.config"
account_analytic_id = fields.Many2one(
comodel_... | |
<|file_name|>pos_config.py<|end_file_name|><|fim▁begin|># Copyright 2015 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class PosConfig(models.Model):
<|fim_middle|>
<|fim▁end|> | _inherit = "pos.config"
account_analytic_id = fields.Many2one(
comodel_name="account.analytic.account", string="Analytic Account"
) |
<|file_name|>fastq_to_fasta.py<|end_file_name|><|fim▁begin|>import os
import sys
from Bio import SeqIO
f = open(sys.argv[1], 'rU')
out = open(sys.argv[2], 'w')
for records in SeqIO.parse(f, 'fastq'):<|fim▁hole|><|fim▁end|> | SeqIO.write(records, out, 'fasta') |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.<|fim▁hole|># Changes may cause incorrect behavior and will be lost if the code is re... | # Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator. |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | """The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener.
... |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | self._config = SqlVirtualMachineManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type... |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | """Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client._send_request(request)
... |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | await self._client.close() |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | await self._client.__aenter__()
return self |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | await self._client.__aexit__(*exc_details) |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | from azure.core.credentials_async import AsyncTokenCredential |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | __init__ |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | _send_request |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | close |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | __aenter__ |
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license in... | __aexit__ |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | NIT_MATCH = None
EXPECTED_FLAGS = ""
def parse_file(self, filename):
return self.FORMAT(filename, template_store=self.FORMAT(filename))
cl |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | n self.FORMAT(filename, template_store=self.FORMAT(filename))
cl |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | T = HTMLFormat
FILE = HTML_FILE
MIME = "text/html"
EXT = "html"
COUNT = 5
MASK = "*/translations.html"
EXPECTED_PATH = "cs_CZ/translations.html"
FIND_CONTEXT = "+html.body.p:5-1"
FIND_MATCH = "Orangutan has five bananas."
MATCH = b"<body>"
NEW_UNIT_MATCH = None
BASE = HTM... |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | T = OpenDocumentFormat
FILE = OPENDOCUMENT_FILE
MIME = "application/vnd.oasis.opendocument.text"
EXT = "odt"
COUNT = 4
MASK = "*/translations.odt"
EXPECTED_PATH = "cs_CZ/translations.odt"
FIND_CONTEXT = (
"odf///office:document-content[0]/office:body[0]/office:text[0]/text:p[1]"
... |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | n bytes(
OpenDocumentFormat.convertfile(BytesIOMode("test.odt", content), None)
).decode()
|
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | assertEqual(
self.extract_document(newdata),
self.extract_document(testdata),
)
cl |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | T = IDMLFormat
FILE = IDML_FILE
MIME = "application/octet-stream"
EXT = "idml"
COUNT = 6
MASK = "*/translations.idml"
EXPECTED_PATH = "cs_CZ/translations.idml"
FIND_CONTEXT = (
"idPkg:Story[0]/{}Story[0]/{}XMLElement[0]/{}ParagraphStyleRange[0]"
"Stories/Story_mainmainmai... |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | n bytes(
IDMLFormat.convertfile(BytesIOMode("test.idml", content), None)
).decode()
|
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | assertEqual(
self.extract_document(newdata),
self.extract_document(testdata),
)
cl |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | T = WindowsRCFormat
FILE = TEST_RC
BASE = TEST_RC
MIME = "text/plain"
EXT = "rc"
COUNT = 5
MASK = "rc/*.rc"
EXPECTED_PATH = "rc/cs-CZ.rc"
MATCH = "STRINGTABLE"
FIND_CONTEXT = "STRINGTABLE.IDS_MSG1"
FIND_MATCH = "Hello, world!\n"
EDIT_OFFSET = 1
cl |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | T = PlainTextFormat
FILE = TEST_TXT
BASE = TEST_TXT
MIME = "text/plain"
EXT = "txt"
COUNT = 5
MASK = "txt/*.txt"
EXPECTED_PATH = "txt/cs_CZ.txt"
MATCH = "Hello"
FIND_CONTEXT = "cs.txt:2"
FIND_MATCH = "Hello, world!"
EDIT_OFFSET = 1
|
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | _file(self |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | ct_document(cont |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | t_same(self |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | ct_document(cont |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | t_same(self |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | filepath = PathToTestFile( 'basic.py' )
completion_data = BuildRequest( filepath = filepath,
filetype = 'python',
contents = ReadFile( filepath ),
line_num = 7,
column_num = 3)
... |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | filepath = PathToTestFile( 'unicode.py' )
completion_data = BuildRequest( filepath = filepath,
filetype = 'python',
contents = ReadFile( filepath ),
force_semantic = True,
line_num... |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | "
Method to run a simple completion test and verify the result
test is a dictionary containing:
'request': kwargs for BuildRequest
'expect': {
'response': server response code (e.g. httplib.OK)
'data': matcher for the server response json
}
"""
contents = ReadFile( test[ 'request' ]... |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | = request
request.update( data )
return BuildRequest( **kw )
|
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | nTest( app, {
'description': 'param jedi does not know about (id). query="a_p"',
'request': {
'filetype' : 'python',
'filepath' : PathToTestFile( 'general_fallback',
'lang_python.py' ),
'line_num' : 28,
'column_num': 20,
'force_semantic': Fa... |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | nTest( app, {
'description': 'return completions for strings with multi-byte chars',
'request': {
'filetype' : 'python',
'filepath' : PathToTestFile( 'unicode.py' ),
'line_num' : 7,
'column_num': 14
},
'expect': {
'response': http.client.OK,
'data': has_entries( ... |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | GetCompletions_Basic_test |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | GetCompletions_UnicodeDescription_test |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | nTest( |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | mbineRequest( |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | tCompletions_NoSuggestions_Fallback_test( |
<|file_name|>get_completions_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | tCompletions_Unicode_InLine_test( |
<|file_name|>0295_doc_tslug.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2 on 2019-06-20 09:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scoping', '0294_titlevecmodel'),<|fim▁hole|> operations = [
migrations.AddField(
... | ]
|
<|file_name|>0295_doc_tslug.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2 on 2019-06-20 09:39
from django.db import migrations, models
class Migration(migrations.Migration):
<|fim_middle|>
<|fim▁end|> | dependencies = [
('scoping', '0294_titlevecmodel'),
]
operations = [
migrations.AddField(
model_name='doc',
name='tslug',
field=models.TextField(null=True),
),
] |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | self.world_updates.extend([randomNumber, wid])
def flush_world_updates(self):
query = ';'.join('UPDATE World SET randomNumber=%s WHERE id=%s' |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | def __init__(self, table=None, pool_size=8):
self.db = DAL(DATABASE_URI, migrate_enabled=False, pool_size=pool_size)
if table == 'World':
self.db.define_table('World', Field('randomNumber', 'integer'))
elif table == 'Fortune':
self.db.define_table('Fortune', Field('me... |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | self.db = DAL(DATABASE_URI, migrate_enabled=False, pool_size=pool_size)
if table == 'World':
self.db.define_table('World', Field('randomNumber', 'integer'))
elif table == 'Fortune':
self.db.define_table('Fortune', Field('message')) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | return self.db(self.db.World.id == wid).select(cacheable=True)[0].as_dict() |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | self.db(self.db.World.id == wid).update(randomNumber=randomNumber) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | fortunes = self.db(self.db.Fortune).select(cacheable=True)
fortunes.records.append(Row(new_message))
return fortunes.sort(itemgetter('message')) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | def __init__(self):
super(RawDal, self).__init__()
self.world_updates = []
def get_world(self, wid):
return self.db.executesql('SELECT * FROM World WHERE id = %s',
placeholders=[wid], as_dict=True)[0]
def update_world(self, wid, randomNumber):
... |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | super(RawDal, self).__init__()
self.world_updates = [] |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | return self.db.executesql('SELECT * FROM World WHERE id = %s',
placeholders=[wid], as_dict=True)[0] |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | self.world_updates.extend([randomNumber, wid]) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | query = ';'.join('UPDATE World SET randomNumber=%s WHERE id=%s'
for _ in xrange(len(self.world_updates) / 2))
self.db.executesql(query, placeholders=self.world_updates) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | fortunes = self.db.executesql('SELECT * FROM Fortune', as_dict=True)
fortunes.append(new_message)
return sorted(fortunes, key=itemgetter('message')) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | try:
num = int(queries)
return 1 if num < 1 else 500 if num > 500 else num
except ValueError:
return 1 |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | self.db.define_table('World', Field('randomNumber', 'integer')) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | self.db.define_table('Fortune', Field('message')) |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | __init__ |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | get_world |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | update_world |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | get_fortunes |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | __init__ |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | get_world |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | update_world |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | flush_world_updates |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | get_fortunes |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = os.environ.get('DBHOST', 'localhost')
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D... | num_queries |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>class CheckBase(object):
"""
Base class for checks.
"""
hooks = []
# pylint: disable=W0105
"""Git hooks to which this class applies. A list of strings."""
def execute(self, hook):
"""
Executes the check.
:param... | """ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>
class CheckBase(object):
<|fim_middle|>
<|fim▁end|> | """
Base class for checks.
"""
hooks = []
# pylint: disable=W0105
"""Git hooks to which this class applies. A list of strings."""
def execute(self, hook):
"""
Executes the check.
:param hook: The name of the hook being run.
:type hook: :class:`str`
... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>
class CheckBase(object):
"""
Base class for checks.
"""
hooks = []
# pylint: disable=W0105
"""Git hooks to which this class applies. A list of strings."""
def execute(self, hook):
<|fim_middle|>
<|fim▁end|> | """
Executes the check.
:param hook: The name of the hook being run.
:type hook: :class:`str`
:returns: ``True`` if the check passed, ``False`` if not.
:rtype: :class:`bool`
"""
pass |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>
class CheckBase(object):
"""
Base class for checks.
"""
hooks = []
# pylint: disable=W0105
"""Git hooks to which this class applies. A list of strings."""
def <|fim_middle|>(self, hook):
"""
Executes the check.
... | execute |
<|file_name|>problem404.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Crisscross Ellipses
# ===================
# Published on Sunday, 2nd December 2012, 01:00 am
#
# Ea is an ellipse with an equation of the form x2 + 4y2 = 4a2. Ea' is the
# rotated image of Ea by θ degrees counterclockwise around the origin O(0, 0)
#... | # -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem404.py
# |
<|file_name|>problem404.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem404.py
#
# Crisscross Ellipses
# ===================
# Published on Sunday, 2nd December 2012, 01:00 am
#
# Ea is an ellipse with an equation of the form x2 + 4y2 = 4a2. Ea' is the
# rotated image of Ea by... | if _ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.