lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_22(self, VAR_17, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def remove_export(self, context, volume):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_41(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_32 = list()\n",
"for VAR_14 in self.get_columns_list():\n",
"if not self.is_pk(VAR_14) and not self.is_fk(VAR_14):\n",
"return VAR_32\n",
"VAR_32.append(VAR_14)\n"
] | [
"def get_user_columns_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"ret_lst = list()\n",
"for col_name in self.get_columns_list():\n",
"if not self.is_pk(col_name) and not self.is_fk(col_name):\n",
"return ret_lst\n",
"ret_lst.append(col_name)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_34(self):...\n",
"self.compilation_ko(\n \"\"\"\nif anyof (header :is \"Sender\" \"me@example.com\",) {\n\n}\n\"\"\")\n"
] | [
"def test_misplaced_comma_in_tests_list(self):...\n",
"self.compilation_ko(\n \"\"\"\nif anyof (header :is \"Sender\" \"me@example.com\",) {\n\n}\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_0.route('/viz')...\n",
"return render_template('louvain.html')\n"
] | [
"@application.route('/viz')...\n",
"return render_template('louvain.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"return self.get_url_with_query_params({self.field_name: self.value})\n"
] | [
"def get_url(self):...\n",
"return self.get_url_with_query_params({self.field_name: self.value})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_snapshot(VAR_8)\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_snapshot(snapshot)\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_1=None, VAR_2=None, VAR_3=None, VAR_4=None, VAR_5=...\n",
"\"\"\"docstring\"\"\"\n",
"self._rules = OrderedDict()\n",
"self.first_rule = None\n",
"self._workdir = None\n",
"self.overwrite_workdir = VAR_6\n",
"self.workdir_init = os.path.abspath(os.curdir)\n",
"self._ruleorder =... | [
"def __init__(self, snakefile=None, snakemakepath=None, jobscript=None,...\n",
"\"\"\"docstring\"\"\"\n",
"self._rules = OrderedDict()\n",
"self.first_rule = None\n",
"self._workdir = None\n",
"self.overwrite_workdir = overwrite_workdir\n",
"self.workdir_init = os.path.abspath(os.curdir)\n",
"self._ru... | [
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
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_3():...\n",
"def FUNC_12():...\n",
"VAR_18 = requests.get(FUNC_2('healthy'))\n",
"VAR_18.raise_for_status()\n",
"return VAR_18.json()\n"
] | [
"def _CheckServerIsHealthyWithCache():...\n",
"def _ServerIsHealthy():...\n",
"response = requests.get(_BuildUri('healthy'))\n",
"response.raise_for_status()\n",
"return response.json()\n"
] | [
0,
0,
7,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_21(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"for key, value in self.iscsi_ips.items():\n",
"if value['nsp'] == VAR_15:\n",
"return key\n"
] | [
"def _get_ip_using_nsp(self, nsp):...\n",
"\"\"\"docstring\"\"\"\n",
"for key, value in self.iscsi_ips.items():\n",
"if value['nsp'] == nsp:\n",
"return key\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'"
] |
[
"def FUNC_12(self, VAR_22):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.warning(\"\"\"Authentication error.\n%s\"\"\", VAR_22)\n",
"self.abort(401, detail=str(error))\n"
] | [
"def authentication_error(self, error):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.warning(\"\"\"Authentication error.\n%s\"\"\", error)\n",
"self.abort(401, detail=str(error))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'RHEN', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='REN', VAR_10=[{'name': '----REN'}, {'name':\n 'RHEN'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'RHEN', id='1')\n",
"verify_results(client, jwt, query='REN', expected=[{'name': '----REN'}, {\n 'name': 'RHEN'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"self.check_broken_symlink()\n",
"return os.path.getsize(self.file)\n"
] | [
"@property...\n",
"self.check_broken_symlink()\n",
"return os.path.getsize(self.file)\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_16(VAR_14, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_33 = Article.objects.get(VAR_19=title)\n",
"VAR_34 = VAR_33.changeset_set.all()\n",
"VAR_35 = []\n",
"for cs in VAR_34:\n",
"if cs.old_title and cs.old_title != VAR_19 and cs.old_title not in VAR_35:\n",
"VAR_36 = re.match('(!?)(\\\\... | [
"def backlinks(request, title):...\n",
"\"\"\"docstring\"\"\"\n",
"this_article = Article.objects.get(title=title)\n",
"changesets = this_article.changeset_set.all()\n",
"old_titles = []\n",
"for cs in changesets:\n",
"if cs.old_title and cs.old_title != title and cs.old_title not in old_titles:\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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_6(self, VAR_44, VAR_45):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_45 not in VAR_44:\n",
"return\n",
"for table_name in sorted(VAR_44[VAR_45]):\n",
"yield table_name, VAR_45\n",
"for item in self.create_join_path(VAR_44, table_name):\n",
"yield item\n"
] | [
"def create_join_path(self, path_map, curr_table):...\n",
"\"\"\"docstring\"\"\"\n",
"if curr_table not in path_map:\n",
"return\n",
"for table_name in sorted(path_map[curr_table]):\n",
"yield table_name, curr_table\n",
"for item in self.create_join_path(path_map, table_name):\n",
"yield item\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"For",
"Expr'",
"For",
"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'"
] |
[
"def FUNC_1(VAR_0, VAR_3, VAR_1, VAR_2):...\n",
"VAR_4 = VAR_0.cursor()\n",
"VAR_5 = 'ALTER TABLE Presets DROP COLUMN id;'\n",
"VAR_4.execute(VAR_5)\n",
"VAR_5 = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n",
"VAR_4.execute(VAR_5)\n",
"if VAR_1 != 'N... | [
"def edit_preset(conn, key, queryin, descriptin):...\n",
"cursor = conn.cursor()\n",
"quer = 'ALTER TABLE Presets DROP COLUMN id;'\n",
"cursor.execute(quer)\n",
"quer = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n",
"cursor.execute(quer)\n",
"if quer... | [
0,
0,
0,
0,
0,
0,
4,
4,
4,
4,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_26(self, VAR_14):...\n",
""
] | [
"def get_max_length(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(self, VAR_0, *VAR_2, **VAR_3):...\n",
"VAR_11 = ShortUrlForm()\n",
"return render(VAR_0, 'home.html', {'form': VAR_11})\n"
] | [
"def get(self, request, *args, **kwargs):...\n",
"form = ShortUrlForm()\n",
"return render(request, 'home.html', {'form': form})\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(VAR_0, VAR_2):...\n",
"return os.chmod(VAR_0, VAR_2, follow_symlinks=os.chmod not in os.\n supports_follow_symlinks)\n"
] | [
"def lchmod(f, mode):...\n",
"return os.chmod(f, mode, follow_symlinks=os.chmod not in os.\n supports_follow_symlinks)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12(self, VAR_10, VAR_12, **VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {}\n",
"VAR_5['volumeName'] = VAR_10['name']\n",
"VAR_5['serverName'] = VAR_12['host']\n",
"self._cliq_run_xml('unassignVolumeToServer', VAR_5)\n"
] | [
"def terminate_connection(self, volume, connector, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"cliq_args = {}\n",
"cliq_args['volumeName'] = volume['name']\n",
"cliq_args['serverName'] = connector['host']\n",
"self._cliq_run_xml('unassignVolumeToServer', cliq_args)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = VAR_5.name\n",
"if not VAR_5.enabled:\n",
"VAR_21 = f'~~{VAR_21}~~'\n",
"if VAR_5.hidden:\n",
"VAR_21 = f'*{VAR_21}*'\n",
"if isinstance(VAR_5, neko.GroupMixin) and getattr(VAR_5, 'commands'):\n",
"VAR_21 = f'{VAR_21}\\\\*'\n",
"if VAR_6:\... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"name = cmd.name\n",
"if not cmd.enabled:\n",
"name = f'~~{name}~~'\n",
"if cmd.hidden:\n",
"name = f'*{name}*'\n",
"if isinstance(cmd, neko.GroupMixin) and getattr(cmd, 'commands'):\n",
"name = f'{name}\\\\*'\n",
"if is_full:\n",
"name = f'{cmd.f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_11(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = VAR_3.user\n",
"VAR_33 = [(unicode(year), unicode(year)) for year in UserProfile.VALID_YEARS]\n",
"VAR_26 = FUNC_8(VAR_10)\n",
"VAR_1.exception('Error fetching order history from Otto.')\n",
"VAR_5 = {'auth': {}, 'duplicate_provider': None... | [
"def account_settings_context(request):...\n",
"\"\"\"docstring\"\"\"\n",
"user = request.user\n",
"year_of_birth_options = [(unicode(year), unicode(year)) for year in\n UserProfile.VALID_YEARS]\n",
"user_orders = get_user_orders(user)\n",
"log.exception('Error fetching order history from Otto.')\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(self, VAR_6, VAR_7, VAR_5):...\n",
"VAR_14 = []\n",
"VAR_14.append('string'.format(VAR_6))\n",
"VAR_14.append('string'.format(VAR_6, VAR_5, VAR_7))\n",
"for query in VAR_14:\n",
"self.cur.execute(query)\n",
"self.conn.commit()\n"
] | [
"def update_roster(self, username, role, server_id):...\n",
"sql = []\n",
"sql.append(\n \"\"\"INSERT INTO users (username)\n VALUES ('{0}')\n ON DUPLICATE KEY UPDATE username = '{0}';\n \"\"\"\n .format(username))\n",
"sql.append(\n \"\"... | [
0,
4,
4,
4,
4,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_4, VAR_5):...\n",
"VAR_12 = VAR_4.get('href')\n",
"if VAR_5 == False:\n",
"return VAR_12.split('/')[4]\n",
"if VAR_12.split('/')[3] == 'app':\n",
"return VAR_12.split('/')[5]\n",
"return 'NONE'\n"
] | [
"def cleanID(id, isTitle):...\n",
"result = id.get('href')\n",
"if isTitle == False:\n",
"return result.split('/')[4]\n",
"if result.split('/')[3] == 'app':\n",
"return result.split('/')[5]\n",
"return 'NONE'\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"import argparse, ast, json, sys, keyword, math\n",
"VAR_0 = ['__doc__', '__package__']\n",
"VAR_1 = ['abs', 'all', 'any', 'ArithmeticError', 'ascii', 'AssertionError',\n 'AttributeError', 'BaseException', 'bin', 'BlockingIOError', 'bool',\n 'BrokenPipeError', 'BufferError', '__build_class__', 'bytearray'... | [
"import argparse, ast, json, sys, keyword, math\n",
"global_whitelist = ['__doc__', '__package__']\n",
"builtins_whitelist = ['abs', 'all', 'any', 'ArithmeticError', 'ascii',\n 'AssertionError', 'AttributeError', 'BaseException', 'bin',\n 'BlockingIOError', 'bool', 'BrokenPipeError', 'BufferError',\n '... | [
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = block.sys_block_path(VAR_1)\n",
"VAR_24 = os.path.join(VAR_1, 'dm', 'name')\n",
"VAR_25, VAR_26 = lvm.split_lvm_name(util.load_file(VAR_24))\n",
"LOG.debug('running lvremove on %s/%s', VAR_25, VAR_26)\n",
"util.subp(['lvremove', '--force', '... | [
"def shutdown_lvm(device):...\n",
"\"\"\"docstring\"\"\"\n",
"device = block.sys_block_path(device)\n",
"name_file = os.path.join(device, 'dm', 'name')\n",
"vg_name, lv_name = lvm.split_lvm_name(util.load_file(name_file))\n",
"LOG.debug('running lvremove on %s/%s', vg_name, lv_name)\n",
"util.subp(['lvr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"self.run_test_case(self.scenario.register_load_balancer_instances())\n"
] | [
"def test_c_register_load_balancer_instances(self):...\n",
"self.run_test_case(self.scenario.register_load_balancer_instances())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_43(self):...\n",
"self.assertEqual(self.cnxn.autocommit, False)\n",
"VAR_30 = pyodbc.connect(self.connection_string, autocommit=True)\n",
"self.assertEqual(VAR_30.autocommit, True)\n",
"VAR_30.autocommit = False\n",
"self.assertEqual(VAR_30.autocommit, False)\n"
] | [
"def test_autocommit(self):...\n",
"self.assertEqual(self.cnxn.autocommit, False)\n",
"othercnxn = pyodbc.connect(self.connection_string, autocommit=True)\n",
"self.assertEqual(othercnxn.autocommit, True)\n",
"othercnxn.autocommit = False\n",
"self.assertEqual(othercnxn.autocommit, False)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __init__(self):...\n",
"self.requests = {}\n",
"self.databuffer = {}\n",
"self.last_alive = {}\n",
"self.keep_alive = None\n"
] | [
"def __init__(self):...\n",
"self.requests = {}\n",
"self.databuffer = {}\n",
"self.last_alive = {}\n",
"self.keep_alive = None\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(self, VAR_27):...\n",
"VAR_22 = self.gic.unproxy(self)\n",
"VAR_32 = FdtNode('interrupt-controller')\n",
"VAR_32.appendCompatible(['gem5,gic', 'arm,cortex-a15-gic', 'arm,cortex-a9-gic']\n )\n",
"VAR_32.append(FdtPropertyWords('#interrupt-cells', [3]))\n",
"VAR_32.append(FdtPropertyWords('#a... | [
"def generateDeviceTree(self, state):...\n",
"gic = self.gic.unproxy(self)\n",
"node = FdtNode('interrupt-controller')\n",
"node.appendCompatible(['gem5,gic', 'arm,cortex-a15-gic', 'arm,cortex-a9-gic'])\n",
"node.append(FdtPropertyWords('#interrupt-cells', [3]))\n",
"node.append(FdtPropertyWords('#address... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for fam in ('tape', 'disk', 'dir'):\n",
"for VAR_6 in client.devices.get(family=fam):\n",
"self.assertEqual(dev_family2str(VAR_6.family), fam)\n"
] | [
"def test_list_devices_by_family(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for fam in ('tape', 'disk', 'dir'):\n",
"for dev in client.devices.get(family=fam):\n",
"self.assertEqual(dev_family2str(dev.family), fam)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"For",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"for VAR_16, VAR_17, VAR_18, VAR_19 in self.wz_bind_methods:\n",
"self.unbind_route(VAR_16, VAR_17)\n"
] | [
"def unbind_methods(self):...\n",
"for i, m, f, t in self.wz_bind_methods:\n",
"self.unbind_route(i, m)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_5(self, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"if not os.path.exists(VAR_4):\n",
"VAR_19 = os.path.dirname(VAR_4)\n",
"if not os.path.isdir(VAR_19):\n",
"try_to_create_directory(VAR_19)\n"
] | [
"def prepare_socket_file(self, socket_path):...\n",
"\"\"\"docstring\"\"\"\n",
"if not os.path.exists(socket_path):\n",
"path = os.path.dirname(socket_path)\n",
"if not os.path.isdir(path):\n",
"try_to_create_directory(path)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_15(self, VAR_17, VAR_18):...\n",
"VAR_26 = set(VAR_17.parameters.keys())\n",
"VAR_27 = VAR_26 - self._targetparam\n",
"VAR_25 = len(VAR_27)\n",
"VAR_28 = len(self._targetparam - VAR_26)\n",
"VAR_21 = fs.split_path(VAR_17.path)\n",
"VAR_23 = min(self._lensplitpath, len(VAR_21))\n",
"if VAR_25... | [
"def test(self, pathctx, levelctx):...\n",
"path_set = set(pathctx.parameters.keys())\n",
"extra_param = path_set - self._targetparam\n",
"extra_count = len(extra_param)\n",
"missing_count = len(self._targetparam - path_set)\n",
"testpath = fs.split_path(pathctx.path)\n",
"lenpath = min(self._lensplitpa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def __init__(self, *VAR_2, **VAR_3):...\n",
"super(CLASS_0, self).__init__(*VAR_2, **kwargs)\n",
"self.cluster_vip = None\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super(HpSanISCSIDriver, self).__init__(*args, **kwargs)\n",
"self.cluster_vip = None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_3(VAR_3, VAR_4=None):...\n",
"VAR_0 = CLASS_0(VAR_3)\n",
"VAR_0.rule = VAR_4\n",
"return VAR_0\n"
] | [
"def IOFile(file, rule=None):...\n",
"f = _IOFile(file)\n",
"f.rule = rule\n",
"return f\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_18):...\n",
"self.setResponseCode(302)\n",
"self.setHeader(b'location', VAR_18)\n"
] | [
"def redirect(self, url):...\n",
"self.setResponseCode(302)\n",
"self.setHeader(b'location', url)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@app.route('/<issue_id>/delete', methods=['POST'])...\n",
"if not current_user.is_admin:\n",
"return redirect(url_for('error401'))\n",
"VAR_5 = Issue.query.get(VAR_1)\n",
"if not VAR_5:\n",
"return redirect(url_for('error404'))\n",
"VAR_6 = Article.query.filter_by(VAR_0=issue_id)\n",
"for article in ... | [
"@app.route('/<issue_id>/delete', methods=['POST'])...\n",
"if not current_user.is_admin:\n",
"return redirect(url_for('error401'))\n",
"issue_to_delete = Issue.query.get(issue_id)\n",
"if not issue_to_delete:\n",
"return redirect(url_for('error404'))\n",
"articles_in_issue = Article.query.filter_by(iss... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"import os\n",
"import sys\n",
"import contextlib\n",
"import enum\n",
"from enum import Enum\n",
"def FUNC_0():...\n",
"VAR_0 = CLASS_0()\n",
"VAR_0.run()\n",
"\"\"\"\n The main shell class.\n \"\"\"\n",
"def __init__(self):...\n",
"self.builtins = {'exit': self._builtin_exit, 'pwd': self... | [
"import os\n",
"import sys\n",
"import contextlib\n",
"import enum\n",
"from enum import Enum\n",
"def main():...\n",
"sh = Shell()\n",
"sh.run()\n",
"\"\"\"\n The main shell class.\n \"\"\"\n",
"def __init__(self):...\n",
"self.builtins = {'exit': self._builtin_exit, 'pwd': self._builtin_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters={'name': ['like', 'J%']}))\n"
] | [
"def test_filters_3(self):...\n",
"self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters={'name': ['like', 'J%']}))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1():...\n",
"template.bootstrap({'templates': os.path.join(VAR_0, 'templates')})\n",
"VAR_3 = FUNC_0()\n",
"VAR_3.extend(handlers_endpoints.get_routes())\n",
"return webapp2.WSGIApplication(VAR_3)\n"
] | [
"def create_frontend_app():...\n",
"template.bootstrap({'templates': os.path.join(THIS_DIR, 'templates')})\n",
"routes = get_routes()\n",
"routes.extend(handlers_endpoints.get_routes())\n",
"return webapp2.WSGIApplication(routes)\n"
] | [
0,
0,
5,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"__author__ = 'vladimir'\n",
"import ujson\n",
"from flask import Blueprint\n",
"VAR_0 = '/user'\n",
"VAR_1 = Blueprint('user', __name__)\n",
"@VAR_1.route(VAR_0 + '/create', methods=['GET'])...\n",
"return ujson.dumps({'success': True})\n"
] | [
"__author__ = 'vladimir'\n",
"import ujson\n",
"from flask import Blueprint\n",
"BASE_URL = '/user'\n",
"user = Blueprint('user', __name__)\n",
"@user.route(BASE_URL + '/create', methods=['GET'])...\n",
"return ujson.dumps({'success': True})\n"
] | [
0,
0,
0,
4,
4,
0,
0
] | [
"Assign'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"@VAR_0.teardown_appcontext...\n",
"\"\"\"docstring\"\"\"\n",
"storage.close()\n"
] | [
"@app.teardown_appcontext...\n",
"\"\"\"docstring\"\"\"\n",
"storage.close()\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_2(VAR_2):...\n",
""
] | [
"def get_title_from_youtube_url(url):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_22(VAR_30, VAR_3):...\n",
"if not isinstance(VAR_30, _IOFile):\n",
"return IOFile(VAR_30, VAR_16=self)\n",
"return VAR_30.apply_wildcards(VAR_3, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n"
] | [
"def concretize_iofile(f, wildcards):...\n",
"if not isinstance(f, _IOFile):\n",
"return IOFile(f, rule=self)\n",
"return f.apply_wildcards(wildcards, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"@api.route('/items', methods=['GET'])...\n",
"VAR_1 = 'SELECT id, name_enus from tblDBCItem where auctionable = true;'\n",
"VAR_2 = mysql.connection.cursor()\n",
"VAR_2.execute(VAR_1)\n",
"VAR_3 = VAR_2.fetchall()\n",
"VAR_4 = []\n",
"for row in VAR_3:\n",
"VAR_6 = {}\n",
"return jsonify({'items': ... | [
"@api.route('/items', methods=['GET'])...\n",
"sql = 'SELECT id, name_enus from tblDBCItem where auctionable = true;'\n",
"cursor = mysql.connection.cursor()\n",
"cursor.execute(sql)\n",
"data = cursor.fetchall()\n",
"results = []\n",
"for row in data:\n",
"item = {}\n",
"return jsonify({'items': re... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_6, VAR_7, VAR_5):...\n",
"VAR_14 = []\n",
"VAR_14.append('string'.format(VAR_6))\n",
"VAR_14.append('string'.format(VAR_6, VAR_5, VAR_7))\n",
"for query in VAR_14:\n",
"self.cur.execute(query)\n",
"self.conn.commit()\n"
] | [
"def update_roster(self, username, role, server_id):...\n",
"sql = []\n",
"sql.append(\n \"\"\"INSERT INTO users (username)\n VALUES ('{0}')\n ON DUPLICATE KEY UPDATE username = '{0}';\n \"\"\"\n .format(username))\n",
"sql.append(\n \"\"... | [
0,
4,
4,
4,
4,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_11=None):...\n",
"resource.Resource.__init__(self)\n",
"self.avatar = VAR_11\n",
"self.use_security_proxy = get_config().getboolean('auth', 'security_proxy_rest'\n )\n"
] | [
"def __init__(self, avatar=None):...\n",
"resource.Resource.__init__(self)\n",
"self.avatar = avatar\n",
"self.use_security_proxy = get_config().getboolean('auth', 'security_proxy_rest'\n )\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_26(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'LOW': 8, 'MEDIUM': 0, 'HIGH': 1}, 'CONFIDENCE': {\n 'HIGH': 9}}\n",
"self.check_example('os-popen.py', VAR_2)\n"
] | [
"def test_os_popen(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'LOW': 8, 'MEDIUM': 0, 'HIGH': 1}, 'CONFIDENCE': {\n 'HIGH': 9}}\n",
"self.check_example('os-popen.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def __next__(self):...\n",
""
] | [
"def __next__(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_3(VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_2 is None:\n",
"return None\n",
"if not VAR_2.startswith('models:'):\n",
"return VAR_2\n",
"VAR_18 = VAR_2[7:VAR_2.rfind('/')].replace('/', '.')\n",
"VAR_19 = f'parlai.zoo.{VAR_18}'\n",
"print(VAR_19)\n",
"VAR_36 = importlib.impo... | [
"def modelzoo_path(datapath, path):...\n",
"\"\"\"docstring\"\"\"\n",
"if path is None:\n",
"return None\n",
"if not path.startswith('models:'):\n",
"return path\n",
"animal = path[7:path.rfind('/')].replace('/', '.')\n",
"module_name = f'parlai.zoo.{animal}'\n",
"print(module_name)\n",
"my_module... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"return 'try to login'\n"
] | [
"def describe(self):...\n",
"return 'try to login'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from django.shortcuts import render, get_object_or_404, reverse, redirect, HttpResponse\n",
"from django.urls import reverse_lazy\n",
"from django.views import View\n",
"from django.views.generic import CreateView, ListView, UpdateView, DeleteView\n",
"from django.contrib.auth.mixins import LoginRequiredMi... | [
"from django.shortcuts import render, get_object_or_404, reverse, redirect, HttpResponse\n",
"from django.urls import reverse_lazy\n",
"from django.views import View\n",
"from django.views.generic import CreateView, ListView, UpdateView, DeleteView\n",
"from django.contrib.auth.mixins import LoginRequiredMi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __enter__(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self._bin_found is None:\n",
"if not os.path.exists(self.binary):\n",
"if not self._bin_found:\n",
"self._bin_found = True\n",
"self.go_get()\n",
"self._bin_found = False\n",
"return self.gometalinter()\n",
"self._install_linters()\n"
] | [
"def __enter__(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self._bin_found is None:\n",
"if not os.path.exists(self.binary):\n",
"if not self._bin_found:\n",
"self._bin_found = True\n",
"self.go_get()\n",
"self._bin_found = False\n",
"return self.gometalinter()\n",
"self._install_linters()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"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'... |
[
"@app.route('/api/indi_profiles/<id>', methods=['GET'])...\n",
"return controller.indi_profiles.lookup(VAR_4).to_map()\n"
] | [
"@app.route('/api/indi_profiles/<id>', methods=['GET'])...\n",
"return controller.indi_profiles.lookup(id).to_map()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_10(VAR_0, VAR_12, VAR_3, VAR_4):...\n",
"if VAR_12[0] < 0:\n",
"VAR_31 = VAR_3[VAR_12[0]]\n",
"VAR_31 = VAR_12[0]\n",
"VAR_7 = SymbolicInput(VAR_4[0], VAR_0, VAR_31, None)\n",
"VAR_3[VAR_4[0]] = VAR_7\n",
"VAR_4[0] -= 1\n",
"return VAR_7.getId()\n"
] | [
"def param1Simple(op, params, symbols, symId):...\n",
"if params[0] < 0:\n",
"p0 = symbols[params[0]]\n",
"p0 = params[0]\n",
"x = SymbolicInput(symId[0], op, p0, None)\n",
"symbols[symId[0]] = x\n",
"symId[0] -= 1\n",
"return x.getId()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if len(self.nodes) > 0:\n",
"VAR_6 = self.nodes[-1].relation_operation\n",
"VAR_6 = None\n",
"return VAR_6\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if len(self.nodes) > 0:\n",
"rel_op = self.nodes[-1].relation_operation\n",
"rel_op = None\n",
"return rel_op\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11, VAR_16={\n 'orthophoto_area': Envelope(Cast('orthophoto', GeometryField()))})\n",
"VAR_30 = get_tile_json(VAR_28.name, [\n '/api/projects/{}/tasks/{}/tiles/{{z}... | [
"def get(self, request, pk=None, project_pk=None):...\n",
"\"\"\"docstring\"\"\"\n",
"task = self.get_and_check_task(request, pk, project_pk, annotate={\n 'orthophoto_area': Envelope(Cast('orthophoto', GeometryField()))})\n",
"json = get_tile_json(task.name, [\n '/api/projects/{}/tasks/{}/tiles/{{z}}/{{... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_58():...\n",
"VAR_36.execute('rollback')\n"
] | [
"def test():...\n",
"cnxn.execute('rollback')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(self.tables) > 1:\n",
"for VAR_73, VAR_34 in enumerate(self.fields):\n",
"if '.' not in VAR_34:\n",
"self.fields[VAR_73] = '{0}.{1}'.format(self.tables[0], VAR_34)\n"
] | [
"def set_field_tables(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(self.tables) > 1:\n",
"for i, f in enumerate(self.fields):\n",
"if '.' not in f:\n",
"self.fields[i] = '{0}.{1}'.format(self.tables[0], f)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"For",
"Condition",
"Assign'"
] |
[
"def __init__(self):...\n",
"super().__init__()\n",
"self.on_member_join_callbacks = []\n",
"self.on_member_remove_callbacks = []\n"
] | [
"def __init__(self):...\n",
"super().__init__()\n",
"self.on_member_join_callbacks = []\n",
"self.on_member_remove_callbacks = []\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_10(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.c.close()\n",
"logging.error(T('Failed to close database, see log'))\n",
"self.con.close()\n",
"logging.info('Traceback: ', exc_info=True)\n"
] | [
"def close(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.c.close()\n",
"logging.error(T('Failed to close database, see log'))\n",
"self.con.close()\n",
"logging.info('Traceback: ', exc_info=True)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = subprocess.Popen('nmcli -t -f SSID,BARS device wifi list', shell=\n True, stdout=subprocess.PIPE).communicate()[0]\n",
"VAR_9 = VAR_8.split('\\n')\n",
"VAR_10 = []\n",
"for row in VAR_9:\n",
"VAR_20 = row.split(':')\n",
"return VAR_10\n",
... | [
"def get_allAPs():...\n",
"\"\"\"docstring\"\"\"\n",
"ps = subprocess.Popen('nmcli -t -f SSID,BARS device wifi list', shell=True,\n stdout=subprocess.PIPE).communicate()[0]\n",
"wifirows = ps.split('\\n')\n",
"wifi = []\n",
"for row in wifirows:\n",
"entry = row.split(':')\n",
"return wifi\n",
"p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1():...\n",
"\"\"\"docstring\"\"\"\n",
"return [sys.executable, VAR_0, 'run_isolated']\n"
] | [
"def get_run_isolated():...\n",
"\"\"\"docstring\"\"\"\n",
"return [sys.executable, THIS_FILE, 'run_isolated']\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __getitem__(self, VAR_12):...\n",
"return self.content[VAR_12]\n"
] | [
"def __getitem__(self, key):...\n",
"return self.content[key]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"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'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0.debug('Fetching custom grains and pillar details')\n",
"VAR_2 = {}\n",
"salt.modules.config.__opts__ = __opts__\n",
"VAR_3 = __salt__['config.get']('custom_grains_pillar:grains', [])\n",
"for grain in VAR_3:\n",
"for VAR_7 in grain:\n",
"VAR_4 ... | [
"def populate_custom_grains_and_pillar():...\n",
"\"\"\"docstring\"\"\"\n",
"log.debug('Fetching custom grains and pillar details')\n",
"grains = {}\n",
"salt.modules.config.__opts__ = __opts__\n",
"custom_grains = __salt__['config.get']('custom_grains_pillar:grains', [])\n",
"for grain in custom_grains... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
2,
0,
0,
0,
2,
0,
2,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Assign'",
"Condition",
"For",
"Assign'",
"For",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_10(self, VAR_18, **VAR_4):...\n",
"if self.closed:\n",
"self._add_handler(VAR_18, **kwargs)\n"
] | [
"def add_handler(self, handler, **kwargs):...\n",
"if self.closed:\n",
"self._add_handler(handler, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def __str__(self):...\n",
"return Config.get('emph', self.flag)(super(CLASS_6, self).__str__())\n"
] | [
"def __str__(self):...\n",
"return Config.get('emph', self.flag)(super(Emph, self).__str__())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(VAR_9):...\n",
"return VAR_5.search(VAR_9) is not None\n"
] | [
"def contains_wildcard(path):...\n",
"return _wildcard_regex.search(path) is not None\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"return {'Location': self.url}\n"
] | [
"@property...\n",
"return {'Location': self.url}\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_14=errors.USER_DOESNT_EXIST, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_7, VAR_14, *VAR_15, **kw)\n"
] | [
"def __init__(self, param, error=errors.USER_DOESNT_EXIST, *a, **kw):...\n",
"VRequired.__init__(self, param, error, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import logging\n",
"import os\n",
"from builtins import str\n",
"from future.utils import text_type\n",
"from pants.backend.jvm import argfile\n",
"from pants.backend.jvm.subsystems.java import Java\n",
"from pant... | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import logging\n",
"import os\n",
"from builtins import str\n",
"from future.utils import text_type\n",
"from pants.backend.jvm import argfile\n",
"from pants.backend.jvm.subsystems.java import Java\n",
"from pant... | [
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
] | [
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"... |
[
"def FUNC_3(VAR_0=None, VAR_1=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_0 is None:\n",
"VAR_0 = active_view()\n",
"if not get_settings(VAR_0, 'anaconda_go_linting', True):\n",
"return\n",
"if VAR_0.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n",
"anaconda_sublime.erase_lint_marks(VAR_... | [
"def all_linters(view=None, hook=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if view is None:\n",
"view = active_view()\n",
"if not get_settings(view, 'anaconda_go_linting', True):\n",
"return\n",
"if view.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n",
"anaconda_sublime.erase_lint_marks(view)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n"
] | [
"def test_fields(self):...\n",
"self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_4):...\n",
"VAR_4 = u\"'{0}'\".format(VAR_4)\n",
"return VAR_4\n"
] | [
"def insert_format(self, value):...\n",
"value = u\"'{0}'\".format(value)\n",
"return value\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(VAR_2):...\n",
"return render(VAR_2, 'etd_app/copyright.html')\n"
] | [
"def copyright(request):...\n",
"return render(request, 'etd_app/copyright.html')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1=None, VAR_2=False):...\n",
"VAR_3 = None\n",
"if conf.eString and conf.eString in VAR_0:\n",
"VAR_4 = VAR_0.index(conf.eString)\n",
"if conf.eRegexp:\n",
"VAR_5 = len(conf.eString)\n",
"VAR_3 = re.findall(conf.eRegexp, VAR_0, re.I | re.M)\n",
"if conf.string:\n",
"VAR_6 = VA... | [
"def comparison(page, headers=None, getSeqMatcher=False):...\n",
"regExpResults = None\n",
"if conf.eString and conf.eString in page:\n",
"index = page.index(conf.eString)\n",
"if conf.eRegexp:\n",
"length = len(conf.eString)\n",
"regExpResults = re.findall(conf.eRegexp, page, re.I | re.M)\n",
"if con... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"AugAssign'",
"For",
"Return'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Return'",
"Condition",
... |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import argparse\n",
"import ast\n",
"import io\n",
"import os\n",
"import sys\n",
"import threading\n",
"import random\n",
"import time\n",
"from cms import conf... | [
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import argparse\n",
"import ast\n",
"import io\n",
"import os\n",
"import sys\n",
"import threading\n",
"import random\n",
"import time\n",
"from cms import conf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
5,
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,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",... |
[
"@VAR_2.route('/')...\n",
"return FUNC_19('index.html')\n"
] | [
"@app.route('/')...\n",
"return template('index.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@VAR_1.route('/demo2', methods=['GET', 'POST'])...\n",
"VAR_9 = FUNC_14(1)\n",
"VAR_10 = [[VAR_3[0], VAR_3[1], VAR_3[2]] for VAR_3 in VAR_9]\n",
"return render_template('demo2.html', VAR_8=query1, rows=results)\n"
] | [
"@app.route('/demo2', methods=['GET', 'POST'])...\n",
"z = demo(1)\n",
"results = [[x[0], x[1], x[2]] for x in z]\n",
"return render_template('demo2.html', query=query1, rows=results)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = {}\n",
"for idx, VAR_71 in enumerate(VAR_2.description):\n",
"VAR_29[VAR_71[0]] = VAR_3[idx]\n",
"return VAR_29\n"
] | [
"def dict_factory(cursor, row):...\n",
"\"\"\"docstring\"\"\"\n",
"d = {}\n",
"for idx, col in enumerate(cursor.description):\n",
"d[col[0]] = row[idx]\n",
"return d\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_38(self):...\n",
"self.compilation_ko(\"\"\"\nrequire [\"fileinto\"]\n\"\"\")\n"
] | [
"def test_missing_semicolon(self):...\n",
"self.compilation_ko(\"\"\"\nrequire [\"fileinto\"]\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = self._eql_execute('volume', 'select', VAR_18['volume_name'],\n 'snapshot', 'create-now')\n",
"VAR_0.error(_('Failed to create snapshot of volume %s'), VAR_18['volume_name'])\n",
"VAR_9 = 'Snapshot name is '\n",
"VAR_45 = self._get_... | [
"def create_snapshot(self, snapshot):...\n",
"\"\"\"docstring\"\"\"\n",
"out = self._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'create-now')\n",
"LOG.error(_('Failed to create snapshot of volume %s'), snapshot['volume_name'])\n",
"prefix = 'Snapshot name is '\n",
"snap_name... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(VAR_2, VAR_5='/tmp/source.html'):...\n",
"out.write(VAR_2.browser.page_source.encode('utf8'))\n"
] | [
"def save_source(context, filename='/tmp/source.html'):...\n",
"out.write(context.browser.page_source.encode('utf8'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_4(VAR_1, VAR_5, VAR_6='', VAR_3='', VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16[VAR_17(VAR_1.name)] = VAR_5, VAR_6\n",
"if current_user.is_authenticated():\n",
"VAR_23 = current_user.get_id()\n",
"return None\n",
"VAR_24 = VAR_1.consumer_key\n",
"VAR_25 = RemoteToken.get(VAR_23, V... | [
"def token_setter(remote, token, secret='', token_type='', extra_data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"session[token_session_key(remote.name)] = token, secret\n",
"if current_user.is_authenticated():\n",
"uid = current_user.get_id()\n",
"return None\n",
"cid = remote.consumer_key\n",
"t = Rem... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/visualize')...\n",
"return render_template('visualization.html')\n"
] | [
"@app.route('/visualize')...\n",
"return render_template('visualization.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_17(VAR_6):...\n",
"return FUNC_7(VAR_6, 'X-XSS-Protection', '1; mode=block')\n"
] | [
"def validate_xss_protection(page):...\n",
"return validate_security_header(page, 'X-XSS-Protection', '1; mode=block')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = text(str(VAR_3))\n",
"VAR_2.execute(VAR_4)\n",
"VAR_2.commit()\n"
] | [
"def insert_into_mysql_command(command_str):...\n",
"\"\"\"docstring\"\"\"\n",
"sql = text(str(command_str))\n",
"s.execute(sql)\n",
"s.commit()\n"
] | [
0,
0,
0,
2,
2
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"self.compilation_ok(\n \"\"\"\nif header :contains \"Cc\" \"/* comment */\" {\n discard;\n}\n\"\"\")\n",
"self.representation_is('string')\n"
] | [
"def test_string_with_bracket_comment(self):...\n",
"self.compilation_ok(\n \"\"\"\nif header :contains \"Cc\" \"/* comment */\" {\n discard;\n}\n\"\"\")\n",
"self.representation_is(\n \"\"\"\nif (type: control)\n header (type: test)\n :contains\n \"Cc\"\n \"/* comment */\"\n ... | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"import sys, os, time, shodan\n",
"from pathlib import Path\n",
"from scapy.all import *\n",
"from contextlib import contextmanager, redirect_stdout\n",
"VAR_0 = time.time()\n",
"@contextmanager...\n",
"yield\n",
"VAR_3 = '\\x1b[0m'\n",
"VAR_1 = Path('./api.txt')\n",
"VAR_2 = CLASS_0.HEADER + 'str... | [
"import sys, os, time, shodan\n",
"from pathlib import Path\n",
"from scapy.all import *\n",
"from contextlib import contextmanager, redirect_stdout\n",
"starttime = time.time()\n",
"@contextmanager...\n",
"yield\n",
"HEADER = '\\x1b[0m'\n",
"keys = Path('./api.txt')\n",
"logo = color.HEADER + \"\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
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,
2,
0,
0,
0,
0,
0... | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
... |
[
"def FUNC_17(self, VAR_17, **VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_2, self).redirect(str(VAR_17), **kwargs)\n"
] | [
"def redirect(self, url, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"super(Handler, self).redirect(str(url), **kwargs)\n"
] | [
0,
0,
3
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_17(self):...\n",
"self.base.wait()\n"
] | [
"def wait(self):...\n",
"self.base.wait()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"VAR_14 = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n",
"VAR_14.url_post('1/connections', jsonutils.dumps({'name': 'conn1'}))\n",
"FUNC_1('post', VAR_14, 'https://1.2.3.4/api/v1/ports/1/connections', VAR_8=\n jsonutils.dumps({'name': 'conn1'}))\n"
] | [
"def test_client_url_post(self):...\n",
"api = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n",
"api.url_post('1/connections', jsonutils.dumps({'name': 'conn1'}))\n",
"assert_call('post', api, 'https://1.2.3.4/api/v1/ports/1/connections', data\n =jsonutils.dumps({'name': 'conn1'}))\... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_20(self):...\n",
""
] | [
"def _convert_to_entity(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_8(self):...\n",
"self._cookie_jar.clear()\n"
] | [
"def clear_cookies(self):...\n",
"self._cookie_jar.clear()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19, VAR_20 = eigh(VAR_1)\n",
"VAR_21 = []\n",
"for k in range(2):\n",
"VAR_35 = VAR_20[:, (k)]\n",
"return VAR_19, VAR_21\n",
"VAR_21.append(np.outer(VAR_35.conj(), VAR_35))\n"
] | [
"def spectral_decomposition_qubit(A):...\n",
"\"\"\"docstring\"\"\"\n",
"d, v = eigh(A)\n",
"P = []\n",
"for k in range(2):\n",
"temp = v[:, (k)]\n",
"return d, P\n",
"P.append(np.outer(temp.conj(), temp))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_1, VAR_4):...\n",
""
] | [
"def run(self, args, headers):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.