lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_22(VAR_10, VAR_11, VAR_12):...\n",
"self.log.info('Resume signal %s recieved', repr((VAR_10, VAR_11, VAR_12)))\n"
] | [
"def resumehandler(interface, method, data):...\n",
"self.log.info('Resume signal %s recieved', repr((interface, method, data)))\n"
] | [
0,
7
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"Navigation._ekfCallback(self, VAR_8)\n",
"self.map_pos = self.transformPoint(self.p, 'odom', 'map')\n",
"self.map_angle = self.transformAngle(self.angle, 'odom', 'map')\n"
] | [
"def _ekfCallback(self, data):...\n",
"\"\"\"docstring\"\"\"\n",
"Navigation._ekfCallback(self, data)\n",
"self.map_pos = self.transformPoint(self.p, 'odom', 'map')\n",
"self.map_angle = self.transformAngle(self.angle, 'odom', 'map')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.norun = True\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.norun = True\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = 2\n",
"VAR_10 = 'string'.format(repo_dir=REPO_DIR, shard_str='/shard_' + self.\n shard if self.shard else '', procs=process_count)\n",
"VAR_7 = BokChoyTestSuite('', num_processes=process_count)\n",
"self.assertEqual(BokChoyTestSuite.verbos... | [
"def test_verbosity_settings_2_processes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"process_count = 2\n",
"expected_verbosity_string = (\n '--with-xunitmp --xunitmp-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --processes={procs} --no-color --process-timeout=1200'\n .format(repo_dir=REPO_DIR, sh... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_4):...\n",
"super().__init__(VAR_4)\n"
] | [
"def __init__(self, user):...\n",
"super().__init__(user)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_6(VAR_13):...\n",
"return os.path.isfile(VAR_13) and os.access(VAR_13, os.X_OK)\n"
] | [
"def is_executable(path):...\n",
"return os.path.isfile(path) and os.access(path, os.X_OK)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(VAR_0):...\n",
"if VAR_0.method == 'POST':\n",
"if 'myfile' in VAR_0.FILES and VAR_0.FILES['myfile'].name:\n",
"return render(VAR_0, 'exercises/file_exercise.html')\n",
"VAR_8 = 'accepted'\n",
"VAR_8 = 'error'\n",
"return render(VAR_0, 'exercises/file_result.html', {'status': VAR_8})\n"
] | [
"def file(request):...\n",
"if request.method == 'POST':\n",
"if 'myfile' in request.FILES and request.FILES['myfile'].name:\n",
"return render(request, 'exercises/file_exercise.html')\n",
"status = 'accepted'\n",
"status = 'error'\n",
"return render(request, 'exercises/file_result.html', {'status': sta... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"VAR_9 = 'CREATE TABLE IF NOT EXISTS {} ({})'.format(VAR_1, VAR_2)\n",
"self.connection.execute(VAR_9)\n",
"self.connection.commit()\n"
] | [
"def create_table(self):...\n",
"stmt = 'CREATE TABLE IF NOT EXISTS {} ({})'.format(tb_name, mapping)\n",
"self.connection.execute(stmt)\n",
"self.connection.commit()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"return await CLASS_0.sync_filter(VAR_8=self.id, orderings=['-id'])\n"
] | [
"@property...\n",
"return await Comment.sync_filter(post_id=self.id, orderings=['-id'])\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_26(self, VAR_41, VAR_42):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def symlink(self, targetPath, linkPath):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_0(self, VAR_5, VAR_6=None):...\n",
"if VAR_6 is None:\n",
"if VAR_5 == 'campaign':\n",
"if 'timestamp' in VAR_6:\n",
"VAR_6 = self.campaign\n",
"if VAR_5 == 'result':\n",
"VAR_6['timestamp'] = datetime.now()\n",
"if 'id' in VAR_6:\n",
"VAR_6 = self.result\n",
"self.cursor.execute('INSERT... | [
"def insert(self, table, dictionary=None):...\n",
"if dictionary is None:\n",
"if table == 'campaign':\n",
"if 'timestamp' in dictionary:\n",
"dictionary = self.campaign\n",
"if table == 'result':\n",
"dictionary['timestamp'] = datetime.now()\n",
"if 'id' in dictionary:\n",
"dictionary = self.result... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_8(self):...\n",
"VAR_18 = self.fsNode(True, '', 'System', VAR_29=self)\n",
"VAR_18.sub_items = set()\n",
"VAR_18.parent = None\n",
"self.fs_root = VAR_18\n",
"self.fs_uuid_idx[VAR_18.uuid] = VAR_18\n",
"self.fs_db.execute('string' % (VAR_18.uuid, VAR_18.file_name, VAR_18.owner,\n VAR_18.upl... | [
"def make_root(self):...\n",
"item = self.fsNode(True, '', 'System', master=self)\n",
"item.sub_items = set()\n",
"item.parent = None\n",
"self.fs_root = item\n",
"self.fs_uuid_idx[item.uuid] = item\n",
"self.fs_db.execute(\n \"INSERT INTO file_system (uuid, file_name, owner, upload_time, sub_folders... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@VAR_13.whitelist()...\n",
"FUNC_2(VAR_1, VAR_2, VAR_3, VAR_0=searchfield, VAR_5=page_length, VAR_4=filters\n )\n",
"VAR_13.response['results'] = FUNC_4(VAR_13.response['values'])\n"
] | [
"@frappe.whitelist()...\n",
"search_widget(doctype, txt, query, searchfield=searchfield, page_length=\n page_length, filters=filters)\n",
"frappe.response['results'] = build_for_autosuggest(frappe.response['values'])\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'"
] |
[
"import vim\n",
"import requests\n",
"import urlparse\n",
"from retries import retries\n",
"from requests_futures.sessions import FuturesSession\n",
"from ycm.unsafe_thread_pool_executor import UnsafeThreadPoolExecutor\n",
"from ycm import vimsupport\n",
"from ycm.utils import ToUtf8Json\n",
"from y... | [
"import vim\n",
"import requests\n",
"import urlparse\n",
"from retries import retries\n",
"from requests_futures.sessions import FuturesSession\n",
"from ycm.unsafe_thread_pool_executor import UnsafeThreadPoolExecutor\n",
"from ycm import vimsupport\n",
"from ycm.utils import ToUtf8Json\n",
"from y... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"FunctionDef'",
"FunctionDef'",
"Return'"
] |
[
"@VAR_3.message_handler(content_types=['document', 'audio', 'document',...\n",
"VAR_10 = VAR_6.from_user.id\n",
"if VAR_6.document != None:\n",
"if VAR_6.document.mime_type in VAR_4:\n",
"if VAR_6.audio != None:\n",
"VAR_20 = VAR_4[VAR_6.document.mime_type]\n",
"VAR_20 = 'U'\n",
"VAR_1[VAR_10].new_fil... | [
"@bot.message_handler(content_types=['document', 'audio', 'document',...\n",
"telegram_id = message.from_user.id\n",
"if message.document != None:\n",
"if message.document.mime_type in mime_conv:\n",
"if message.audio != None:\n",
"mime = mime_conv[message.document.mime_type]\n",
"mime = 'U'\n",
"expl... | [
0,
0,
0,
0,
0,
0,
0,
4,
0,
4,
4,
4,
0,
0,
4,
0,
4,
0,
4,
0,
4,
0,
4
] | [
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def __init__(self, VAR_10):...\n",
"VAR_10 = VAR_10.strip()[:-1]\n",
"VAR_30 = VAR_10.find('\\n')\n",
"VAR_36 = VAR_10[:VAR_30].strip()\n",
"VAR_10 = VAR_10[VAR_30 + 1:]\n",
"VAR_41 = ''\n",
"if VAR_36[1] == '!':\n",
"VAR_41 = 'alert'\n",
"VAR_36 = VAR_36[2:]\n",
"def FUNC_2():...\n",
"super(CL... | [
"def __init__(self, txt):...\n",
"txt = txt.strip()[:-1]\n",
"i = txt.find('\\n')\n",
"head = txt[:i].strip()\n",
"txt = txt[i + 1:]\n",
"kind = ''\n",
"if head[1] == '!':\n",
"kind = 'alert'\n",
"head = head[2:]\n",
"def innerFunc():...\n",
"super(Box, self).__init__(slideParser.parse(txt, slid... | [
0,
2,
2,
2,
0,
2,
2,
2,
2,
0,
2,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_2):...\n",
"VAR_12 = VAR_2 + '/solr/possible.conflicts/update?commit=true'\n",
"VAR_14 = {'content-type': 'text/xml'}\n",
"VAR_9 = '<delete><query>id:*</query></delete>'\n",
"VAR_13 = requests.post(VAR_12, VAR_14=headers, VAR_9=data)\n",
"assert VAR_13.status_code == 200\n"
] | [
"def clean_database(solr):...\n",
"url = solr + '/solr/possible.conflicts/update?commit=true'\n",
"headers = {'content-type': 'text/xml'}\n",
"data = '<delete><query>id:*</query></delete>'\n",
"r = requests.post(url, headers=headers, data=data)\n",
"assert r.status_code == 200\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assert'"
] |
[
"def FUNC_10(self):...\n",
"if self._IsServerAlive():\n",
"return BaseRequest.PostDataToHandler(BuildRequestData(), 'defined_subcommands')\n",
"return []\n"
] | [
"def GetDefinedSubcommands(self):...\n",
"if self._IsServerAlive():\n",
"return BaseRequest.PostDataToHandler(BuildRequestData(), 'defined_subcommands')\n",
"return []\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"vimsupport.PostVimMessage('Restarting ycmd server...')\n",
"self._user_notified_about_crash = False\n",
"self._ServerCleanup()\n",
"self._SetupServer()\n"
] | [
"def RestartServer(self):...\n",
"vimsupport.PostVimMessage('Restarting ycmd server...')\n",
"self._user_notified_about_crash = False\n",
"self._ServerCleanup()\n",
"self._SetupServer()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_4, VAR_3):...\n",
"VAR_17 = argparse.ArgumentParser(VAR_4=prog, usage=USAGE.format(prog))\n",
"VAR_17.add_argument('--nodebug', action='store_true')\n",
"VAR_18 = VAR_17.add_mutually_exclusive_group()\n",
"VAR_18.add_argument('--host')\n",
"VAR_18.add_argument('--server-host')\n",
"VAR_1... | [
"def _parse_args(prog, argv):...\n",
"parser = argparse.ArgumentParser(prog=prog, usage=USAGE.format(prog))\n",
"parser.add_argument('--nodebug', action='store_true')\n",
"host = parser.add_mutually_exclusive_group()\n",
"host.add_argument('--host')\n",
"host.add_argument('--server-host')\n",
"parser.ad... | [
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'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"... |
[
"def FUNC_4(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = FUNC_0(VAR_2)\n",
"VAR_7 = FUNC_1(VAR_2)\n",
"VAR_8 = FUNC_3(VAR_2)['id']\n",
"VAR_9 = [VAR_6, VAR_7, VAR_8]\n",
"VAR_1.execute('UPDATE files SET size=%s, age=%s, passes=0 WHERE id=%s;', VAR_9)\n",
"VAR_0.commit()\n",
"return\n"
] | [
"def db_update_file_details(path):...\n",
"\"\"\"docstring\"\"\"\n",
"file_size = get_file_size(path)\n",
"file_age = get_file_age(path)\n",
"file_id = db_get_file_details(path)['id']\n",
"params = [file_size, file_age, file_id]\n",
"cur.execute('UPDATE files SET size=%s, age=%s, passes=0 WHERE id=%s;',... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_24(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_57 = self.getfile(VAR_21, VAR_23=False)\n",
"if VAR_57 == False:\n",
"self.get_path(os.path.dirname(VAR_21)).remove(VAR_57)\n",
"return\n"
] | [
"def remove(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"p = self.getfile(path, follow_symlinks=False)\n",
"if p == False:\n",
"self.get_path(os.path.dirname(path)).remove(p)\n",
"return\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = []\n",
"for i in range(10):\n",
"VAR_6 = DevInfo()\n",
"client.devices.insert(VAR_3)\n",
"VAR_6.family = PHO_DEV_DIR\n",
"for VAR_6 in VAR_3:\n",
"VAR_6.model = ''\n",
"VAR_7 = client.devices.get(serial=dev.serial)\n",
"client.devices... | [
"def test_getset(self):...\n",
"\"\"\"docstring\"\"\"\n",
"insert_list = []\n",
"for i in range(10):\n",
"dev = DevInfo()\n",
"client.devices.insert(insert_list)\n",
"dev.family = PHO_DEV_DIR\n",
"for dev in insert_list:\n",
"dev.model = ''\n",
"res = client.devices.get(serial=dev.serial)\n",
"c... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"VAR_5 = None\n",
"VAR_5 = tempfile.NamedTemporaryFile(delete=False)\n",
"if VAR_5:\n",
"VAR_5.close()\n",
"os.remove(VAR_5.name)\n",
"self._mox.StubOutWithMock(url_helper, 'UrlOpen')\n",
"VAR_12 = 'data'\n",
"url_helper.UrlOpen(mox.IgnoreArg(), method='GET').AndReturn(VAR... | [
"def testDownloadFile(self):...\n",
"local_file = None\n",
"local_file = tempfile.NamedTemporaryFile(delete=False)\n",
"if local_file:\n",
"local_file.close()\n",
"os.remove(local_file.name)\n",
"self._mox.StubOutWithMock(url_helper, 'UrlOpen')\n",
"file_data = 'data'\n",
"url_helper.UrlOpen(mox.Ign... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_21(self, VAR_68):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.docstring = VAR_68\n",
"return VAR_101\n"
] | [
"def docstring(self, string):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.docstring = string\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_18(VAR_37):...\n",
"VAR_37 = VAR_37.replace('[', '')\n",
"VAR_37 = VAR_37.replace(']', '')\n",
"VAR_45, VAR_46 = VAR_37.split(',')\n",
"VAR_37 = '{} - {}'.format(VAR_45, VAR_46)\n",
"return VAR_37\n"
] | [
"def reformat(score):...\n",
"score = score.replace('[', '')\n",
"score = score.replace(']', '')\n",
"win, loss = score.split(',')\n",
"score = '{} - {}'.format(win, loss)\n",
"return score\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
"def test_a_create_app(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_1, VAR_5, VAR_6, VAR_4=None):...\n",
"GenericRequest.__init__(self, VAR_1, VAR_4)\n",
"self.url = '%stasks/%s/statements/%s' % (self.base_url, VAR_5, VAR_6)\n",
"self.task_id = VAR_5\n"
] | [
"def __init__(self, browser, task_id, language_code, base_url=None):...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.url = '%stasks/%s/statements/%s' % (self.base_url, task_id, language_code)\n",
"self.task_id = task_id\n"
] | [
0,
0,
5,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_9(VAR_2):...\n",
"assert VAR_2 == 'hello'\n"
] | [
"def assert_warn(line):...\n",
"assert line == 'hello'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assert'"
] |
[
"def FUNC_7(self):...\n",
"VAR_3 = FUNC_1(self.window)\n",
"VAR_16 = []\n",
"for VAR_6 in VAR_3:\n",
"VAR_20 = []\n",
"self.sorted_menu = sorted(VAR_16, key=lambda item: item[1], reverse=True)\n",
"VAR_23 = CLASS_0(VAR_6)\n",
"self.display_menu = []\n",
"VAR_12 = Urtext.meta.NodeMetadata(os.path.joi... | [
"def run(self):...\n",
"files = get_all_files(self.window)\n",
"menu = []\n",
"for filename in files:\n",
"item = []\n",
"self.sorted_menu = sorted(menu, key=lambda item: item[1], reverse=True)\n",
"file_info = UrtextFile(filename)\n",
"self.display_menu = []\n",
"metadata = Urtext.meta.NodeMetadata... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_3):...\n",
"time.sleep(1)\n",
"webbrowser.open(VAR_3)\n"
] | [
"def _open_url(url):...\n",
"time.sleep(1)\n",
"webbrowser.open(url)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"\"\"\" Client blueprint used to handle OAuth callbacks. \"\"\"\n",
"from __future__ import absolute_import\n",
"from flask import Blueprint, abort, current_app, url_for, request\n",
"from flask.ext.login import user_logged_out\n",
"from invenio.base.globals import cfg\n",
"from invenio.ext.sslify import ... | [
"\"\"\" Client blueprint used to handle OAuth callbacks. \"\"\"\n",
"from __future__ import absolute_import\n",
"from flask import Blueprint, abort, current_app, url_for, request\n",
"from flask.ext.login import user_logged_out\n",
"from invenio.base.globals import cfg\n",
"from invenio.ext.sslify import ... | [
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
5,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"For",
"Docstring",
"Expr'",
"Expr'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Docstring",
"Expr'",
"Condition",
"Expr'",
"Return'",... |
[
"def FUNC_0(self, **VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = ['UPDATE', connection.ops.quote_name(self._meta.db_table), 'SET']\n",
"for field_name in VAR_0:\n",
"setattr(self, field_name, VAR_0[field_name])\n",
"VAR_1.pop(-1)\n",
"VAR_2 = self._meta.get_field(field_name)\n",
"VAR_1.extend(['... | [
"def update_fields(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"sql = ['UPDATE', connection.ops.quote_name(self._meta.db_table), 'SET']\n",
"for field_name in kwargs:\n",
"setattr(self, field_name, kwargs[field_name])\n",
"sql.pop(-1)\n",
"field = self._meta.get_field(field_name)\n",
"sql.exten... | [
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
4,
4,
4,
0,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = (\n '--with-xunit --xunit-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --verbosity=2'\n .format(repo_dir=REPO_DIR, shard_str='/shard_' + self.shard if self.\n shard else ''))\n",
"VAR_7 = BokChoyTestSuite('', num_processes=1)\n"... | [
"def test_verbosity_settings_1_process(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expected_verbosity_string = (\n '--with-xunit --xunit-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --verbosity=2'\n .format(repo_dir=REPO_DIR, shard_str='/shard_' + self.shard if self.\n shard else ''))\n",
"sui... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_16):...\n",
"return self.column_flags[self.columns[VAR_16.column()]]\n"
] | [
"def flags(self, index):...\n",
"return self.column_flags[self.columns[index.column()]]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_30(self, VAR_47):...\n",
"VAR_69, VAR_73 = self.put('/mails', VAR_47)\n",
"return VAR_69, VAR_73\n"
] | [
"def put_mail(self, data):...\n",
"res, req = self.put('/mails', data)\n",
"return res, req\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = VAR_5['cve_list']\n",
"VAR_10 = filter(None, VAR_10)\n",
"VAR_11 = {}\n",
"if not VAR_10:\n",
"return VAR_11\n",
"VAR_2 = ['cve.id', 'redhat_url', 'secondary_url', 'cve.name',\n 'severity.name', 'published_date', 'modified_date',... | [
"def process_list(self, data):...\n",
"\"\"\"docstring\"\"\"\n",
"cves_to_process = data['cve_list']\n",
"cves_to_process = filter(None, cves_to_process)\n",
"answer = {}\n",
"if not cves_to_process:\n",
"return answer\n",
"column_names = ['cve.id', 'redhat_url', 'secondary_url', 'cve.name',\n 'sev... | [
0,
0,
0,
0,
0,
0,
0,
4,
4,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"@classmethod...\n",
""
] | [
"@classmethod...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def __init__(self, **VAR_4):...\n",
"CLASS_1.__init__(self, **kwargs)\n",
"self.type_filter = None\n"
] | [
"def __init__(self, **kwargs):...\n",
"TriblerContentModel.__init__(self, **kwargs)\n",
"self.type_filter = None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_35(VAR_40):...\n",
"VAR_68 = VAR_10[VAR_40]\n",
"for pattern, has_argument in VAR_39.items():\n",
"if pattern.match(VAR_68):\n",
"VAR_8.warn(\n \"Zinc argument '{}' is not supported, and is subject to change/removal!\"\n .format(VAR_68))\n",
"return 2 if has_argument else 1\n",
"return 1... | [
"def validate(idx):...\n",
"arg = args[idx]\n",
"for pattern, has_argument in valid_patterns.items():\n",
"if pattern.match(arg):\n",
"log.warn(\n \"Zinc argument '{}' is not supported, and is subject to change/removal!\"\n .format(arg))\n",
"return 2 if has_argument else 1\n",
"return 1\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_0(*VAR_0, **VAR_1):...\n",
"VAR_2 = requests.Response()\n",
"VAR_2.status_code = 200\n",
"VAR_2._content_consumed = True\n",
"return VAR_2\n"
] | [
"def mock_import_repository_task(*args, **kwargs):...\n",
"resp = requests.Response()\n",
"resp.status_code = 200\n",
"resp._content_consumed = True\n",
"return resp\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_9, VAR_10):...\n",
"VAR_15 = VAR_9.search_fields and VAR_9.search_fields.split(',') or []\n",
"VAR_16 = [VAR_9.title_field\n ] if VAR_9.title_field and VAR_9.title_field not in VAR_15 else []\n",
"VAR_15 = ['name'] + VAR_15 + VAR_16\n",
"if not VAR_10 in VAR_15:\n",
"VAR_15 = VAR_15 + [... | [
"def get_std_fields_list(meta, key):...\n",
"sflist = meta.search_fields and meta.search_fields.split(',') or []\n",
"title_field = [meta.title_field\n ] if meta.title_field and meta.title_field not in sflist else []\n",
"sflist = ['name'] + sflist + title_field\n",
"if not key in sflist:\n",
"sflist =... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_1(VAR_3):...\n",
"return Task('nfs/{}'.format(VAR_0), VAR_1, VAR_2, partial(\n serialize_dashboard_exception, include_http_status=True))(VAR_3)\n"
] | [
"def composed_decorator(func):...\n",
"return Task('nfs/{}'.format(name), metadata, wait_for, partial(\n serialize_dashboard_exception, include_http_status=True))(func)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_10, VAR_11):...\n",
"unittest.TestCase.__init__(self, VAR_10)\n",
"self.connection_string = VAR_11\n"
] | [
"def __init__(self, method_name, connection_string):...\n",
"unittest.TestCase.__init__(self, method_name)\n",
"self.connection_string = connection_string\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_4(VAR_13, VAR_10, VAR_14=0):...\n",
"if VAR_14 == 0:\n",
"VAR_61 = VAR_13[0]\n",
"if len(VAR_13) > 1 and isinstance(VAR_13[1], tuple):\n",
"VAR_13 = VAR_13[1:]\n",
"VAR_61 = VAR_13[0]\n",
"VAR_61 = ''\n",
"VAR_11 = None\n",
"VAR_13 = VAR_13[1:]\n",
"if VAR_61 == 'emptyIfNull' and len(VAR... | [
"def complex_column_expr(expr, body, depth=0):...\n",
"if depth == 0:\n",
"ret = expr[0]\n",
"if len(expr) > 1 and isinstance(expr[1], tuple):\n",
"expr = expr[1:]\n",
"ret = expr[0]\n",
"ret = ''\n",
"alias = None\n",
"expr = expr[1:]\n",
"if ret == 'emptyIfNull' and len(expr) >= 1 and isinstance... | [
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
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Condition",
"AugAssign'",
"Condition",
"Return'",
"Return'",
... |
[
"def FUNC_3(VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = configuration_helpers.get_value(\n 'ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS', settings.\n ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS)\n",
"return [field for field in VAR_6['fields'] if field['name'] not in VAR_20]\n"
] | [
"def enterprise_fields_only(fields):...\n",
"\"\"\"docstring\"\"\"\n",
"enterprise_exclusions = configuration_helpers.get_value(\n 'ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS', settings.\n ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS)\n",
"return [field for field in fields['fields'] if field['name'] not in\n ... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._state\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._state\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@functools.wraps(VAR_3)...\n",
"VAR_23 = VAR_5.pop('timeout', None)\n",
"VAR_24 = eventlet.spawn(VAR_3, self, *VAR_4, **kwargs)\n",
"if VAR_23 is None:\n",
"return VAR_24.wait()\n",
"VAR_36 = eventlet.spawn_after(VAR_23, VAR_24.kill)\n",
"VAR_48 = VAR_24.wait()\n",
"VAR_36.cancel()\n",
"return VAR_... | [
"@functools.wraps(f)...\n",
"timeout = kwargs.pop('timeout', None)\n",
"gt = eventlet.spawn(f, self, *args, **kwargs)\n",
"if timeout is None:\n",
"return gt.wait()\n",
"kill_thread = eventlet.spawn_after(timeout, gt.kill)\n",
"res = gt.wait()\n",
"kill_thread.cancel()\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_9, VAR_10, VAR_6, VAR_14):...\n",
"self.model = VAR_9\n",
"if isinstance(VAR_10, SmartListFilter):\n",
"self.field_name = VAR_10.parameter_name\n",
"self.field_name = VAR_10\n",
"self.model_field = VAR_10\n",
"self.model_field = self.model._meta.get_field(self.field_name)\n",
"... | [
"def __init__(self, model, field, query_params, object_list):...\n",
"self.model = model\n",
"if isinstance(field, SmartListFilter):\n",
"self.field_name = field.parameter_name\n",
"self.field_name = field\n",
"self.model_field = field\n",
"self.model_field = self.model._meta.get_field(self.field_name)\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
"def setUp(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
0,
5
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_15(self, VAR_15, VAR_8):...\n",
"VAR_27, VAR_28 = super().as_sql(VAR_15, VAR_8)\n",
"VAR_27 = '%s::%s' % (VAR_27, self.lhs.output_field.db_type(VAR_8))\n",
"return VAR_27, VAR_28\n"
] | [
"def as_sql(self, qn, connection):...\n",
"sql, params = super().as_sql(qn, connection)\n",
"sql = '%s::%s' % (sql, self.lhs.output_field.db_type(connection))\n",
"return sql, params\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"super(CLASS_0, self).setUp()\n",
"self.mock(net, 'url_open', self._url_open)\n",
"self.mock(net, 'url_read_json', self._url_read_json)\n",
"self.mock(net, 'sleep_before_retry', lambda *VAR_10: None)\n",
"self._lock = threading.Lock()\n",
"self._requests = []\n"
] | [
"def setUp(self):...\n",
"super(TestCase, self).setUp()\n",
"self.mock(net, 'url_open', self._url_open)\n",
"self.mock(net, 'url_read_json', self._url_read_json)\n",
"self.mock(net, 'sleep_before_retry', lambda *_: None)\n",
"self._lock = threading.Lock()\n",
"self._requests = []\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, VAR_0):...\n",
"self.config = VAR_0\n",
"self.co2_mult = self.config.get_co2_avoidance_factor()\n",
"self.db = sqlite3.connect(self.config.get_database_path(),\n check_same_thread=False)\n",
"self.c = self.db.cursor()\n",
"self.local_timezone = self.get_local_timezone()\n"
] | [
"def __init__(self, config):...\n",
"self.config = config\n",
"self.co2_mult = self.config.get_co2_avoidance_factor()\n",
"self.db = sqlite3.connect(self.config.get_database_path(),\n check_same_thread=False)\n",
"self.c = self.db.cursor()\n",
"self.local_timezone = self.get_local_timezone()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@api.public...\n",
"FUNC_31(self, 'POST')\n"
] | [
"@api.public...\n",
"record(self, 'POST')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2):...\n",
"VAR_5 = VAR_0['points']\n",
"VAR_6 = copy(VAR_0['points_by_difficulty'])\n",
"def FUNC_2(VAR_7):...\n",
"if isinstance(VAR_7, list):\n",
"VAR_15, VAR_16 = zip(*VAR_7)\n",
"return VAR_5 >= VAR_7\n",
"for i, VAR_21 in enumerate(VAR_15):\n",
"if VAR_2:\n",
"r... | [
"def calculate_grade(total_points, point_limits, pad_points):...\n",
"points = total_points['points']\n",
"d_points = copy(total_points['points_by_difficulty'])\n",
"def pass_limit(bound):...\n",
"if isinstance(bound, list):\n",
"ds, ls = zip(*bound)\n",
"return points >= bound\n",
"for i, d in enumer... | [
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'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"AugAssign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_10(self, VAR_14):...\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.parser.parse(VAR_14, lexer=self.lexer)\n"
] | [
"def parse(self, expr):...\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.parser.parse(expr, lexer=self.lexer)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if self._inputsize is None:\n",
"self._inputsize = sum(VAR_28.size for VAR_28 in self.input)\n",
"return self._inputsize\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if self._inputsize is None:\n",
"self._inputsize = sum(f.size for f in self.input)\n",
"return self._inputsize\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_volume(VAR_7)\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_volume(volume)\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(VAR_0, VAR_1):...\n",
"VAR_1.execute(\n 'SELECT max(position) as position from video WHERE playlist_id={playlist_id};'\n .format(VAR_0=playlist_id))\n",
"VAR_9 = VAR_1.fetchone()\n",
"return VAR_9['position']\n"
] | [
"def retrieve_last_video_position(playlist_id, db):...\n",
"db.execute(\n 'SELECT max(position) as position from video WHERE playlist_id={playlist_id};'\n .format(playlist_id=playlist_id))\n",
"row = db.fetchone()\n",
"return row['position']\n"
] | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'GHABLE', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='GABLE', VAR_10=[{'name': '----GABLE'}, {'name':\n 'GHABLE'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'GHABLE', id='1')\n",
"verify_results(client, jwt, query='GABLE', expected=[{'name': '----GABLE'},\n {'name': 'GHABLE'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_7):...\n",
"VAR_8 = self.content\n",
"while VAR_8:\n",
"yield VAR_8[:VAR_7]\n",
"VAR_8 = VAR_8[VAR_7:]\n"
] | [
"def iter_content(self, chunk_size):...\n",
"c = self.content\n",
"while c:\n",
"yield c[:chunk_size]\n",
"c = c[chunk_size:]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'KOLDSMITHS', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='COLDSTREAM', VAR_10=[{'name': '----COLDSTREAM'\n }, {'name': 'KOLDSMITHS'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'KOLDSMITHS', id='1')\n",
"verify_results(client, jwt, query='COLDSTREAM', expected=[{'name':\n '----COLDSTREAM'}, {'name': 'KOLDSMITHS'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self):...\n",
"return redirect(flask.url_for('index'))\n"
] | [
"def redirect_to_index(self):...\n",
"return redirect(flask.url_for('index'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@wraps(VAR_55)...\n",
"VAR_70['timer'] = CLASS_2(VAR_25)\n",
"return VAR_55(*VAR_69, **kwargs)\n"
] | [
"@wraps(func)...\n",
"kwargs['timer'] = Timer(name)\n",
"return func(*args, **kwargs)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_24(self, *VAR_71, **VAR_72):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.params = VAR_71, VAR_72\n",
"return VAR_101\n"
] | [
"def params(self, *params, **kwparams):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.params = params, kwparams\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_26(self):...\n",
"self.compilation_ko(\n \"\"\"\nif header :is \"Sender\" \"me@example.com\" {\n discard;\n\n\"\"\")\n"
] | [
"def test_nonclosed_block(self):...\n",
"self.compilation_ko(\n \"\"\"\nif header :is \"Sender\" \"me@example.com\" {\n discard;\n\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {}\n",
"for count in range(0, 50):\n",
"if kb.dbms == 'Oracle' and VAR_0.endswith(' FROM DUAL'):\n",
"return None\n",
"VAR_0 = VAR_0[:-len(' FROM DUAL')]\n",
"if count:\n",
"VAR_0 += ', NULL'\n",
"if kb.dbms == 'Oracle':\n",
"... | [
"def __effectiveUnionTest(query, comment):...\n",
"\"\"\"docstring\"\"\"\n",
"resultDict = {}\n",
"for count in range(0, 50):\n",
"if kb.dbms == 'Oracle' and query.endswith(' FROM DUAL'):\n",
"return None\n",
"query = query[:-len(' FROM DUAL')]\n",
"if count:\n",
"query += ', NULL'\n",
"if kb.dbms... | [
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
2,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Condition",
"Assign'",
"Condition"... |
[
"def FUNC_45(VAR_25, VAR_39):...\n",
"if self.parentfield:\n",
"return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(VAR_25.label), VAR_39)\n",
"return '{}: {}'.format(_(VAR_25.label), VAR_39)\n"
] | [
"def get_msg(df, docname):...\n",
"if self.parentfield:\n",
"return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(df.label), docname)\n",
"return '{}: {}'.format(_(df.label), docname)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_5(VAR_1):...\n",
"VAR_6 = sqlite3.connect('database.db')\n",
"VAR_7 = VAR_6.cursor()\n",
"return VAR_7.execute(\n \"SELECT StartDate FROM SeriesTracking WHERE SeriesTitle = '\" + str(\n getTitle(VAR_1)) + \"'\").fetchone()[0]\n"
] | [
"def getSeriesDateFromDatabase(submission):...\n",
"database = sqlite3.connect('database.db')\n",
"cursor = database.cursor()\n",
"return cursor.execute(\n \"SELECT StartDate FROM SeriesTracking WHERE SeriesTitle = '\" + str(\n getTitle(submission)) + \"'\").fetchone()[0]\n"
] | [
0,
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"VAR_4 = self.client.get('/no_course/test', follow=True)\n",
"self.assertEqual(VAR_4.status_code, 404)\n",
"VAR_4 = self.client.get(self.current_course_instance.get_absolute_url(),\n follow=True)\n",
"self.assertTrue(VAR_4.redirect_chain)\n",
"self.assertEqual(VAR_4.status_co... | [
"def test_course_views(self):...\n",
"response = self.client.get('/no_course/test', follow=True)\n",
"self.assertEqual(response.status_code, 404)\n",
"response = self.client.get(self.current_course_instance.get_absolute_url(),\n follow=True)\n",
"self.assertTrue(response.redirect_chain)\n",
"self.asser... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(VAR_0, VAR_13):...\n",
"db.engine.execute('DELETE FROM \"{0}\" WHERE {1}'.format(VAR_0, VAR_13))\n"
] | [
"def delete_rows(table_name, condition):...\n",
"db.engine.execute('DELETE FROM \"{0}\" WHERE {1}'.format(table_name, condition))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(VAR_0):...\n",
"VAR_2 = []\n",
"VAR_5 = {}\n",
"VAR_6 = 's.transaction_date' if VAR_0['based_on'\n ] == 'Sales Order' else 's.posting_date'\n",
"VAR_7 = frappe.db.sql('string'.format(VAR_6=date_field, doctype=filters[\n 'based_on']), as_dict=1)\n",
"for d in VAR_7:\n",
"VAR_5.setdefaul... | [
"def get_sales_details(filters):...\n",
"data = []\n",
"item_details_map = {}\n",
"date_field = 's.transaction_date' if filters['based_on'\n ] == 'Sales Order' else 's.posting_date'\n",
"sales_data = frappe.db.sql(\n \"\"\"\n\t\tselect s.territory, s.customer, si.item_group, si.item_name, si.qty, {dat... | [
0,
0,
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"@app.route('/api/commands', methods=['GET'])...\n",
"return commands.to_map()\n"
] | [
"@app.route('/api/commands', methods=['GET'])...\n",
"return commands.to_map()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_9(self, VAR_7):...\n",
"if VAR_7 in self.__dict__:\n"
] | [
"def delete_key(self, key):...\n",
"if key in self.__dict__:\n"
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_14(self):...\n",
"self.compilation_ko(\n \"\"\"\nif address \"From\" :is \"tim@example.com\" {\n discard;\n}\n\"\"\")\n"
] | [
"def test_non_ordered_args(self):...\n",
"self.compilation_ko(\n \"\"\"\nif address \"From\" :is \"tim@example.com\" {\n discard;\n}\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = self.add_argument_group('ParlAI Image Preprocessing Arguments')\n",
"VAR_26.add_argument('--image-size', type=int, default=256, help=\n 'resizing dimension for images')\n",
"VAR_26.add_argument('--image-cropsize', type=int, default=2... | [
"def add_image_args(self, image_mode):...\n",
"\"\"\"docstring\"\"\"\n",
"parlai = self.add_argument_group('ParlAI Image Preprocessing Arguments')\n",
"parlai.add_argument('--image-size', type=int, default=256, help=\n 'resizing dimension for images')\n",
"parlai.add_argument('--image-cropsize', type=int... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"from lib.core.agent import agent\n",
"from lib.core.data import conf\n",
"from lib.core.data import kb\n",
"from lib.core.data import logger\n",
"from lib.core.data import queries\n",
"from lib.core.session import setUnion\n",
"from lib.request.connect import Connect as Reques... | [
"\"\"\"\n$Id$\n\nThis file is part of the sqlmap project, http://sqlmap.sourceforge.net.\n\nCopyright (c) 2006-2008 Bernardo Damele A. G. <bernardo.damele@gmail.com>\n and Daniele Bellucci <daniele.bellucci@gmail.com>\n\nsqlmap is free software; you can redistribute it and/or modify it under\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
2,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
0,
2
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"A... |
[
"def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n",
"GenericRequest.__init__(self, VAR_1, VAR_4)\n",
"self.url = self.base_url\n",
"self.username = VAR_2\n",
"self.loggedin = VAR_3\n"
] | [
"def __init__(self, browser, username, loggedin, base_url=None):...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.url = self.base_url\n",
"self.username = username\n",
"self.loggedin = loggedin\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_26(self, VAR_74):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.benchmark = VAR_74\n",
"return VAR_101\n"
] | [
"def benchmark(self, benchmark):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.benchmark = benchmark\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_21(VAR_18, VAR_29, VAR_30=60):...\n",
"VAR_50 = re.compile(\n 'Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.|Scoring\\\\.\\\\.\\\\.|Evaluated')\n",
"VAR_51 = re.compile('Compilation failed|Evaluated \\\\(|Scored \\\\(')\n",
"VAR_34 = FUNC_0()\n",
"VAR_52 = 0.1\n",
"while VAR_30 > 0:\n",
... | [
"def get_evaluation_result(contest_id, submission_id, timeout=60):...\n",
"WAITING_STATUSES = re.compile(\n 'Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.|Scoring\\\\.\\\\.\\\\.|Evaluated')\n",
"COMPLETED_STATUS = re.compile('Compilation failed|Evaluated \\\\(|Scored \\\\(')\n",
"browser = get_aws_bro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_0.type in ['FU', 'CO', 'CP']:\n",
"return False\n",
"if VAR_0.all_matched() and not VAR_0.all_extracted():\n",
"return CLASS_1(dg_type=dg.type)\n",
"return False\n"
] | [
"def include_extract_form(dg):...\n",
"\"\"\"docstring\"\"\"\n",
"if not dg.type in ['FU', 'CO', 'CP']:\n",
"return False\n",
"if dg.all_matched() and not dg.all_extracted():\n",
"return ExtractionScriptForm(dg_type=dg.type)\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_9(self, VAR_4):...\n",
"VAR_11 = 'result/' + self.cate_str + '_attack' + str(self.count) + '.sh'\n",
"f.write(VAR_4)\n"
] | [
"def saveScript(self, script):...\n",
"script_name = 'result/' + self.cate_str + '_attack' + str(self.count) + '.sh'\n",
"f.write(script)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'KOFI', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='COFFI', VAR_10=[{'name': '----COFFI'}, {'name':\n 'KOFI'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'KOFI', id='1')\n",
"verify_results(client, jwt, query='COFFI', expected=[{'name': '----COFFI'},\n {'name': 'KOFI'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.NO_USER, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.NO_USER, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(VAR_4, VAR_9, VAR_10):...\n",
"return redirect('/index.html?email=' + VAR_9 + '&hash=' + VAR_10)\n"
] | [
"def confirm(request, email, hashed):...\n",
"return redirect('/index.html?email=' + email + '&hash=' + hashed)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.BAD_USERNAME, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.BAD_USERNAME, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_2, VAR_6, VAR_7, VAR_4, VAR_3):...\n",
"if VAR_7:\n",
"VAR_7 = VAR_7 == 'TRUE'\n",
"VAR_7 = None\n",
"setattr(VAR_2, VAR_6, VAR_7)\n"
] | [
"def parse_input(self, report, name, value, request, attribute):...\n",
"if value:\n",
"value = value == 'TRUE'\n",
"value = None\n",
"setattr(report, name, value)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_31(VAR_62):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_84 = 0\n",
"while VAR_62[VAR_84].isdigit():\n",
"VAR_84 += 1\n",
"if VAR_84 > 0:\n",
"return int(VAR_62[:VAR_84])\n",
"return 0\n"
] | [
"def _get_value_kw(kw):...\n",
"\"\"\"docstring\"\"\"\n",
"i = 0\n",
"while kw[i].isdigit():\n",
"i += 1\n",
"if i > 0:\n",
"return int(kw[:i])\n",
"return 0\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n",
"VAR_7 = []\n",
"VAR_8 = self.pool.get('ir.model.data')\n",
"VAR_9 = self.pool.get('account.bank.statement')\n",
"VAR_10 = self.pool.get('acc... | [
"def close_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\n",
"statement_obj = self.pool.get('account.bank.statement')\n",
"journa... | [
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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"... |
[
"def FUNC_0(self, *VAR_5, **VAR_4):...\n",
"if self.run_local:\n",
"return utils.execute(*VAR_5, **kwargs)\n",
"VAR_7 = VAR_4.pop('check_exit_code', None)\n",
"VAR_6 = ' '.join(VAR_5)\n",
"return self._run_ssh(VAR_6, VAR_7)\n"
] | [
"def san_execute(self, *cmd, **kwargs):...\n",
"if self.run_local:\n",
"return utils.execute(*cmd, **kwargs)\n",
"check_exit_code = kwargs.pop('check_exit_code', None)\n",
"command = ' '.join(cmd)\n",
"return self._run_ssh(command, check_exit_code)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_36(self, VAR_20):...\n",
"return ''.join(FUNC_8(VAR_20)) == '*'\n"
] | [
"def is_dummy_password(self, pwd):...\n",
"return ''.join(set(pwd)) == '*'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_60(self):...\n",
"self._test_strtype('blob', bytearray(VAR_13), VAR_23(VAR_13))\n"
] | [
"def t(self):...\n",
"self._test_strtype('blob', bytearray(value), len(value))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"string\"\"\"\n",
"def __init__(self, VAR_14, VAR_12):...\n",
"self._splitpath = fs.split_path(VAR_14.path)\n",
"self._targetparam = set(VAR_14.parameters.keys())\n",
"self._lensplitpath = len(self._splitpath)\n",
"self._store = {}\n",... | [
"def get_frontier_contexts(self, targetpath):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"\n \n implementation details:\n set of parameters:\n calculate extra parameters\n calculate missing parameters\n if there are missing parameters, then cull the search\n if there is one extra parameter, th... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_24(self, VAR_7, VAR_17):...\n",
"self.common.extend_volume(VAR_7, VAR_17)\n"
] | [
"def extend_volume(self, volume, new_size):...\n",
"self.common.extend_volume(volume, new_size)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"self._omnicomp.OnFileReadyToParse(None)\n",
"if not self._IsServerAlive():\n",
"self._NotifyUserIfServerCrashed()\n",
"VAR_5 = {}\n",
"self._AddTagsFilesIfNeeded(VAR_5)\n",
"self._AddSyntaxDataIfNeeded(VAR_5)\n",
"self._AddExtraConfDataIfNeeded(VAR_5)\n",
"self._latest_fi... | [
"def OnFileReadyToParse(self):...\n",
"self._omnicomp.OnFileReadyToParse(None)\n",
"if not self._IsServerAlive():\n",
"self._NotifyUserIfServerCrashed()\n",
"extra_data = {}\n",
"self._AddTagsFilesIfNeeded(extra_data)\n",
"self._AddSyntaxDataIfNeeded(extra_data)\n",
"self._AddExtraConfDataIfNeeded(ext... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_4):...\n",
""
] | [
"def _on_headers(self, data):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@handled_slot(bool)...\n",
"VAR_17, VAR_18 = QInputDialog.getDouble(self.window, title='Set Wavelength',\n label='Wavelength (nm): ', value=self.matisse.target_wavelength)\n",
"if VAR_18:\n",
"print(f'Setting wavelength to {VAR_17} nm...')\n",
"self.matisse.set_wavelength(VAR_17)\n"
] | [
"@handled_slot(bool)...\n",
"target_wavelength, success = QInputDialog.getDouble(self.window, title=\n 'Set Wavelength', label='Wavelength (nm): ', value=self.matisse.\n target_wavelength)\n",
"if success:\n",
"print(f'Setting wavelength to {target_wavelength} nm...')\n",
"self.matisse.set_wavelength(... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_4, VAR_1, VAR_2):...\n",
"for action_group in VAR_2._action_groups:\n",
"for VAR_3 in action_group._group_actions:\n",
"if VAR_3.dest == VAR_4:\n",
"return VAR_3\n"
] | [
"def find_action(self, keyword, parsed, parser):...\n",
"for action_group in parser._action_groups:\n",
"for action in action_group._group_actions:\n",
"if action.dest == keyword:\n",
"return action\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"For",
"Condition",
"Return'"
] |
[
"def FUNC_1(self, VAR_2, *VAR_5, **VAR_6):...\n",
"VAR_1 = self.current_user\n",
"VAR_19 = VAR_1.name\n",
"VAR_9 = VAR_1.email\n",
"logging.info('Request: ' + VAR_19 + ' ' + VAR_9)\n",
"self.finish(json.dumps({'user': VAR_19, 'email': VAR_9}))\n"
] | [
"def get(self, dataset, *args, **kwargs):...\n",
"user = self.current_user\n",
"name = user.name\n",
"email = user.email\n",
"logging.info('Request: ' + name + ' ' + email)\n",
"self.finish(json.dumps({'user': name, 'email': email}))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.