lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"import binascii\n",
"import errno\n",
"import random\n",
"import subprocess\n",
"import sys\n",
"import os\n",
"import re\n",
"import socket\n",
"import argparse\n",
"from datetime import datetime, timedelta, date\n",
"import ipaddress\n",
"import logging\n",
"import calendar\n",
"import ... | [
"import binascii\n",
"import errno\n",
"import random\n",
"import subprocess\n",
"import sys\n",
"import os\n",
"import re\n",
"import socket\n",
"import argparse\n",
"from datetime import datetime, timedelta, date\n",
"import ipaddress\n",
"import logging\n",
"import calendar\n",
"import ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Import'",
"Import'",
"Import'",
"FunctionDef'",
"Expr'",
"Assign'",
"FunctionDef'",
"Condition",
"Co... |
[
"def FUNC_14(VAR_15, VAR_16, VAR_17, VAR_18, VAR_19, VAR_20):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_20 is not None:\n",
"VAR_41 = VAR_20.copy()\n",
"if VAR_17 is not None:\n",
"if 'CPU' in VAR_41 or 'GPU' in VAR_41:\n",
"VAR_41 = VAR_17.copy()\n",
"VAR_41 = {}\n",
"assert VAR_15 is not None\n",
... | [
"def resources_from_resource_arguments(default_num_cpus, default_num_gpus,...\n",
"\"\"\"docstring\"\"\"\n",
"if runtime_resources is not None:\n",
"resources = runtime_resources.copy()\n",
"if default_resources is not None:\n",
"if 'CPU' in resources or 'GPU' in resources:\n",
"resources = default_reso... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assert'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"@property...\n",
"return base64.b64encode((self.rule.name + ''.join(self.output)).encode('utf-8')\n ).decode('utf-8')\n"
] | [
"@property...\n",
"return base64.b64encode((self.rule.name + ''.join(self.output)).encode('utf-8')\n ).decode('utf-8')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@memoized_property...\n",
"return {SubclassesOf(PythonDistribution): self.pydist_has_native_sources,\n SubclassesOf(NativeLibrary): NativeLibrary.produces_ctypes_native_library}\n"
] | [
"@memoized_property...\n",
"return {SubclassesOf(PythonDistribution): self.pydist_has_native_sources,\n SubclassesOf(NativeLibrary): NativeLibrary.produces_ctypes_native_library}\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_0):...\n",
""
] | [
"def __init__(self, txt):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_3(VAR_6, VAR_8):...\n",
"VAR_10 = settings.DYNAMIC_LINK\n",
"if len(VAR_10) > 0:\n",
"VAR_11 = '{}{}/{}'.format(settings.PUBLIC_DOMAIN, VAR_3, VAR_8)\n",
"VAR_12 = '{}{}/{}'.format(settings.APP_DEEPLINK_DOMAIN, VAR_5, VAR_8)\n",
"VAR_12 = VAR_10.format(VAR_11)\n",
"VAR_9 = HttpResponse('', sta... | [
"def profile_redirect(request, username):...\n",
"dynamic_link = settings.DYNAMIC_LINK\n",
"if len(dynamic_link) > 0:\n",
"real_link = '{}{}/{}'.format(settings.PUBLIC_DOMAIN, PROFILE_PATH, username)\n",
"link = '{}{}/{}'.format(settings.APP_DEEPLINK_DOMAIN, PROFILE_DEEPLINK_PATH,\n username)\n",
"link... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_14(self):...\n",
"self.run_test_case(self.scenario.delete_app(), retry_interval_secs=8,\n max_retries=8)\n"
] | [
"def test_z_delete_app(self):...\n",
"self.run_test_case(self.scenario.delete_app(), retry_interval_secs=8,\n max_retries=8)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __str__(self):...\n",
"return str(self.id)\n"
] | [
"def __str__(self):...\n",
"return str(self.id)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_33(VAR_57, VAR_22):...\n",
"if not len(VAR_57):\n",
"VAR_56.append('/%s' % ('/'.join(VAR_22),))\n",
"if VAR_57[0] == '.':\n",
"FUNC_33(VAR_57[1:], VAR_22)\n",
"if VAR_57[0] == '..':\n",
"FUNC_33(VAR_57[1:], VAR_22[:-1])\n",
"VAR_65 = [x[VAR_1] for x in self.get_path('/'.join(VAR_22))]\n",
... | [
"def foo(p, cwd):...\n",
"if not len(p):\n",
"found.append('/%s' % ('/'.join(cwd),))\n",
"if p[0] == '.':\n",
"foo(p[1:], cwd)\n",
"if p[0] == '..':\n",
"foo(p[1:], cwd[:-1])\n",
"names = [x[A_NAME] for x in self.get_path('/'.join(cwd))]\n",
"matches = [x for x in names if fnmatch.fnmatchcase(x, p[0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_3(VAR_2=None):...\n",
"if VAR_2 is None:\n",
"VAR_2 = VAR_0\n",
"VAR_14 = []\n",
"for import_str, py2pkg, py3pkg in VAR_2:\n",
"return VAR_14\n",
"FUNC_0(import_str, py2pkg, py3pkg)\n",
"VAR_14.append(e)\n"
] | [
"def check_imports(imports=None):...\n",
"if imports is None:\n",
"imports = REQUIRED_IMPORTS\n",
"mdeps = []\n",
"for import_str, py2pkg, py3pkg in imports:\n",
"return mdeps\n",
"check_import(import_str, py2pkg, py3pkg)\n",
"mdeps.append(e)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"For",
"Return'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_10):...\n",
"super().__init__(self)\n",
"self.path = VAR_10\n"
] | [
"def __init__(self, path):...\n",
"super().__init__(self)\n",
"self.path = path\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_17():...\n",
"populate_test_database()\n",
"VAR_11 = VAR_3.put('/videos/1/1/2')\n",
"assert VAR_11.json['status'] == 'NOK'\n",
"assert VAR_11.json['message'] != None\n"
] | [
"def test_should_return_a_not_ok_status_when_updating_a_video_from_an_unknown_id(...\n",
"populate_test_database()\n",
"response = test_app.put('/videos/1/1/2')\n",
"assert response.json['status'] == 'NOK'\n",
"assert response.json['message'] != None\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_28(VAR_38):...\n",
"return [item for item in VAR_10 if item['command'] == VAR_38]\n"
] | [
"def get_command(command_name):...\n",
"return [item for item in commands if item['command'] == command_name]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_22():...\n",
"\"\"\"docstring\"\"\"\n",
"mdadm.mdadm_assemble(scan=True, ignore_errors=True)\n",
"util.subp(['modprobe', 'bcache'], rcs=[0, 1])\n"
] | [
"def start_clear_holders_deps():...\n",
"\"\"\"docstring\"\"\"\n",
"mdadm.mdadm_assemble(scan=True, ignore_errors=True)\n",
"util.subp(['modprobe', 'bcache'], rcs=[0, 1])\n"
] | [
0,
0,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_6):...\n",
"self.path = os.path.dirname(VAR_6)\n",
"self.filename = os.path.basename(VAR_6)\n",
"self.node_number = re.search('\\\\b\\\\d{14}\\\\b|$', VAR_6).group(0)\n",
"self.index = re.search('^\\\\d{2}\\\\b|$', VAR_6).group(0)\n",
"self.title = re.search('[^\\\\d]+|$', VAR_6).g... | [
"def __init__(self, filename):...\n",
"self.path = os.path.dirname(filename)\n",
"self.filename = os.path.basename(filename)\n",
"self.node_number = re.search('\\\\b\\\\d{14}\\\\b|$', filename).group(0)\n",
"self.index = re.search('^\\\\d{2}\\\\b|$', filename).group(0)\n",
"self.title = re.search('[^\\\\d... | [
0,
1,
0,
0,
0,
1,
1
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def create_snapshot(self, snapshot):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_2(VAR_5, VAR_6='', VAR_7='', VAR_8=0, VAR_9='', VAR_10=''):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_7:\n",
"VAR_7 = VAR_5.downpath\n",
"VAR_19 = FUNC_5(VAR_7)\n",
"VAR_6 = FUNC_5(VAR_6)\n",
"VAR_10 = FUNC_5(VAR_10)\n",
"VAR_30, VAR_31, VAR_32 = VAR_5.repair_opts\n",
"VAR_33 = FUNC_5(... | [
"def build_history_info(nzo, storage='', downpath='', postproc_time=0,...\n",
"\"\"\"docstring\"\"\"\n",
"if not downpath:\n",
"downpath = nzo.downpath\n",
"path = decode_factory(downpath)\n",
"storage = decode_factory(storage)\n",
"script_line = decode_factory(script_line)\n",
"flagRepair, flagUnpack... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assig... |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.docstring = VAR_68\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.docstring = string\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __call__(self, VAR_2, VAR_3, VAR_4=None):...\n",
"if VAR_3.strip():\n",
"return\n",
"VAR_67 = date.today()\n",
"VAR_68 = VAR_67.isocalendar()[1]\n",
"VAR_69 = VAR_67.year\n",
"VAR_70 = ''\n",
"if VAR_68 % 2 == 0:\n",
"VAR_70 = 'even'\n",
"VAR_70 = 'odd'\n",
"self.reply(VAR_2,\n 'Current ... | [
"def __call__(self, msg, arguments, errorSink=None):...\n",
"if arguments.strip():\n",
"return\n",
"current_date = date.today()\n",
"current_cw = current_date.isocalendar()[1]\n",
"current_year = current_date.year\n",
"paritystr = ''\n",
"if current_cw % 2 == 0:\n",
"paritystr = 'even'\n",
"parity... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"import time\n",
"VAR_0 = 'pos.open.statement'\n",
"VAR_1 = 'Open Statements'\n",
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = []\n",
"VAR_7 = self.pool.get('ir.model.data')\n",
"VAR_8 = self.p... | [
"from osv import osv\n",
"from tools.translate import _\n",
"import time\n",
"_name = 'pos.open.statement'\n",
"_description = 'Open Statements'\n",
"def open_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'... |
[
"def __init__(self, *VAR_3, **VAR_4):...\n",
"VAR_11 = VAR_4.pop('execute', self.san_execute)\n",
"super(CLASS_0, self).__init__(*VAR_3, VAR_11=execute, **kwargs)\n",
"self.configuration.append_config_values(VAR_1)\n",
"self.run_local = self.configuration.san_is_local\n",
"self.sshpool = None\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"execute = kwargs.pop('execute', self.san_execute)\n",
"super(SanDriver, self).__init__(*args, execute=execute, **kwargs)\n",
"self.configuration.append_config_values(san_opts)\n",
"self.run_local = self.configuration.san_is_local\n",
"self.sshpool = None\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self):...\n",
"return '{0}'.format(self.name)\n"
] | [
"def select(self):...\n",
"return '{0}'.format(self.name)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getint(self.section, 'login_state_ttl')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getint(self.section, 'login_state_ttl')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"from lxml import etree\n",
"from cinder import exception\n",
"from cinder.openstack.common import log as logging\n",
"from cinder.volume.drivers.san.san import SanISCSIDriver\n",
"VAR_0 = logging.getLogger(__name__)\n",
"\"\"\"string\"\"\"\n",
"VAR_1 = {}\n",
"def __init__(s... | [
"\"\"\"\nHP Lefthand SAN ISCSI Driver.\n\nThe driver communicates to the backend aka Cliq via SSH to perform all the\noperations on the SAN.\n\"\"\"\n",
"from lxml import etree\n",
"from cinder import exception\n",
"from cinder.openstack.common import log as logging\n",
"from cinder.volume.drivers.san.san i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
2,
2,
2
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_9=None):...\n",
"if VAR_9 is None:\n",
"VAR_9 = self\n",
"VAR_21 = VAR_20.path.join(self.parlai_home, 'data')\n",
"VAR_9.add_argument('-dp', '--datapath', default=default_data_path, help=\n 'path to datasets, defaults to {parlai_dir}/data')\n"
] | [
"def add_parlai_data_path(self, argument_group=None):...\n",
"if argument_group is None:\n",
"argument_group = self\n",
"default_data_path = os.path.join(self.parlai_home, 'data')\n",
"argument_group.add_argument('-dp', '--datapath', default=default_data_path,\n help='path to datasets, defaults to {parla... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_3):...\n",
"VAR_33 = False\n",
"VAR_34 = 1\n",
"while not VAR_33:\n",
"VAR_7 = VAR_3.replace('###', str(VAR_34))\n",
"return VAR_34\n",
"VAR_6, VAR_45 = FUNC_5(VAR_7)\n",
"if VAR_45 < 300 and FUNC_7(VAR_6, VAR_7=base_url):\n",
"if VAR_1:\n",
"if VAR_1:\n",
"print('url ' + VAR_7 +... | [
"def _get_first_valid_url(base_url):...\n",
"valid = False\n",
"index = 1\n",
"while not valid:\n",
"url = base_url.replace('###', str(index))\n",
"return index\n",
"data, status = hit_url(url)\n",
"if status < 300 and is_valid(data, url=base_url):\n",
"if debug:\n",
"if debug:\n",
"print('url '... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_10(self, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = ['volume', 'select', VAR_16['name'], 'show']\n",
"self._eql_execute(*VAR_11)\n",
"if err.stdout.find('does not exist.\\n') > -1:\n",
"VAR_0.debug(_('Volume %s does not exist, it may have already been deleted'),\n VAR_16['name'])\n"... | [
"def _check_volume(self, volume):...\n",
"\"\"\"docstring\"\"\"\n",
"command = ['volume', 'select', volume['name'], 'show']\n",
"self._eql_execute(*command)\n",
"if err.stdout.find('does not exist.\\n') > -1:\n",
"LOG.debug(_('Volume %s does not exist, it may have already been deleted'),\n volume['name... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"return \"\"\"Task: %s (ID %d)\nSubmission: %s\n\"\"\" % (self.task[1], self.task[0],\n self.submission_num) + GenericRequest.specific_info(self)\n"
] | [
"def specific_info(self):...\n",
"return \"\"\"Task: %s (ID %d)\nSubmission: %s\n\"\"\" % (self.task[1], self.task[0],\n self.submission_num) + GenericRequest.specific_info(self)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"return FUNC_0(self.file).st_mtime\n"
] | [
"@property...\n",
"return lstat(self.file).st_mtime\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_4(self, VAR_0):...\n",
"for idx in range(len(self.nodes)):\n",
"if VAR_0 == self.nodes[idx]['node_object']:\n",
"return None\n",
"return idx\n"
] | [
"def find_ord(self, obj):...\n",
"for idx in range(len(self.nodes)):\n",
"if obj == self.nodes[idx]['node_object']:\n",
"return None\n",
"return idx\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_25(VAR_20):...\n",
"def FUNC_26(VAR_30, *VAR_12, **VAR_17):...\n",
"if not GLSetting.memory_copy.anomaly_checks:\n",
"return VAR_20(VAR_30, *VAR_12, **kw)\n",
"if GLSetting.anomalies_counter[VAR_1] > alarm_level[VAR_1]:\n",
"if VAR_1 == 'new_submission':\n",
"return VAR_20(VAR_30, *VAR_12, **k... | [
"def wrapper(method_handler):...\n",
"def call_handler(cls, *args, **kw):...\n",
"if not GLSetting.memory_copy.anomaly_checks:\n",
"return method_handler(cls, *args, **kw)\n",
"if GLSetting.anomalies_counter[element] > alarm_level[element]:\n",
"if element == 'new_submission':\n",
"return method_handler... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"VAR_20 = []\n",
"for entry in self.entries:\n",
"if entry.tag_name[0] == '_':\n",
"return VAR_20\n",
"VAR_20.append(entry.tag_name)\n"
] | [
"def groups(self):...\n",
"groups_list = []\n",
"for entry in self.entries:\n",
"if entry.tag_name[0] == '_':\n",
"return groups_list\n",
"groups_list.append(entry.tag_name)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"from flask import Flask, render_template, jsonify, request, make_response, session, abort\n",
"from flask.ext.sqlalchemy import SQLAlchemy\n",
"from flask_mail import Message, Mail\n",
"from flask_login import LoginManager\n",
"from re import compile\n",
"import random, string\n",
"from base64 import *... | [
"from flask import Flask, render_template, jsonify, request, make_response, session, abort\n",
"from flask.ext.sqlalchemy import SQLAlchemy\n",
"from flask_mail import Message, Mail\n",
"from flask_login import LoginManager\n",
"from re import compile\n",
"import random, string\n",
"from base64 import *... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"VAR_3, VAR_6 = self.connectionAndCursor()\n",
"SQLObjectStore.saveChanges(self)\n",
"VAR_3.rollback()\n",
"VAR_3.commit()\n",
"if not self.setting('IgnoreSQLWarnings', False):\n",
"VAR_3.rollback()\n"
] | [
"def saveChanges(self):...\n",
"conn, cur = self.connectionAndCursor()\n",
"SQLObjectStore.saveChanges(self)\n",
"conn.rollback()\n",
"conn.commit()\n",
"if not self.setting('IgnoreSQLWarnings', False):\n",
"conn.rollback()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"VAR_14 = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n",
"VAR_14.get('unique-id')\n",
"FUNC_1('get', VAR_14, 'https://1.2.3.4/api/v1/ports/unique-id')\n"
] | [
"def test_client_get(self):...\n",
"api = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n",
"api.get('unique-id')\n",
"assert_call('get', api, 'https://1.2.3.4/api/v1/ports/unique-id')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_18):...\n",
"VAR_36, VAR_37 = os.pipe()\n",
"VAR_38 = CLASS_10(0, VAR_36)\n",
"VAR_39 = CLASS_10(1, VAR_37)\n",
"self.first.execute(VAR_18)\n",
"VAR_39.close()\n",
"self.second.execute(VAR_18)\n"
] | [
"def execute(self, builtins):...\n",
"read, write = os.pipe()\n",
"inp = RedirectionHelper(0, read)\n",
"outp = RedirectionHelper(1, write)\n",
"self.first.execute(builtins)\n",
"outp.close()\n",
"self.second.execute(builtins)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_2, VAR_1):...\n",
"VAR_5 = dict()\n",
"VAR_10, VAR_11 = self.get_epoch_day(VAR_1)\n",
"VAR_5['interval'] = {'from': self.convert_local_ts_to_utc(VAR_10, self.\n local_timezone), 'to': self.convert_local_ts_to_utc(VAR_11, self.\n local_timezone)}\n",
"VAR_12 = 'string'\n",
"VAR_... | [
"def get_requested_day_for_inverter(self, inverter_serial, date):...\n",
"data = dict()\n",
"day_start, day_end = self.get_epoch_day(date)\n",
"data['interval'] = {'from': self.convert_local_ts_to_utc(day_start, self.\n local_timezone), 'to': self.convert_local_ts_to_utc(day_end, self.\n local_timezone)... | [
0,
0,
0,
0,
4,
0,
4,
0,
0,
4,
4,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"... |
[
"def FUNC_10(VAR_0, VAR_5, VAR_8, VAR_9, VAR_10=False):...\n",
""
] | [
"def substring_find_replace(table_name, attr, find, replace, full=False):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(VAR_0, VAR_1):...\n",
"VAR_1.execute('DELETE FROM video where playlist_id={playlist_id};'.format(\n VAR_0=playlist_id))\n"
] | [
"def delete_playlists_videos(playlist_id, db):...\n",
"db.execute('DELETE FROM video where playlist_id={playlist_id};'.format(\n playlist_id=playlist_id))\n"
] | [
0,
4
] | [
"FunctionDef'",
"Expr'"
] |
[
"@staticmethod...\n",
"return CLASS_0._TalkToHandlerAsync(VAR_9, VAR_7, 'POST', VAR_10)\n"
] | [
"@staticmethod...\n",
"return BaseRequest._TalkToHandlerAsync(data, handler, 'POST', timeout)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_5(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = VAR_3.type\n",
"return VAR_3\n"
] | [
"def t_LPAR(self, tok):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = tok.type\n",
"return tok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_10 in self.log_files:\n",
"if VAR_10 in self.log_file_handles:\n",
"VAR_11 = []\n",
"if VAR_10 in self.files_to_ignore:\n",
"while True:\n",
"self.log_file_handles[VAR_10] = open(VAR_10, 'r')\n",
"if e.errno == os.errno.EMFILE:\n",
"VAR... | [
"def check_log_files_and_push_updates(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for log_filename in self.log_files:\n",
"if log_filename in self.log_file_handles:\n",
"new_lines = []\n",
"if log_filename in self.files_to_ignore:\n",
"while True:\n",
"self.log_file_handles[log_filename] = open(log_file... | [
0,
0,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"AugAssign'",
"Assign'",
"Expr'"
] |
[
"@atomic...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = self.get_refpath_hash(VAR_10)\n",
"if VAR_11:\n",
"VAR_38 = f'http://localhost:8080/ipfs/{VAR_21}'\n",
"VAR_39 = self.ipfs.ls(f'/ipfs/{VAR_21}')\n",
"if not self.quiet:\n",
"VAR_40 = VAR_39['Objects'][0]\n",
"print(f'Opening {VAR_38}')\n",
"webb... | [
"@atomic...\n",
"\"\"\"docstring\"\"\"\n",
"mfs_commit_hash = self.get_refpath_hash(refpath)\n",
"if browser:\n",
"url = f'http://localhost:8080/ipfs/{mfs_commit_hash}'\n",
"ret = self.ipfs.ls(f'/ipfs/{mfs_commit_hash}')\n",
"if not self.quiet:\n",
"obj = ret['Objects'][0]\n",
"print(f'Opening {url}... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self, VAR_20):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_21, directories, filenames in os.walk(VAR_20):\n",
"for VAR_32 in filenames:\n",
"VAR_72 = os.path.join(VAR_21, VAR_32)\n",
"VAR_73 = '/' + os.path.relpath(VAR_72, VAR_20)\n",
"VAR_24 = self.getfile(VAR_73, VAR_23=False)\n",
"if VAR... | [
"def init_honeyfs(self, honeyfs_path):...\n",
"\"\"\"docstring\"\"\"\n",
"for path, directories, filenames in os.walk(honeyfs_path):\n",
"for filename in filenames:\n",
"realfile_path = os.path.join(path, filename)\n",
"virtual_path = '/' + os.path.relpath(realfile_path, honeyfs_path)\n",
"f = self.getf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"For",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"@data((' ', ''), ('Frecon', 'frecon'), ('Frecon', 'frecon'), (...\n",
"VAR_12 = clean_company_name(VAR_1)\n",
"self.assertEqual(VAR_2, VAR_12)\n"
] | [
"@data((' ', ''), ('Frecon', 'frecon'), ('Frecon', 'frecon'), (...\n",
"output_string = clean_company_name(input_string)\n",
"self.assertEqual(desired_string, output_string)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_7, VAR_8=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = self._query_arg('fields', FUNC_13)\n",
"if VAR_17 is None:\n",
"return VAR_7\n",
"if VAR_8:\n",
"VAR_35 = VAR_7\n",
"VAR_18 = VAR_7\n",
"return get_fields_subset(VAR_35, VAR_17)\n",
"return [get_fields_subset(VAR_19... | [
"def _specific_fields(self, model_or_models, is_detail=True):...\n",
"\"\"\"docstring\"\"\"\n",
"fields = self._query_arg('fields', list)\n",
"if fields is None:\n",
"return model_or_models\n",
"if is_detail:\n",
"the_model = model_or_models\n",
"models = model_or_models\n",
"return get_fields_subse... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_16(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = VAR_19(VAR_16, 'dynamic')\n",
"VAR_31 = [VAR_30] if FUNC_10(VAR_30) else VAR_30\n",
"for VAR_3 in VAR_31:\n",
"VAR_52 = list(VAR_5.finditer(VAR_3))\n",
"return VAR_30\n",
"for VAR_29 in VAR_52:\n",
"if VAR_29.group('constraint'):\n"
] | [
"def dynamic(value):...\n",
"\"\"\"docstring\"\"\"\n",
"annotated = flag(value, 'dynamic')\n",
"tocheck = [annotated] if not_iterable(annotated) else annotated\n",
"for file in tocheck:\n",
"matches = list(_wildcard_regex.finditer(file))\n",
"return annotated\n",
"for match in matches:\n",
"if match... | [
0,
0,
7,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"For",
"Condition"
] |
[
"def FUNC_6(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = self.bindings['TEST_APP_COMPONENT_NAME']\n",
"if not VAR_5:\n",
"VAR_7 += '-pub'\n",
"VAR_12 = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider': 'aws', 'credentials': self.\n bindings['... | [
"def delete_load_balancer(self, use_vpc):...\n",
"\"\"\"docstring\"\"\"\n",
"load_balancer_name = self.bindings['TEST_APP_COMPONENT_NAME']\n",
"if not use_vpc:\n",
"load_balancer_name += '-pub'\n",
"payload = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"import re\n",
"from django.utils.translation import ugettext_lazy as _\n",
"from horizon import exceptions\n",
"from horizon import forms\n",
"from horizon import messages\n",
"from openstack_dashboard import api\n",
"VAR_0 = re.compile('\\\\r|\\\\n')\n",
"VAR_1 = re.compile('^\\\\w+(?:[- ]\\\\w+)*$'... | [
"import re\n",
"from django.utils.translation import ugettext_lazy as _\n",
"from horizon import exceptions\n",
"from horizon import forms\n",
"from horizon import messages\n",
"from openstack_dashboard import api\n",
"NEW_LINES = re.compile('\\\\r|\\\\n')\n",
"KEYPAIR_NAME_REGEX = re.compile('^\\\\w+... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
5
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(VAR_9, VAR_7, VAR_11, VAR_10):...\n",
"if VAR_11 == 'POST':\n",
"return CLASS_0.session.post(FUNC_2(VAR_7), VAR_9=ToUtf8Json(data), headers=\n _HEADERS, VAR_10=timeout)\n",
"if VAR_11 == 'GET':\n",
"return CLASS_0.session.get(FUNC_2(VAR_7), headers=_HEADERS, VAR_10=timeout)\n"
] | [
"def SendRequest(data, handler, method, timeout):...\n",
"if method == 'POST':\n",
"return BaseRequest.session.post(_BuildUri(handler), data=ToUtf8Json(data),\n headers=_HEADERS, timeout=timeout)\n",
"if method == 'GET':\n",
"return BaseRequest.session.get(_BuildUri(handler), headers=_HEADERS,\n timeo... | [
0,
0,
7,
0,
7
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"def FUNC_34(self):...\n"
] | [
"def test_bad(self):...\n",
"def get(self):...\n"
] | [
0,
0
] | [
"FunctionDef'",
"FunctionDef'"
] |
[
"def FUNC_3(self):...\n",
"self.expected_requests([(\n 'http://localhost/auth/api/v1/accounts/self/xsrf_token', {'data': {},\n 'headers': {'X-XSRF-Token-Request': '1'}}, {'expiration_sec': 100,\n 'xsrf_token': 'token'}), ('http://localhost/a', {'data': {'foo': 'bar'},\n 'headers': {'X-XSRF-Token': 'to... | [
"def testXsrfRemoteRefresh(self):...\n",
"self.expected_requests([(\n 'http://localhost/auth/api/v1/accounts/self/xsrf_token', {'data': {},\n 'headers': {'X-XSRF-Token-Request': '1'}}, {'expiration_sec': 100,\n 'xsrf_token': 'token'}), ('http://localhost/a', {'data': {'foo': 'bar'},\n 'headers': {'X-X... | [
0,
5,
5,
0,
5,
5,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_40.environ['CUDA_VISIBLE_DEVICES'] = ','.join([str(i) for i in VAR_14])\n"
] | [
"def set_cuda_visible_devices(gpu_ids):...\n",
"\"\"\"docstring\"\"\"\n",
"os.environ['CUDA_VISIBLE_DEVICES'] = ','.join([str(i) for i in gpu_ids])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_0(VAR_1=None, VAR_2=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = os.path.join(os.path.expanduser('~'), 'visbrain_data')\n",
"VAR_2 = '' if not isinstance(VAR_2, str) else VAR_2\n",
"VAR_9 = os.path.join(VAR_9, VAR_2)\n",
"if not os.path.exists(VAR_9):\n",
"os.makedirs(VAR_9)\n",
"VAR_1 ... | [
"def path_to_visbrain_data(file=None, folder=None):...\n",
"\"\"\"docstring\"\"\"\n",
"vb_path = os.path.join(os.path.expanduser('~'), 'visbrain_data')\n",
"folder = '' if not isinstance(folder, str) else folder\n",
"vb_path = os.path.join(vb_path, folder)\n",
"if not os.path.exists(vb_path):\n",
"os.ma... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_2, VAR_3):...\n",
"VAR_5 = ''.join(random.choice(string.ascii_letters + string.digits) for _ in\n range(VAR_0))\n",
"VAR_9 = FUNC_5(VAR_3, VAR_5)\n",
"VAR_10 = sqlite3.connect(VAR_1)\n",
"VAR_11 = VAR_10.cursor()\n",
"VAR_11.execute(\n \"\"\"INSERT INTO UserData(username, password_ha... | [
"def add_user(username, password):...\n",
"salt = ''.join(random.choice(string.ascii_letters + string.digits) for _ in\n range(SALT_LENGTH))\n",
"password_hash = multiple_hash_password(password, salt)\n",
"connection = sqlite3.connect(DATABASE_PATH)\n",
"cursor = connection.cursor()\n",
"cursor.execute... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_1, VAR_2, VAR_3, VAR_4=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15 = ', '.join([('`' + str(c) + '` DOUBLE DEFAULT NULL') for c in VAR_3])\n",
"VAR_16 = (\n f'CREATE TABLE {VAR_2}(`TIMESTAMP` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, {VAR_15});'\n )\n",
"if VAR_4:\n",
"print... | [
"def db_init(conn, table, columns, debug=False):...\n",
"\"\"\"docstring\"\"\"\n",
"column_str = ', '.join([('`' + str(c) + '` DOUBLE DEFAULT NULL') for c in\n columns])\n",
"sql = (\n f'CREATE TABLE {table}(`TIMESTAMP` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, {column_str});'\n )\n",
"if debug... | [
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
""
] | [
"@staticmethod...\n",
""
] | [
4,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_21(VAR_3, VAR_16=128):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_3 is None:\n",
"return ''\n",
"VAR_3 = VAR_3[:VAR_16] + ' ...' if len(VAR_3) > VAR_16 else VAR_3\n",
"return VAR_3\n"
] | [
"def trunc(string, length=128):...\n",
"\"\"\"docstring\"\"\"\n",
"if string is None:\n",
"return ''\n",
"string = string[:length] + ' ...' if len(string) > length else string\n",
"return string\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def __init__(self):...\n",
"self.content = VAR_2\n"
] | [
"def __init__(self):...\n",
"self.content = content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_14(VAR_15, VAR_16, VAR_17, VAR_18, VAR_19, VAR_20):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_20 is not None:\n",
"VAR_41 = VAR_20.copy()\n",
"if VAR_17 is not None:\n",
"if 'CPU' in VAR_41 or 'GPU' in VAR_41:\n",
"VAR_41 = VAR_17.copy()\n",
"VAR_41 = {}\n",
"assert VAR_15 is not None\n",
... | [
"def resources_from_resource_arguments(default_num_cpus, default_num_gpus,...\n",
"\"\"\"docstring\"\"\"\n",
"if runtime_resources is not None:\n",
"resources = runtime_resources.copy()\n",
"if default_resources is not None:\n",
"if 'CPU' in resources or 'GPU' in resources:\n",
"resources = default_reso... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assert'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_68):...\n",
"if not VAR_68:\n",
"return\n",
"if VAR_68.startswith('redirect_'):\n",
"VAR_104 = VAR_68[9:]\n",
"if VAR_68.startswith('vote_'):\n",
"if not VAR_104.startswith(VAR_101.site.path) and not VAR_104.startswith('http:'\n",
"VAR_41 = VAR_68[5:]\n",
"if VAR_68.startswith(... | [
"def run(self, reason):...\n",
"if not reason:\n",
"return\n",
"if reason.startswith('redirect_'):\n",
"dest = reason[9:]\n",
"if reason.startswith('vote_'):\n",
"if not dest.startswith(c.site.path) and not dest.startswith('http:'):\n",
"fullname = reason[5:]\n",
"if reason.startswith('share_'):\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
... |
[
"async def FUNC_4(VAR_8: str) ->tuple:...\n",
"\"\"\"docstring\"\"\"\n",
"await cursor.execute(\n \"SELECT uid, name, password, lv, xp, hp FROM player where name = '%s'\" %\n VAR_8)\n",
"FUNC_10(ex)\n",
"if VAR_18 is None:\n",
"VAR_18 = cursor.fetchone()\n",
"return tuple()\n",
"return tuple()\n... | [
"async def get_player_info(name: str) ->tuple:...\n",
"\"\"\"docstring\"\"\"\n",
"await cursor.execute(\n \"SELECT uid, name, password, lv, xp, hp FROM player where name = '%s'\" %\n name)\n",
"_error_report(ex)\n",
"if data is None:\n",
"data = cursor.fetchone()\n",
"return tuple()\n",
"return ... | [
0,
0,
4,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_5(self, VAR_8):...\n",
"VAR_0.info('Handling weekly repeating event')\n",
"VAR_16 = datetime.strptime(VAR_8.date_end, '%Y-%m-%d %H:%M:00')\n",
"VAR_17 = datetime.now()\n",
"if VAR_17 >= VAR_16:\n",
"VAR_10 = datetime.strptime(VAR_8.date_begin, '%Y-%m-%d %H:%M:00'\n ) + relativedelta(days=+7)\... | [
"def _handle_weekly_event_repetition(self, old_repeating_event):...\n",
"_logger.info('Handling weekly repeating event')\n",
"end_date = datetime.strptime(old_repeating_event.date_end, '%Y-%m-%d %H:%M:00')\n",
"present = datetime.now()\n",
"if present >= end_date:\n",
"new_start_date = datetime.strptime(o... | [
0,
0,
0,
0,
0,
6,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_19(self, VAR_13, VAR_3, VAR_14, VAR_11):...\n",
"VAR_37 = get_current_registry()\n",
"VAR_38 = VAR_37.queryAdapter(VAR_3, IDataTraversalProxyAdapter)\n",
"if not VAR_38 is None:\n",
"VAR_40 = getattr(VAR_38, VAR_13)(*VAR_14, **options)\n",
"if not isinstance(VAR_3, (MutableSequence, MutableSet))... | [
"def __make_proxy(self, method_name, data, args, options):...\n",
"reg = get_current_registry()\n",
"adp = reg.queryAdapter(data, IDataTraversalProxyAdapter)\n",
"if not adp is None:\n",
"prx = getattr(adp, method_name)(*args, **options)\n",
"if not isinstance(data, (MutableSequence, MutableSet)):\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"super().get_resource_objects()\n",
"VAR_2 = self.request.user\n",
"if VAR_2.is_authenticated():\n",
"self.profile = VAR_3 = VAR_2.userprofile\n",
"self.profile = None\n",
"self.is_external_student = VAR_3.is_external\n",
"self.is_external_student = False\n",
"self.note('pr... | [
"def get_resource_objects(self):...\n",
"super().get_resource_objects()\n",
"user = self.request.user\n",
"if user.is_authenticated():\n",
"self.profile = profile = user.userprofile\n",
"self.profile = None\n",
"self.is_external_student = profile.is_external\n",
"self.is_external_student = False\n",
... | [
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_18(self, VAR_19):...\n",
"return VAR_19.endswith('.java') or VAR_19.endswith('.scala')\n"
] | [
"def select_source(self, source_file_path):...\n",
"return source_file_path.endswith('.java') or source_file_path.endswith('.scala'\n )\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"self.object.run()\n",
"return '/threat_hunter'\n"
] | [
"def get_success_url(self):...\n",
"self.object.run()\n",
"return '/threat_hunter'\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@app.route('/api/images/<type>/<image>', methods=['GET'])...\n",
"VAR_34 = VAR_12.convert(request.args)\n",
"return send_from_directory(VAR_34['directory'], VAR_34['filename'],\n mimetype=image_info['content_type'], as_attachment=request.args.get(\n 'download') == 'true', attachment_filename=image_info['... | [
"@app.route('/api/images/<type>/<image>', methods=['GET'])...\n",
"image_info = image.convert(request.args)\n",
"return send_from_directory(image_info['directory'], image_info['filename'],\n mimetype=image_info['content_type'], as_attachment=request.args.get(\n 'download') == 'true', attachment_filename=i... | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"from util import hook, user, database\n",
"import time\n",
"VAR_0 = False\n",
"def FUNC_0(VAR_1):...\n",
"VAR_1.execute('string')\n",
"VAR_1.commit()\n",
"VAR_0 = True\n",
"def FUNC_1(VAR_2, VAR_3, VAR_4, VAR_5, VAR_1, VAR_6, VAR_7):...\n",
"if ' ' in VAR_2:\n",
"VAR_6('Invalid nick')\n",
"VAR_... | [
"from util import hook, user, database\n",
"import time\n",
"db_ready = False\n",
"def db_init(db):...\n",
"db.execute(\n 'CREATE TABLE if not exists votes(chan, action, target, voters, time, primary key(chan, action, target));'\n )\n",
"db.commit()\n",
"db_ready = True\n",
"def process_vote(tar... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Ex... |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"VAR_24 = self.common.create_cloned_volume(VAR_7, VAR_8)\n",
"self.common.client_logout()\n",
"return {'metadata': VAR_24}\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"new_vol = self.common.create_cloned_volume(volume, src_vref)\n",
"self.common.client_logout()\n",
"return {'metadata': new_vol}\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(VAR_4, VAR_5, VAR_6, VAR_7=nsxlib_testcase.NSX_CERT, VAR_8=None,...\n",
"VAR_12 = VAR_5\n",
"if getattr(VAR_12, 'client', None) is not None:\n",
"VAR_12 = VAR_12.client\n",
"VAR_13 = VAR_12._conn\n",
"if VAR_11:\n",
"VAR_13.assert_called_once(VAR_4, **{'url': url, 'verify': verify, 'body':\n... | [
"def assert_call(verb, client_or_resource, url, verify=nsxlib_testcase....\n",
"nsx_client = client_or_resource\n",
"if getattr(nsx_client, 'client', None) is not None:\n",
"nsx_client = nsx_client.client\n",
"cluster = nsx_client._conn\n",
"if single_call:\n",
"cluster.assert_called_once(verb, **{'url'... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_0.info('Shutting down LSP manager...')\n",
"for VAR_6 in self.clients:\n",
"self.close_client(VAR_6)\n"
] | [
"def shutdown(self):...\n",
"logger.info('Shutting down LSP manager...')\n",
"for language in self.clients:\n",
"self.close_client(language)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
""
] | [
"def generate_userdb_desc(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_26(self):...\n",
"if self._IsServerAlive():\n",
"VAR_23 = BaseRequest.PostDataToHandler(BuildRequestData(), 'debug_info')\n",
"VAR_23 = 'Server crashed, no debug info from server'\n",
"VAR_23 += \"\"\"\nServer running at: {0}\"\"\".format(BaseRequest.server_location)\n",
"VAR_23 += \"\"\"\nServe... | [
"def DebugInfo(self):...\n",
"if self._IsServerAlive():\n",
"debug_info = BaseRequest.PostDataToHandler(BuildRequestData(), 'debug_info')\n",
"debug_info = 'Server crashed, no debug info from server'\n",
"debug_info += \"\"\"\nServer running at: {0}\"\"\".format(BaseRequest.server_location)\n",
"debug_inf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"AugAssign'",
"Condition",
"AugAssign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
""
] | [
"def test_run_interactive_shell_command_kwargs_delegation(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@memoized_property...\n",
"return Zinc.Factory.global_instance().create(self.context.products)\n"
] | [
"@memoized_property...\n",
"return Zinc.Factory.global_instance().create(self.context.products)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_8(VAR_15):...\n",
"VAR_32 = VAR_15.to_dict()\n",
"VAR_32['tags'] = AnnTag.get_ann_tags(VAR_15.id, self.sql_session)\n",
"return VAR_32\n"
] | [
"def _make_ann(ann):...\n",
"_d = ann.to_dict()\n",
"_d['tags'] = AnnTag.get_ann_tags(ann.id, self.sql_session)\n",
"return _d\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __del__(self):...\n",
"self.cursor.close()\n",
"self.db_conn.close()\n"
] | [
"def __del__(self):...\n",
"self.cursor.close()\n",
"self.db_conn.close()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@login_required()...\n",
"VAR_10 = get_object_or_404(DataSource, VAR_2=pk)\n",
"VAR_12 = DataSourceForm(VAR_0.POST or None, instance=datasource)\n",
"if VAR_12.is_valid():\n",
"if VAR_12.has_changed():\n",
"VAR_12.referer = VAR_0.META.get('HTTP_REFERER', None)\n",
"VAR_12.save()\n",
"return redirect(... | [
"@login_required()...\n",
"datasource = get_object_or_404(DataSource, pk=pk)\n",
"form = DataSourceForm(request.POST or None, instance=datasource)\n",
"if form.is_valid():\n",
"if form.has_changed():\n",
"form.referer = request.META.get('HTTP_REFERER', None)\n",
"form.save()\n",
"return redirect('data... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Return'"
] |
[
"@login_required...\n",
"\"\"\"docstring\"\"\"\n",
"return render_to_response('student_account/finish_auth.html', {\n 'disable_courseware_js': True, 'disable_footer': True})\n"
] | [
"@login_required...\n",
"\"\"\"docstring\"\"\"\n",
"return render_to_response('student_account/finish_auth.html', {\n 'disable_courseware_js': True, 'disable_footer': True})\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_3(VAR_2):...\n",
"return FUNC_2([d['serial'] for d in VAR_2])\n"
] | [
"def get_instances_with_configs(dicts):...\n",
"return get_instances([d['serial'] for d in dicts])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_1=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if __grains__['kernel'] == 'Linux':\n",
"VAR_4 = 'df -P'\n",
"if __grains__['kernel'] == 'OpenBSD':\n",
"if VAR_1:\n",
"VAR_4 = 'df -kP'\n",
"VAR_4 = 'df'\n",
"VAR_4 = VAR_4 + ' -' + VAR_1\n",
"VAR_2 = {}\n",
"VAR_3 = __salt__['cmd.run'... | [
"def usage(args=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if __grains__['kernel'] == 'Linux':\n",
"cmd = 'df -P'\n",
"if __grains__['kernel'] == 'OpenBSD':\n",
"if args:\n",
"cmd = 'df -kP'\n",
"cmd = 'df'\n",
"cmd = cmd + ' -' + args\n",
"ret = {}\n",
"out = __salt__['cmd.run'](cmd).splitlines(... | [
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Ass... |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.format_wildcards(self.rule.message) if self.rule.message else None\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.format_wildcards(self.rule.message) if self.rule.message else None\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def __init__(VAR_39, VAR_40, VAR_41, VAR_42, VAR_48, VAR_43, VAR_44, VAR_45,...\n",
"VAR_39.returncode = None\n",
"VAR_39._out_file = VAR_7.path.join(self.root_dir, 'work',\n 'task_runner_out.json')\n",
"VAR_6 = [sys.executable, bot_main.THIS_FILE, 'task_runner',\n '--swarming-server', VAR_3, '--in-fil... | [
"def __init__(self2, cmd, detached, cwd, env, stdout, stderr, stdin, close_fds):...\n",
"self2.returncode = None\n",
"self2._out_file = os.path.join(self.root_dir, 'work', 'task_runner_out.json')\n",
"expected = [sys.executable, bot_main.THIS_FILE, 'task_runner',\n '--swarming-server', url, '--in-file', os... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@login_required()...\n",
"VAR_10 = get_object_or_404(DataSource, VAR_2=pk)\n",
"if VAR_0.method == 'POST':\n",
"VAR_10.delete()\n",
"return render(VAR_0, VAR_1, {'object': VAR_10})\n",
"return redirect('data_source_list')\n"
] | [
"@login_required()...\n",
"datasource = get_object_or_404(DataSource, pk=pk)\n",
"if request.method == 'POST':\n",
"datasource.delete()\n",
"return render(request, template_name, {'object': datasource})\n",
"return redirect('data_source_list')\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_15(self, VAR_14=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if hasattr(self, 'globaleaks_io_debug'):\n",
"RequestHandler.flush(self, VAR_14)\n",
"VAR_15 = '<' * 15\n",
"log.err('JSON logging fail (flush): %s' % excep.message)\n",
"VAR_15 += ' Response %d ' % self.globaleaks_io_debug\n",
"retu... | [
"def flush(self, include_footers=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if hasattr(self, 'globaleaks_io_debug'):\n",
"RequestHandler.flush(self, include_footers)\n",
"content = '<' * 15\n",
"log.err('JSON logging fail (flush): %s' % excep.message)\n",
"content += ' Response %d ' % self.globaleaks_io... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"AugAssign'",
"Return'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"For",
"AugAssign'",
"Condition",
"AugAssign'",
"Expr'"
] |
[
"def FUNC_4():...\n",
"VAR_22 = self.request.body\n",
"VAR_23 = json.loads(VAR_22.decode('utf-8', 'ignore'))\n",
"VAR_24 = VAR_23['action']\n",
"VAR_25 = VAR_23['source']\n",
"if type(VAR_25) == list:\n",
"for VAR_33 in range(0, len(VAR_25)):\n",
"VAR_25 = FUNC_1(VAR_25)\n",
"VAR_25[VAR_33] = FUNC_1... | [
"def get_final_html_async():...\n",
"operation_content_raw = self.request.body\n",
"operation_content = json.loads(operation_content_raw.decode('utf-8', 'ignore'))\n",
"action = operation_content['action']\n",
"sources = operation_content['source']\n",
"if type(sources) == list:\n",
"for i in range(0, l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
4,
4,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"For",
"Condition",
"Expr'",
"For",
"Conditio... |
[
"def FUNC_4(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_open(%s, %s)', VAR_3[:500], str(VAR_6)[:500])\n",
"if not self._requests:\n",
"return None\n",
"VAR_6.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == VAR_3:\n",
"self.fail('Unknown request %s' % VAR_3)\n",
"... | [
"def _url_open(self, url, **kwargs):...\n",
"logging.warn('url_open(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)\n",
"da... | [
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_12(self, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = VAR_12.name.split('->')[1].strip()\n",
"VAR_31 = self.get_file_links_in_file(VAR_27)\n",
"self.visited_files = []\n",
"for VAR_39 in VAR_31:\n",
"if VAR_39 in self.visited_files:\n",
"VAR_40 = CLASS_1(os.path.join(self.path, VAR_3... | [
"def add_children(self, parent):...\n",
"\"\"\"docstring\"\"\"\n",
"parent_filename = parent.name.split('->')[1].strip()\n",
"links = self.get_file_links_in_file(parent_filename)\n",
"self.visited_files = []\n",
"for link in links:\n",
"if link in self.visited_files:\n",
"child_metadata = NodeMetadata... | [
0,
0,
0,
0,
0,
1,
0,
1,
0,
0,
0,
1,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import json\n",
"import mock\n",
"import requests\n",
"from django.test import TransactionTestCase\n",
"from django.conf import settings\n",
"def FUNC_0(... | [
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import json\n",
"import mock\n",
"import requests\n",
"from django.test import TransactionTestCase\n",
"from django.conf import settings\n",
"def mock_im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"self._attributes['dimensions'] = VAR_11\n"
] | [
"def update_dimensions(self, new_dimensions):...\n",
"\"\"\"docstring\"\"\"\n",
"self._attributes['dimensions'] = new_dimensions\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_8(self):...\n",
"return self.column_id in self.current_columns\n"
] | [
"def is_ordered(self):...\n",
"return self.column_id in self.current_columns\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_29(self, VAR_2, VAR_3, VAR_33):...\n",
"if 'active_id' in VAR_33:\n",
"return self.pool.get('project.task').browse(VAR_2, VAR_3, VAR_33['active_id']\n ).remaining_hours\n",
"return False\n"
] | [
"def _get_remaining(self, cr, uid, ctx):...\n",
"if 'active_id' in ctx:\n",
"return self.pool.get('project.task').browse(cr, uid, ctx['active_id']\n ).remaining_hours\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"@VAR_1.route('/')...\n",
"return render_template('home.html')\n"
] | [
"@app.route('/')...\n",
"return render_template('home.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_16(self, VAR_14=None):...\n",
""
] | [
"def poll(self, timeout=None):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_17(self, VAR_27):...\n",
"return self._engine.dialect.identifier_preparer.quote(VAR_27)\n"
] | [
"def quote_identifier(self, identifier):...\n",
"return self._engine.dialect.identifier_preparer.quote(identifier)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
""
] | [
"def update(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@data((' ', []), ('Ron Eastern Construction Ltd. (RECL)', ['RECL']), (...\n",
"VAR_12 = get_acronyms(VAR_1)\n",
"self.assertEqual(VAR_2, VAR_12)\n"
] | [
"@data((' ', []), ('Ron Eastern Construction Ltd. (RECL)', ['RECL']), (...\n",
"output_string = get_acronyms(input_string)\n",
"self.assertEqual(desired_string, output_string)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_5='test', VAR_6=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from invenio.modules.oauthclient.client import oauth\n",
"oauth.remote_apps[VAR_5].handle_oauth2_response = MagicMock(return_value=\n data or {'access_token': 'test_access_token', 'scope': '', 'token_type':\n 'bearer'})\n"
] | [
"def mock_response(self, app='test', data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from invenio.modules.oauthclient.client import oauth\n",
"oauth.remote_apps[app].handle_oauth2_response = MagicMock(return_value=data or\n {'access_token': 'test_access_token', 'scope': '', 'token_type': 'bearer'})\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Assign'"
] |
[
"def FUNC_0(self):...\n",
"VAR_8 = lambda x: dict(request_token_params={'scope': ''}, base_url=\n 'https://foo.bar/', request_token_url=None, access_token_url=\n 'https://foo.bar/oauth/access_token', authorize_url=\n 'https://foo.bar/oauth/authorize', consumer_key=x, consumer_secret=\n 'testsecret')\n... | [
"def setUp(self):...\n",
"params = lambda x: dict(request_token_params={'scope': ''}, base_url=\n 'https://foo.bar/', request_token_url=None, access_token_url=\n 'https://foo.bar/oauth/access_token', authorize_url=\n 'https://foo.bar/oauth/authorize', consumer_key=x, consumer_secret=\n 'testsecret')\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.