Instruction stringlengths 362 7.83k | output_code stringlengths 1 945 |
|---|---|
Next line prediction: <|code_start|>
class Scenario(IsisScenario):
description = "making toast in isisworld"
author = "dustin smith"
version = "1"
def environment():
#k = kitchen(length=15, width=15, height=10)
#put_in_world(k)
b1 = block()
put_in... | b2 = block() |
Based on the snippet: <|code_start|> k = kitchen(length=15, width=15, height=10)
put_in_world(k)
f = fridge()
put_in(f, k)
b = butter()
put_in(b, f)
ov = oven()
put_in(ov, k)
ta = table(scale=7)
put_in(ta, k)
... | t = toaster() |
Given the following code snippet before the placeholder: <|code_start|>
class Scenario(IsisScenario):
description = "picking up a knife"
author = "dustin smith"
version = "1"
def environment():
k = kitchen()
put_in_world(k)
ta = table()
<|code_end|>
, predict the next line usin... | put_in(ta, k) |
Next line prediction: <|code_start|>from __future__ import print_function, unicode_literals
from __future__ import absolute_import, division
def test_most_likely_choice():
n = 100
some_list = [('a', 0.99), ('b', 0.01)]
vals = [utils.most_likely_choice(some_list) for i in range(n)]
a_count = vals.co... | def test_weighted_choice(): |
Continue the code snippet: <|code_start|>from __future__ import print_function, unicode_literals
from __future__ import absolute_import, division
def test_most_likely_choice():
n = 100
some_list = [('a', 0.99), ('b', 0.01)]
vals = [utils.most_likely_choice(some_list) for i in range(n)]
a_count = va... | assert a_count == n |
Here is a snippet: <|code_start|>from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
seed(0)
num_clusters = 4
num_samples = 30
sigma = 1
xmean = [uniform(-8, 8) for i in range(num_clusters)]
ymean = [uniform(-8, 8) for... | actual = [] |
Given the code snippet: <|code_start|>
flag_cache = SimpleCache(threshold=1000, default_timeout=300)
country_cache = SimpleCache(threshold=1000, default_timeout=300)
sensor_cache = SimpleCache(threshold=1000, default_timeout=300)
def is_private_addr(ip):
# 10.0.0.0/8
# 127.0.0.0/8
# 172.16.0.0/12
# 19... | return False |
Using the snippet: <|code_start|>
flag_cache = SimpleCache(threshold=1000, default_timeout=300)
country_cache = SimpleCache(threshold=1000, default_timeout=300)
sensor_cache = SimpleCache(threshold=1000, default_timeout=300)
def is_private_addr(ip):
# 10.0.0.0/8
# 127.0.0.0/8
# 172.16.0.0/12
# 192.168... | if is_private_addr(ipaddr): |
Predict the next line after this snippet: <|code_start|> # end def
def to_dict(self):
data = super().to_dict()
data["leader"] = self.leader
data["value"] = self.value
return data
# end def
# end class
class NewLeaderMessage(Message): # pragma: no cover
def __init__(self... | "sequence_no": data["sequence_no"], |
Continue the code snippet: <|code_start|> @classmethod
def from_dict(cls, data):
raise NotImplementedError("LeaderChangeMessage")
kwargs = {
"type": data["type"],
"sequence_no": data["sequence_no"],
}
return cls(**kwargs)
# end def
def to_dict(self... | value_store = [] |
Predict the next line for this snippet: <|code_start|> return cls(**kwargs)
# end def
def to_dict(self):
data = super().to_dict()
data["value"] = self.value
return data
# end def
# end class
class LeaderChangeMessage(Message): # pragma: no cover
def __init__(self, sequ... | "type": self.type, |
Given the code snippet: <|code_start|> # end def
def to_dict(self):
raise NotImplementedError("LeaderChangeMessage")
return {
"type": self.type,
"sequence_no": self.sequence_no,
}
# end def
# end class
class ProposeMessage(Message):
def __init__(self, se... | "node": data.get("node"), |
Given the following code snippet before the placeholder: <|code_start|> "proposal": data.get("proposal"),
"value_store": value_store
}
return cls(**kwargs)
# end def
def to_dict(self):
data = super().to_dict()
data["leader"] = self.leader
data["pro... | } |
Here is a snippet: <|code_start|> def __init__(self, sequence_no, node, leader, proposal, value_store):
super(ProposeMessage, self).__init__(PROPOSE, sequence_no, node)
self.leader = leader
self.proposal = proposal
assert isinstance(value_store, list)
self.value_store = value_... | return data |
Here is a snippet: <|code_start|>class LeaderChangeMessage(Message): # pragma: no cover
def __init__(self, sequence_no, node_num, leader, P):
raise NotImplementedError("LeaderChangeMessage")
super(LeaderChangeMessage, self).__init__(LEADER_CHANGE, sequence_no)
# end def
@classmethod
de... | self.proposal = proposal |
Predict the next line after this snippet: <|code_start|>def send_message(msg):
logger.debug(msg)
assert isinstance(msg, Message)
data = msg.to_dict()
data_string = json.dumps(data)
broadcast(data_string)
loggert = logging.getLogger("request")
def print_url(r, *args, **kwargs):
logger... | for node_host in hosts: |
Given the following code snippet before the placeholder: <|code_start|># -*- coding: utf-8 -*-
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
MSG_FORMAT = "ANSWER {length}\n{msg}\n"
def send_message(msg):
logger.debug(msg)
assert isinstance(msg, Message)
data = msg.to_dict()
data_... | loggert.info(r.url) |
Continue the code snippet: <|code_start|> assert isinstance(msg, Message)
data = msg.to_dict()
data_string = json.dumps(data)
broadcast(data_string)
loggert = logging.getLogger("request")
def print_url(r, *args, **kwargs):
loggert.info(r.url)
# end def
while (True):
try:
... | while not sent == 1: |
Here is a snippet: <|code_start|> while (True):
try:
requests.put(DATABASE_URL, data=data_string, hooks=dict(response=print_url))
break
except requests.RequestException as e:
logger.warning("Failed to report message to db: {e}".format(e=e))
# end def
... | ) |
Continue the code snippet: <|code_start|>
class DBProposeMessage(DBMessage):
_discriminator_ = PROPOSE
proposal = orm.Required(VALUE_TYPE)
value_store = orm.Required(orm.Json) # json
def from_db(self):
return messages.ProposeMessage(
sequence_no=self.sequence_no, node=self.node, le... | def from_db(self): |
Given the code snippet: <|code_start|>class DBVoteMessage(DBMessage):
_discriminator_ = VOTE
@classmethod
def to_db(cls, msg):
assert isinstance(msg, messages.VoteMessage)
return super().to_db(msg)
# end def
def from_db(self):
return messages.VoteMessage(sequence_no=self.se... | MSG_TYPE_CLASS_MAP = { |
Given the code snippet: <|code_start|> return clazz.from_dict(self.as_dict())
# end def
@classmethod
def to_db(cls, msg):
return cls(**msg.to_dict())
# end def
# end class
class DBInitMessage(DBMessage):
_discriminator_ = INIT
def from_db(self):
return messages.InitMes... | def from_db(self): |
Predict the next line for this snippet: <|code_start|>VALUE_TYPE = float
MSG_TYPE_TYPE = int
NODE_TYPE = int
SEQUENCE_TYPE = int
# https://editor.ponyorm.com/user/luckydonald/pbft
# Last permalink:
# https://editor.ponyorm.com/user/luckydonald/pbft_2
class DBMessage(db.Entity):
type = orm.Discriminator(MSG_TYPE_... | return cls(**msg.to_dict()) |
Given snippet: <|code_start|> logger.info("Added {}: {id}".format(msg, id=msg.id))
return "ok: {}".format(msg)
else:
return "fail: None"
# end if
except Exception as e:
logger.exception("lel")
raise
# end def
@app.route(API_V1+"/get_value")
@app.r... | SELECT * FROM DBmessage |
Given the code snippet: <|code_start|> logger.info("Added {}: {id}".format(msg, id=msg.id))
return "ok: {}".format(msg)
else:
return "fail: None"
# end if
except Exception as e:
logger.exception("lel")
raise
# end def
@app.route(API_V1+"/get_value... | SELECT * FROM DBmessage |
Predict the next line after this snippet: <|code_start|># -*- coding: utf-8 -*-
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
VERSION = "0.0.1"
__version__ = VERSION
assert INIT == INIT # to prevent the unused import warning. Is used in SQL statement.
app = Flask(__name__)
debug = DebuggedApplic... | return "fail: None" |
Next line prediction: <|code_start|> db.commit()
logger.info("Added {}: {id}".format(msg, id=msg.id))
return "ok: {}".format(msg)
else:
return "fail: None"
# end if
except Exception as e:
logger.exception("lel")
raise
# end def
@app.ro... | SELECT DISTINCT ON (m.node) * FROM ( |
Based on the snippet: <|code_start|>
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
VERSION = "0.0.1"
__version__ = VERSION
assert INIT == INIT # to prevent the unused import warning. Is used in SQL statement.
app = Flask(__name__)
debug = DebuggedApplication(app, console_path="/console/")
API_V1 =... | logger.exception("lel") |
Predict the next line after this snippet: <|code_start|># -*- coding: utf-8 -*-
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
VERSION = "0.0.1"
__version__ = VERSION
<|code_end|>
using the current file's imports:
from datetime import datetime
from DictObject import DictObject
from flask import F... | assert INIT == INIT # to prevent the unused import warning. Is used in SQL statement. |
Based on the snippet: <|code_start|> for msg in latest_values:
assert isinstance(msg, DBInitMessage)
data[str(msg.node)] = msg.value
# end for
return jsonify(data, allow_all_origin=True)
# end def
@app.route(API_V2+"/get_value")
@app.route(API_V2+"/get_value/")
@orm.db_session
def get_value... | ) as m ORDER BY m.node, m.date DESC |
Based on the snippet: <|code_start|># -*- coding: utf-8 -*-
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
VERSION = "0.0.1"
__version__ = VERSION
assert INIT == INIT # to prevent the unused import warning. Is used in SQL statement.
app = Flask(__name__)
debug = DebuggedApplication(app, console_p... | API_V2 = "/api/v2" |
Predict the next line for this snippet: <|code_start|># -*- coding: utf-8 -*-
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
VERSION = "0.0.1"
<|code_end|>
with the help of current file imports:
from datetime import datetime
from DictObject import DictObject
from flask import Flask, request
from ... | __version__ = VERSION |
Given the code snippet: <|code_start|>
logger = logging.getLogger('sync_point')
sync_points = datastore.Datastore('SyncPoint',
'key', 'satisfied', 'stack_key')
KEY_SEPARATOR = ':'
def _dump_list(items, separator=', '):
return separator.join(map(str, items))
def make_key(*co... | waiting = predecessors - set(satisfied) |
Given the following code snippet before the placeholder: <|code_start|>
class RealityStore(object):
def __init__(self):
self.store = datastore.Datastore('PhysicalResource', 'uuid',
<|code_end|>
, predict the next line using imports from the current file:
from .framework import datastore
import copy
impor... | 'logical_name', 'properties') |
Here is a snippet: <|code_start|>
def with_scenarios(TestCase):
loader = unittest.defaultTestLoader
def create_test_func(generic_test, params):
@functools.wraps(generic_test)
def test_func(testcase, *args, **kwargs):
for key, value in params.items():
setattr(testcas... | class ScenarioTest(unittest.TestCase): |
Using the snippet: <|code_start|># Tally range-style addresses on a per address file level.
def findRanges(buildings):
def isQueens(housenumber):
return bool(re.search(r'(\w+-\w+)', housenumber))
onlyRanges = 0 ## Buildings with only range house numbers
<|code_end|>
, determine the next line of code. Y... | onlyRangesQueens = 0 ## Buildings with only range house numbers that are queens style |
Predict the next line after this snippet: <|code_start|> if dbf_file:
self.dbf_file = dbf_file
else:
dbf_file = self.dbf_file
self.dbf_length = None
self.row_count = 0
self.last_row_count = 0
self.progress_last_timestamp = 0
self.open_dbf_s... | self.progress_window.set_transient_for(self.window) |
Given the code snippet: <|code_start|># noinspection PyUnusedLocal
timezone = pytz.timezone('Europe/Helsinki')
def describe_fmi_api():
daily_4_days = load_xml('./tests/fmiapi/testdata/daily_4_days.xml')
daily_12_days = load_xml('./tests/fmiapi/testdata/daily_12_days.xml')
html_apikey_error = load_txt('./... | html_apikey_missing_error = load_txt('./tests/fmiapi/testdata/apikey_missing.html') |
Using the snippet: <|code_start|>
def describe_fmi_catalog_service():
lammi_catalog_metadata = load_xml('./tests/fmiapi/testdata/lammi_catalog_metadata.xml')
search_exception_response = load_xml('./tests/fmiapi/testdata/search_exception_response.xml')
@mock.patch('http.client.HTTPConnection', spec=True)
... | def describe_fmi_returns_search_exception(): |
Based on the snippet: <|code_start|>
def describe_fmi_catalog_service():
lammi_catalog_metadata = load_xml('./tests/fmiapi/testdata/lammi_catalog_metadata.xml')
search_exception_response = load_xml('./tests/fmiapi/testdata/search_exception_response.xml')
@mock.patch('http.client.HTTPConnection', spec=True... | assert result[i]['starttime'] == record['starttime'] |
Predict the next line after this snippet: <|code_start|>
class Settings(QSettings):
def __init__(self):
super().__init__("fmidownloader", "fmidownloader")
def load_qsettings(self, app):
<|code_end|>
using the current file's imports:
from PyQt5.QtCore import QSettings
from gui.messages import Message... | self._load_lang_settings(app) |
Next line prediction: <|code_start|>timezone = pytz.timezone('Europe/Helsinki')
def describe_fmi_request_handler():
fmi_handler = FMIRequestHandler('apikey')
_DAILY_REQUEST_MAX_RANGE_HOURS = 8928
_REALTIME_REQUEST_MAX_RANGE_HOURS = 168
@mock.patch('fmiapi.fmirequesthandler.FMIRequest', spec=True)
... | mock_instance.get.assert_has_calls([call(expected)]) |
Next line prediction: <|code_start|> handler = FMIRequestHandler('apikey')
result = handler.request(query, max_timespan=_DAILY_REQUEST_MAX_RANGE_HOURS, progress_callback=None)
mock_instance.get.assert_has_calls([call(expected)])
assert_equal(1, mock_instance.get.call_count)
asser... | query = create_daily_query(datetime(2010, 1, 1, hour=0, minute=1, second=0, microsecond=0, tzinfo=timezone), |
Next line prediction: <|code_start|> self.client_manager = self.cs
self.app.client_manager.tackerclient = self.client_manager
@ddt.ddt
class TestVnfLcmVersions(TestVnfLcm):
def setUp(self):
super(TestVnfLcmVersions, self).setUp()
self.vnflcm_versions = vnflcm_versions.VnfLcmVersion... | parsed_args = parser.parse_args(["--major-version", "3"]) |
Predict the next line for this snippet: <|code_start|># under the License.
class TestVnfLcm(base.FixturedTestCase):
client_fixture_class = client.ClientFixture
def setUp(self):
super(TestVnfLcm, self).setUp()
self.url = client.TACKER_URL
self.header = {'content-type': 'applicati... | "apiVersions": [{"version": "1.3.0", |
Using the snippet: <|code_start|>#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | @ddt.ddt |
Given the code snippet: <|code_start|> self.client_manager = self.cs
self.app.client_manager.tackerclient = self.client_manager
@ddt.ddt
class TestVnfLcmVersions(TestVnfLcm):
def setUp(self):
super(TestVnfLcmVersions, self).setUp()
self.vnflcm_versions = vnflcm_versions.VnfLcmVersi... | parsed_args = parser.parse_args(["--major-version", "3"]) |
Based on the snippet: <|code_start|>
class CLITestV10VmVNFFGDJSON(test_cli10.CLITestV10Base):
_RESOURCE = 'vnffgd'
_RESOURCES = 'vnffgds'
def setUp(self):
plurals = {'vnffgds': 'vnffgd'}
super(CLITestV10VmVNFFGDJSON, self).setUp(plurals=plurals)
@patch("tackerclient.tacker.v1_0.nfvo.... | } |
Here is a snippet: <|code_start|> help=_("Instantiate VNF subsequently after it's creation. "
"Specify instantiate request parameters in a json file."))
return parser
def args2body(self, parsed_args, file_path=None):
body = {}
if file_path:
return ... | ' request has been accepted.') % {'id': vnf['id']})) |
Predict the next line for this snippet: <|code_start|># a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIO... | if parsed_args.major_version: |
Given the code snippet: <|code_start|>
def test_convert_pil_image(image):
converted_image = convert_pil_image(image, 4, 4)
assert converted_image.mode == '1'
<|code_end|>
, generate the next line using the imports in this file:
import pytest
from simple_zpl2.utils import convert_pil_image
and context (fu... | @pytest.mark.parametrize('compression_type', ( |
Using the snippet: <|code_start|> name = "kiwix-desktop"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-desktop.git"
git_dir = "kiwix-desktop"
class Builder(QMakeBuilder):
dependencies = ["qt", "qtwebengine", "libkiwix", "aria2"]
... | return " ".join(options) |
Next line prediction: <|code_start|>
class KiwixDesktop(Dependency):
name = "kiwix-desktop"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-desktop.git"
git_dir = "kiwix-desktop"
class Builder(QMakeBuilder):
dependencies = ["qt", "qtweben... | make_install_target = 'install' |
Given the code snippet: <|code_start|>
class KiwixDesktop(Dependency):
name = "kiwix-desktop"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-desktop.git"
git_dir = "kiwix-desktop"
class Builder(QMakeBuilder):
dependencies = ["qt", "qtweb... | ] |
Continue the code snippet: <|code_start|>
class NativePlatformInfo(PlatformInfo):
build = 'native'
def get_env(self):
env = super().get_env()
if neutralEnv('distname') == 'fedora':
<|code_end|>
. Use current file imports:
from .base import PlatformInfo
from kiwixbuild.utils import pj
from ki... | env['QT_SELECT'] = "5-64" |
Here is a snippet: <|code_start|>
class NativePlatformInfo(PlatformInfo):
build = 'native'
def get_env(self):
<|code_end|>
. Write the next line using the current file imports:
from .base import PlatformInfo
from kiwixbuild.utils import pj
from kiwixbuild._global import option, neutralEnv
and context from ... | env = super().get_env() |
Based on the snippet: <|code_start|>
class FlatpakPlatformInfo(PlatformInfo):
name = 'flatpak'
build = 'flatpak'
static = ''
<|code_end|>
, predict the immediate next line with the help of imports:
from .base import PlatformInfo
from kiwixbuild._global import option, neutralEnv
and context (classes, funct... | toolchain_names = ['org.kde', 'io.qt.qtwebengine'] |
Based on the snippet: <|code_start|>
class AndroidPlatformInfo(PlatformInfo):
build = 'android'
static = True
toolchain_names = ['android-ndk']
compatible_hosts = ['fedora', 'debian']
<|code_end|>
, predict the immediate next line with the help of imports:
from .base import PlatformInfo, MetaPlatform... | def __str__(self): |
Continue the code snippet: <|code_start|>
class Remotefile(namedtuple('Remotefile', ('name', 'sha256', 'url'))):
def __new__(cls, name, sha256, url=None):
if url is None:
url = REMOTE_PREFIX + name
return super().__new__(cls, name, sha256, url)
class Context:
def __init__(self, co... | pass |
Here is a snippet: <|code_start|> file_path = str(HOME / base_name)
batch_size = 1024 * 1024 * 8
with urlopen(url) as resource, open(file_path, "wb") as file:
while True:
batch = resource.read(batch_size)
if not batch:
break
print(".", end="", flush... | if PLATFORM_TARGET == "android": |
Predict the next line after this snippet: <|code_start|>
class armhf_toolchain(Dependency):
dont_skip = True
neutral = True
name = 'armhf'
class Source(ReleaseDownload):
archive = Remotefile('raspberrypi-tools.tar.gz',
<|code_end|>
using the current file's imports:
from .base import Dependenc... | 'e72b35436f2f23f2f7df322d6c318b9be57b21596b5ff0b8936af4ad94e04f2e') |
Given snippet: <|code_start|>
class zstd(Dependency):
name = 'zstd'
class Source(ReleaseDownload):
archive = Remotefile('zstd-1.5.1.tar.gz',
<|code_end|>
, continue by predicting the next line. Consider current file imports:
from .base import (
Dependency,
ReleaseDownload,
MesonBuilder)... | 'e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002', |
Given the code snippet: <|code_start|>
class ApplePlatformInfo(PlatformInfo):
build = 'iOS'
static = True
compatible_hosts = ['Darwin']
arch = None
<|code_end|>
, generate the next line using the imports in this file:
import subprocess
from kiwixbuild._global import option
from kiwixbuild.utils impor... | host = None |
Using the snippet: <|code_start|>def fix_macos_rpath(project):
base_dir, export_files = EXPORT_FILES[project]
for file in filter(lambda f: f.endswith(".dylib"), export_files):
lib = base_dir / file
if lib.is_symlink():
continue
command = ["install_name_tool", "-id", lib.name... | token=os.getenv('GITHUB_PAT', '')), |
Continue the code snippet: <|code_start|>
PLATFORM_TARGET = _environ["PLATFORM_TARGET"]
if PLATFORM_TARGET == "native_desktop":
PLATFORM_TARGET = "native_dyn"
DESKTOP = True
else:
<|code_end|>
. Use current file imports:
import os
import tarfile
import zipfile
import subprocess
import re
import shutil
import... | DESKTOP = False |
Predict the next line for this snippet: <|code_start|> return self._detect_binary('qmake-qt5', 'qmake')
class BuildEnv:
def __init__(self, platformInfo):
build_dir = "BUILD_{}".format(platformInfo.name)
self.platformInfo = platformInfo
self.build_dir = pj(option('working_dir'), buil... | return os.path.isfile('/etc/debian_version') |
Predict the next line for this snippet: <|code_start|> self.archive_dir,
self.toolchain_dir,
self.log_dir):
os.makedirs(d, exist_ok=True)
self.detect_platform()
self.ninja_command = self._detect_ninja()
if not self.ninja_command:
... | def download(self, what, where=None): |
Here is a snippet: <|code_start|> self.toolchain_dir,
self.log_dir):
os.makedirs(d, exist_ok=True)
self.detect_platform()
self.ninja_command = self._detect_ninja()
if not self.ninja_command:
sys.exit("ERROR: ninja command not found.")
... | where = where or self.archive_dir |
Predict the next line for this snippet: <|code_start|>
class AllBaseDependencies(Dependency):
name = "alldependencies"
Source = NoopSource
class Builder(NoopBuilder):
@classmethod
def get_dependencies(cls, platformInfo, allDeps):
base_deps = ['zlib', 'lzma', 'zstd', 'xapian-cor... | base_deps += ['docoptcpp'] |
Predict the next line after this snippet: <|code_start|>
class AllBaseDependencies(Dependency):
name = "alldependencies"
Source = NoopSource
class Builder(NoopBuilder):
@classmethod
<|code_end|>
using the current file's imports:
from .base import (
Dependency,
NoopSource,
NoopBuilder... | def get_dependencies(cls, platformInfo, allDeps): |
Given snippet: <|code_start|>
class AllBaseDependencies(Dependency):
name = "alldependencies"
Source = NoopSource
class Builder(NoopBuilder):
@classmethod
def get_dependencies(cls, platformInfo, allDeps):
base_deps = ['zlib', 'lzma', 'zstd', 'xapian-core', 'pugixml', 'libcurl',... | if platformInfo.build not in ('android', 'iOS'): |
Based on the snippet: <|code_start|>
class AllBaseDependencies(Dependency):
name = "alldependencies"
Source = NoopSource
class Builder(NoopBuilder):
<|code_end|>
, predict the immediate next line with the help of imports:
from .base import (
Dependency,
NoopSource,
NoopBuilder)
from kiwixbuil... | @classmethod |
Predict the next line for this snippet: <|code_start|>
class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
archive = Remotefile('libmicrohttpd-0.9.72.tar.gz',
'0ae825f8e0d7f41201fd44a0df1cf454c1cb0bc50fe9d59c26552260264c2ff8',
<|code_end|>
... | 'https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.72.tar.gz') |
Based on the snippet: <|code_start|>
class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
archive = Remotefile('libmicrohttpd-0.9.72.tar.gz',
<|code_end|>
, predict the immediate next line with the help of imports:
from .base import (
Dependency,
ReleaseDownload... | '0ae825f8e0d7f41201fd44a0df1cf454c1cb0bc50fe9d59c26552260264c2ff8', |
Given snippet: <|code_start|>
class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
archive = Remotefile('libmicrohttpd-0.9.72.tar.gz',
<|code_end|>
, continue by predicting the next line. Consider current file imports:
from .base import (
Dependency,
ReleaseDown... | '0ae825f8e0d7f41201fd44a0df1cf454c1cb0bc50fe9d59c26552260264c2ff8', |
Based on the snippet: <|code_start|>
class docoptcpp(Dependency):
name = 'docoptcpp'
class Source(GitClone):
<|code_end|>
, predict the immediate next line with the help of imports:
from .base import (
Dependency,
GitClone,
CMakeBuilder)
from kiwixbuild.utils import Remotefile
and context (cla... | git_remote = "https://github.com/docopt/docopt.cpp.git" |
Continue the code snippet: <|code_start|>
class ZimTestingSuite(Dependency):
name = "zim-testing-suite"
dont_skip = True
class Source(ReleaseDownload):
archive = Remotefile('zim-testing-suite-0.3.tar.gz',
<|code_end|>
. Use current file imports:
from .base import (
Dependency,
ReleaseDow... | 'cd7d1ccc48af3783af9156cb6bf3c18d9a3319a73fdeefe65f0b4cae402d3d66', |
Predict the next line for this snippet: <|code_start|>
class I586PlatformInfo(PlatformInfo):
build = 'i586'
arch_full = 'i586-linux-gnu'
compatible_hosts = ['fedora', 'debian']
def get_cross_config(self):
return {
'binaries': self.binaries,
'exe_wrapper_def': '',
... | return '--host={}'.format(self.arch_full) |
Based on the snippet: <|code_start|>
class I586PlatformInfo(PlatformInfo):
build = 'i586'
arch_full = 'i586-linux-gnu'
compatible_hosts = ['fedora', 'debian']
def get_cross_config(self):
return {
'binaries': self.binaries,
'exe_wrapper_def': '',
'extra_libs... | } |
Given the code snippet: <|code_start|>
class Win32PlatformInfo(PlatformInfo):
build = 'win32'
compatible_hosts = ['fedora', 'debian']
arch_full = 'i686-w64-mingw32'
<|code_end|>
, generate the next line using the imports in this file:
import subprocess
from .base import PlatformInfo
from kiwixbuild.utils... | extra_libs = ['-lwinmm', '-lshlwapi', '-lws2_32', '-lssp'] |
Continue the code snippet: <|code_start|>
class Win64PlatformInfo(PlatformInfo):
extra_libs = ['-lmingw32', '-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4', '-lmsvcr100', '-liphlpapi', '-lshell32', '-lkernel32']
build = 'win64'
compatible_hosts = ['fedora', 'debian']
arch_full = 'x86_64-w64-mingw32'
... | 'extra_cflags': ['-DWIN32'], |
Continue the code snippet: <|code_start|>
class Win64PlatformInfo(PlatformInfo):
extra_libs = ['-lmingw32', '-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4', '-lmsvcr100', '-liphlpapi', '-lshell32', '-lkernel32']
build = 'win64'
compatible_hosts = ['fedora', 'debian']
arch_full = 'x86_64-w64-mingw32'
... | 'system': 'Windows', |
Given snippet: <|code_start|>
class Win64PlatformInfo(PlatformInfo):
extra_libs = ['-lmingw32', '-lwinmm', '-lws2_32', '-lshlwapi', '-lrpcrt4', '-lmsvcr100', '-liphlpapi', '-lshell32', '-lkernel32']
build = 'win64'
compatible_hosts = ['fedora', 'debian']
arch_full = 'x86_64-w64-mingw32'
def get_c... | 'host_machine': { |
Using the snippet: <|code_start|>
class UUID(Dependency):
name = 'uuid'
class Source(ReleaseDownload):
archive = Remotefile('e2fsprogs-libs-1.43.4.tar.gz',
'eed4516325768255c9745e7b82c9d7d0393abce302520a5b2cde693204b0e419',
<|code_end|>
, determine the next line of code. ... | 'https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.43.4/e2fsprogs-libs-1.43.4.tar.gz') |
Next line prediction: <|code_start|>
class Pugixml(Dependency):
name = "pugixml"
class Source(ReleaseDownload):
archive = Remotefile('pugixml-1.2.tar.gz',
<|code_end|>
. Use current file imports:
(from .base import (
Dependency,
ReleaseDownload,
MesonBuilder)
from kiwixbuild.utils import ... | '0f422dad86da0a2e56a37fb2a88376aae6e931f22cc8b956978460c9db06136b') |
Continue the code snippet: <|code_start|>
class Pugixml(Dependency):
name = "pugixml"
class Source(ReleaseDownload):
archive = Remotefile('pugixml-1.2.tar.gz',
<|code_end|>
. Use current file imports:
from .base import (
Dependency,
ReleaseDownload,
MesonBuilder)
from kiwixbuild.utils imp... | '0f422dad86da0a2e56a37fb2a88376aae6e931f22cc8b956978460c9db06136b') |
Predict the next line after this snippet: <|code_start|>
class Pugixml(Dependency):
name = "pugixml"
class Source(ReleaseDownload):
archive = Remotefile('pugixml-1.2.tar.gz',
<|code_end|>
using the current file's imports:
from .base import (
Dependency,
ReleaseDownload,
MesonBuilder)
fro... | '0f422dad86da0a2e56a37fb2a88376aae6e931f22cc8b956978460c9db06136b') |
Predict the next line after this snippet: <|code_start|> force_build = False
force_native_build = False
dont_skip = False
@classmethod
def version(cls):
if cls.name in base_deps_versions:
return base_deps_versions[cls.name]
elif option('make_release'):
return ... | @property |
Using the snippet: <|code_start|> options = ""
if 'QMAKE_CC' in os.environ:
options += 'QMAKE_CC={} '.format(os.environ['QMAKE_CC'])
if 'QMAKE_CXX' in os.environ:
options += 'QMAKE_CXX={} '.format(os.environ['QMAKE_CXX'])
return options
def _configure(self, co... | ) |
Here is a snippet: <|code_start|> return base_source_path
@property
def build_path(self):
return pj(self.buildEnv.build_dir, self.target.full_name())
@property
def _log_dir(self):
return self.buildEnv.log_dir
def command(self, name, function, *args):
print(" {} {} ... | with open(log, 'r') as f: |
Given snippet: <|code_start|>
@property
def strip_option(self):
return '--strip' if option('make_release') else ''
@property
def library_type(self):
return 'static' if self.buildEnv.platformInfo.static else 'shared'
def _configure(self, context):
context.no_skip = False
... | strip_option=self.strip_option, |
Using the snippet: <|code_start|> return pj(neutralEnv('source_dir'), self.source_dir)
@property
def _log_dir(self):
return neutralEnv('log_dir')
def _patch(self, context):
context.try_skip(self.source_path)
for p in self.patches:
with open(pj(SCRIPT_DIR, 'patche... | with open(log, 'r') as f: |
Predict the next line after this snippet: <|code_start|> force_native_build = False
dont_skip = False
@classmethod
def version(cls):
if cls.name in base_deps_versions:
return base_deps_versions[cls.name]
elif option('make_release'):
return main_project_versions.ge... | def full_name(self): |
Next line prediction: <|code_start|> ):
raise SkipCommand()
command = "{} --verbose {}".format(neutralEnv('mesontest_command'), self.test_option)
env = self.get_env(cross_comp_flags=False, cross_compilers=False, cross_path=True)
run_command(command, self.build_path, context... | context.try_skip(self.build_path) |
Next line prediction: <|code_start|> context.no_skip = True
try:
start_time = time.time()
ret = function(*args, context=context)
context._finalise()
duration = time.time() - start_time
print(colorize("OK"), "({:.1f}s)".format(duration))
... | self.command('test', self._test) |
Next line prediction: <|code_start|> def strip_option(self):
return '--strip' if option('make_release') else ''
@property
def library_type(self):
return 'static' if self.buildEnv.platformInfo.static else 'shared'
def _configure(self, context):
context.no_skip = False
con... | configure_option=configure_option, |
Here is a snippet: <|code_start|> context.no_skip = True
try:
start_time = time.time()
ret = function(*args, context=context)
context._finalise()
duration = time.time() - start_time
print(colorize("OK"), "({:.1f}s)".format(duration))
... | self.command('test', self._test) |
Predict the next line for this snippet: <|code_start|> module['buildir'] = True
class QMakeBuilder(MakeBuilder):
qmake_target = ""
flatpak_buildsystem = 'qmake'
@property
def env_option(self):
options = ""
if 'QMAKE_CC' in os.environ:
options += 'QMAKE_CC={} '.forma... | env = self.get_env(cross_comp_flags=True, cross_compilers=False, cross_path=True) |
Given snippet: <|code_start|>class NoopSource(Source):
def prepare(self):
pass
class ReleaseDownload(Source):
archive_top_dir = None
@property
def extract_path(self):
return pj(neutralEnv('source_dir'), self.source_dir)
def _download(self, context):
context.try_skip(neutr... | if hasattr(self, '_post_prepare_script'): |
Given snippet: <|code_start|>class _MetaDependency(type):
def __new__(cls, name, bases, dct):
_class = type.__new__(cls, name, bases, dct)
if name != 'Dependency':
dep_name = dct['name']
Dependency.all_deps[dep_name] = _class
return _class
class Dependency(metaclass... | class Source: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.