lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"@data((' ', ''), ('test', 'test'), ('testé', 'teste'))...\n",
"VAR_12 = clean_title(VAR_1)\n",
"self.assertEqual(VAR_2, VAR_12)\n"
] | [
"@data((' ', ''), ('test', 'test'), ('testé', 'teste'))...\n",
"output_string = clean_title(input_string)\n",
"self.assertEqual(desired_string, output_string)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = 'DELETE FROM crimes;'\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"VAR_2.commit()\n"
] | [
"def clear_all(self):...\n",
"connection = self.connect()\n",
"query = 'DELETE FROM crimes;'\n",
"connection.close()\n",
"cursor.execute(query)\n",
"connection.commit()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_35 = VAR_14.get_entries_query(**kwargs)\n",
"if isinstance(VAR_25, list):\n",
"VAR_35 = VAR_35.where(lambda g: g.metadata_type in VAR_25)\n",
"VAR_35 = VAR_35.where(VAR_25=metadata_type)\n",
"if VAR_27:\n",
"VAR_35 = VAR_35.where(lambda g: g.status ... | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"pony_query = cls.get_entries_query(**kwargs)\n",
"if isinstance(metadata_type, list):\n",
"pony_query = pony_query.where(lambda g: g.metadata_type in metadata_type)\n",
"pony_query = pony_query.where(metadata_type=metadata_type)\n",
"if exclude_deleted:\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"self.mock(bot_main, 'post_error_task', lambda *VAR_24: self.fail(VAR_24))\n",
"def FUNC_24(VAR_14, VAR_23, *VAR_24):...\n",
"if VAR_23 == 'on_after_task':\n",
"VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n",
"self.mock(bot_main, 'call_hook', FUNC_24)\n",
"self.assertEqual(self.att... | [
"def test_run_manifest(self):...\n",
"self.mock(bot_main, 'post_error_task', lambda *args: self.fail(args))\n",
"def call_hook(botobj, name, *args):...\n",
"if name == 'on_after_task':\n",
"failure, internal_failure, dimensions, summary = args\n",
"self.mock(bot_main, 'call_hook', call_hook)\n",
"self.a... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = 0\n",
"VAR_6 = 0\n",
"for action_group in VAR_2._action_groups:\n",
"for VAR_3 in action_group._group_actions:\n",
"return VAR_6 >= VAR_5\n",
"if not VAR_3.option_strings:\n",
"VAR_11 = getattr(VAR_1, VAR_3.dest, [])\n",
"... | [
"def consumed(self, parsed, parser):...\n",
"\"\"\"docstring\"\"\"\n",
"maximum = 0\n",
"actual = 0\n",
"for action_group in parser._action_groups:\n",
"for action in action_group._group_actions:\n",
"return actual >= maximum\n",
"if not action.option_strings:\n",
"values = getattr(parsed, action.de... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Assign'"
] |
[
"@jwt_required...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = f'update spaces set space_id = %s, building_id = %s, '\n",
"VAR_5 += f'name = %s, capacity = %s, features = %s '\n",
"VAR_5 += f\"where space_id = '{VAR_1}'\"\n",
"VAR_7 = request.get_json()\n",
"VAR_6 = VAR_7['space_id'], VAR_7['building_id'], V... | [
"@jwt_required...\n",
"\"\"\"docstring\"\"\"\n",
"query = f'update spaces set space_id = %s, building_id = %s, '\n",
"query += f'name = %s, capacity = %s, features = %s '\n",
"query += f\"where space_id = '{space_id}'\"\n",
"json_data = request.get_json()\n",
"parameters = json_data['space_id'], json_da... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"AugAssign'",
"AugAssign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@app.route('/json/politicians/state/<state>')...\n",
"VAR_9 = Politician.all()\n",
"VAR_9.filter('state =', VAR_3.lower())\n",
"VAR_9.order('-search_count')\n",
"VAR_7 = []\n",
"for pol in VAR_9:\n",
"VAR_2 = {'name': pol.name, 'party': pol.party, 'state': pol.state,\n 'constituency': pol.constituen... | [
"@app.route('/json/politicians/state/<state>')...\n",
"pols = Politician.all()\n",
"pols.filter('state =', state.lower())\n",
"pols.order('-search_count')\n",
"politicians = []\n",
"for pol in pols:\n",
"politician = {'name': pol.name, 'party': pol.party, 'state': pol.state,\n 'constituency': pol.con... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_2():...\n",
"print('[*] Starting backdoor process')\n",
"print('[*] Decompressing target to tmp directory...')\n",
"zip.extractall('tmp')\n",
"print('[*] Target dumped to tmp directory')\n",
"print('[*] Modifying manifest file...')\n",
"VAR_9 = ''\n",
"VAR_10 = open('tmp/META-INF/MANIFEST.MF... | [
"def start():...\n",
"print('[*] Starting backdoor process')\n",
"print('[*] Decompressing target to tmp directory...')\n",
"zip.extractall('tmp')\n",
"print('[*] Target dumped to tmp directory')\n",
"print('[*] Modifying manifest file...')\n",
"oldmain = ''\n",
"man = open('tmp/META-INF/MANIFEST.MF',... | [
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"... |
[
"def FUNC_10(self):...\n",
"VAR_7 = '200'\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name, 'size': 100}\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'size', '%sG' %\n VAR_7)\n",
"self.mox.ReplayAll()\n",
"self.dr... | [
"def test_extend_volume(self):...\n",
"new_size = '200'\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name, 'size': 100}\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'size', '%sG' %\n new_size)\n",
"self.mox.ReplayA... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_7=None, VAR_8=None, VAR_4=None, VAR_9=None, VAR_10=...\n",
"if not VAR_18 and not frappe.has_permission(self.doctype, 'read', VAR_19=user):\n",
"frappe.flags.error_message = _('Insufficient Permission for {0}').format(frappe\n .bold(self.doctype))\n",
"if isinstance(VAR_8, dict) or is... | [
"def execute(self, query=None, fields=None, filters=None, or_filters=None,...\n",
"if not ignore_permissions and not frappe.has_permission(self.doctype,\n",
"frappe.flags.error_message = _('Insufficient Permission for {0}').format(frappe\n .bold(self.doctype))\n",
"if isinstance(fields, dict) or isinstance... | [
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
] | [
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"... |
[
"def FUNC_2(VAR_3):...\n",
"return VAR_3 if VAR_3 and VAR_4.match(VAR_3) else None\n"
] | [
"def chkpass(x):...\n",
"return x if x and pass_rx.match(x) else None\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"CLASS_2.ScenarioMaker().given_an_experience_on_db(VAR_0='a', VAR_1='d',\n VAR_2='AsdE43E4', VAR_3='url').given_a_public_domain('http://pachatary.com'\n ).given_a_dynamic_link('http://dynamic.link/link={}&other=param'\n ).when_call_experience_redirect('AsdE43E4'\n ).then_resp... | [
"def test_when_there_is_a_dynamic_link_wraps_public_domain_url(self):...\n",
"RedirectExperienceTestCase.ScenarioMaker().given_an_experience_on_db(title=\n 'a', description='d', share_id='AsdE43E4', pic='url'\n ).given_a_public_domain('http://pachatary.com').given_a_dynamic_link(\n 'http://dynamic.link/l... | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = VAR_2\n"
] | [
"def set_log_handler(handler):...\n",
"\"\"\"docstring\"\"\"\n",
"_handler = handler\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_4(self, VAR_11='', VAR_12=None, VAR_13=None, VAR_6=None):...\n",
"VAR_5 = self.session.query(self.obj)\n",
"VAR_5 = self._get_base_query(VAR_5=query, VAR_6=filters)\n",
"VAR_25 = VAR_5.all()\n",
"VAR_26 = GroupByCol(VAR_11, 'Group by')\n",
"return VAR_26.apply(VAR_25)\n"
] | [
"def query_simple_group(self, group_by='', aggregate_func=None,...\n",
"query = self.session.query(self.obj)\n",
"query = self._get_base_query(query=query, filters=filters)\n",
"query_result = query.all()\n",
"group = GroupByCol(group_by, 'Group by')\n",
"return group.apply(query_result)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"print(' Unpacking %s...' % VAR_1)\n",
"os.system('tar xf ' + VAR_1)\n",
"VAR_17 = VAR_1.split('.tar')[0]\n",
"print(' Installing %s...' % VAR_17)\n",
"VAR_18 = '--prefix=${PWD}/%s --disable-ldconfig' % VAR_2\n",
"os.system('%s/install.sh %s... | [
"def install(filename, target):...\n",
"\"\"\"docstring\"\"\"\n",
"print(' Unpacking %s...' % filename)\n",
"os.system('tar xf ' + filename)\n",
"basename = filename.split('.tar')[0]\n",
"print(' Installing %s...' % basename)\n",
"install_opts = '--prefix=${PWD}/%s --disable-ldconfig' % target\n",
"os... | [
0,
0,
0,
2,
0,
0,
2,
2,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(self, VAR_3):...\n",
"if VAR_3.name in self.host_names:\n",
"self.hosts.remove(VAR_3)\n",
"self._hosts.remove(VAR_3.name)\n",
"VAR_3.remove_group(self)\n",
"self.clear_hosts_cache()\n"
] | [
"def remove_host(self, host):...\n",
"if host.name in self.host_names:\n",
"self.hosts.remove(host)\n",
"self._hosts.remove(host.name)\n",
"host.remove_group(self)\n",
"self.clear_hosts_cache()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"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'"
] |
[
"@app.route('/achievements/<achievement_id>/increment', methods=['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = int(request.form.get('player_id'))\n",
"VAR_3 = int(request.form.get('steps', 1))\n",
"return flask.jsonify(FUNC_8(VAR_1, VAR_2, VAR_3))\n"
] | [
"@app.route('/achievements/<achievement_id>/increment', methods=['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"player_id = int(request.form.get('player_id'))\n",
"steps = int(request.form.get('steps', 1))\n",
"return flask.jsonify(increment_achievement(achievement_id, player_id, steps))\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self, VAR_0):...\n",
"return VAR_0.imageupload_set.count()\n"
] | [
"def get_images_count(self, obj):...\n",
"return obj.imageupload_set.count()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@wraps(VAR_7)...\n",
"if VAR_12:\n",
"return VAR_7(VAR_8[0], VAR_1, *VAR_8[1:], **kwargs)\n",
"return VAR_7(VAR_1, *VAR_8, **kwargs)\n"
] | [
"@wraps(f)...\n",
"if with_response:\n",
"return f(args[0], remote, *args[1:], **kwargs)\n",
"return f(remote, *args, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self, VAR_22):...\n",
"return VAR_22.strftime('%a %d %b %Y %H:%M:%S %Z')\n"
] | [
"def _format_date(self, dt):...\n",
"return dt.strftime('%a %d %b %Y %H:%M:%S %Z')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_41(self, VAR_27, VAR_28):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_49 = []\n",
"for VAR_25 in VAR_28:\n",
"if VAR_25.permlevel not in VAR_27 and VAR_25.fieldtype not in display_fieldtypes:\n",
"if VAR_49:\n",
"VAR_49.append(VAR_25)\n",
"if self.is_new():\n",
"VAR_70 = VAR_54.new_doc(self.doc... | [
"def reset_values_if_no_permlevel_access(self, has_access_to,...\n",
"\"\"\"docstring\"\"\"\n",
"to_reset = []\n",
"for df in high_permlevel_fields:\n",
"if df.permlevel not in has_access_to and df.fieldtype not in display_fieldtypes:\n",
"if to_reset:\n",
"to_reset.append(df)\n",
"if self.is_new():\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Condition",
"For",
"Expr'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"VAR_0 = 'pos.close.statement'\n",
"VAR_1 = 'Close Statements'\n",
"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 = []\... | [
"from osv import osv\n",
"from tools.translate import _\n",
"_name = 'pos.close.statement'\n",
"_description = 'Close Statements'\n",
"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",
"li... | [
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
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Conditi... |
[
"def FUNC_6(self):...\n",
"self.assertTrue({'name': 'DocField'} in DatabaseQuery('DocType').execute(\n filters={'name': 'DocField'}))\n"
] | [
"def test_filters_4(self):...\n",
"self.assertTrue({'name': 'DocField'} in DatabaseQuery('DocType').execute(\n filters={'name': 'DocField'}))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_16(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.parser.parse_args(['--edit-player'])\n"
] | [
"def test_arg_edit_player(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.parser.parse_args(['--edit-player'])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_12(VAR_11):...\n",
"if VAR_11:\n",
"return True\n",
"return False\n"
] | [
"def validate_hsts_entire_domain(pshtt_result):...\n",
"if pshtt_result:\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"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'"
] |
[
"@data((' ', ''), ('\\n 2019-02-20\\n', '2019-02-20'), ('2019-02-20',...\n",
"VAR_12 = clean_pub_date(VAR_1)\n",
"self.assertEqual(VAR_2, VAR_12)\n"
] | [
"@data((' ', ''), ('\\n 2019-02-20\\n', '2019-02-20'), ('2019-02-20',...\n",
"output_string = clean_pub_date(input_string)\n",
"self.assertEqual(desired_string, output_string)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_3, VAR_4=True):...\n",
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def dynamic_branch(self, wildcards, input=True):...\n",
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Return'"
] |
[
"import logging\n",
"import os\n",
"import sys\n",
"import threading\n",
"VAR_0 = os.path.dirname(os.path.abspath(__file__))\n",
"VAR_1 = os.path.dirname(VAR_0)\n",
"sys.path.insert(0, VAR_1)\n",
"sys.path.insert(0, os.path.join(VAR_1, 'third_party'))\n",
"from depot_tools import auto_stub\n",
"fr... | [
"import logging\n",
"import os\n",
"import sys\n",
"import threading\n",
"TEST_DIR = os.path.dirname(os.path.abspath(__file__))\n",
"ROOT_DIR = os.path.dirname(TEST_DIR)\n",
"sys.path.insert(0, ROOT_DIR)\n",
"sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party'))\n",
"from depot_tools import auto... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Assign'",
"Ret... |
[
"def FUNC_9(VAR_26):...\n",
"VAR_26 = self.format_command_name(VAR_26)\n",
"VAR_26 = f'• {VAR_26}'\n",
"return VAR_26\n"
] | [
"def sub_cmd_map(c):...\n",
"c = self.format_command_name(c)\n",
"c = f'• {c}'\n",
"return c\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_43(VAR_127, VAR_96):...\n",
"for VAR_121 in VAR_127['events']:\n",
"if all([(match in VAR_121) for match in VAR_96]):\n",
"return None\n",
"return VAR_121\n"
] | [
"def get_event(events, matches):...\n",
"for e in events['events']:\n",
"if all([(match in e) for match in matches]):\n",
"return None\n",
"return e\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"For",
"Return'",
"Return'"
] |
[
"def FUNC_22(self, VAR_38):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_38:\n",
"return\n",
"VAR_57 = VAR_38.lower()\n",
"if 'select' in VAR_57 and ' from ' in VAR_57:\n",
"frappe.throw(_('Cannot use sub-query in order by'))\n",
"for field in VAR_38.split(','):\n",
"if '.' in field and field.strip... | [
"def validate_order_by_and_group_by(self, parameters):...\n",
"\"\"\"docstring\"\"\"\n",
"if not parameters:\n",
"return\n",
"_lower = parameters.lower()\n",
"if 'select' in _lower and ' from ' in _lower:\n",
"frappe.throw(_('Cannot use sub-query in order by'))\n",
"for field in parameters.split(','):... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"For",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"self.assertFalse(self.past_course_instance.is_open())\n",
"self.assertTrue(self.current_course_instance.is_open())\n",
"self.assertFalse(self.future_course_instance.is_open())\n"
] | [
"def test_course_instance_open(self):...\n",
"self.assertFalse(self.past_course_instance.is_open())\n",
"self.assertTrue(self.current_course_instance.is_open())\n",
"self.assertFalse(self.future_course_instance.is_open())\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0=None):...\n",
"VAR_1 = frappe.db.sql_list('select name from `tabLeave Type` order by name asc'\n )\n",
"VAR_3 = FUNC_1(VAR_1)\n",
"VAR_4 = FUNC_2(VAR_0, VAR_1)\n",
"return VAR_3, VAR_4\n"
] | [
"def execute(filters=None):...\n",
"leave_types = frappe.db.sql_list(\n 'select name from `tabLeave Type` order by name asc')\n",
"columns = get_columns(leave_types)\n",
"data = get_data(filters, leave_types)\n",
"return columns, data\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/article/<main_article_id>')...\n",
"VAR_8 = FUNC_3(VAR_4)\n",
"VAR_9 = VAR_18.docvecs.most_similar(int(VAR_4), topn=10)\n",
"VAR_10 = FUNC_1([int(VAR_3) for VAR_3, sim in VAR_9])\n",
"VAR_11 = []\n",
"for VAR_20 in VAR_10:\n",
"VAR_21 = [score for idx, score in VAR_9 if VAR_20['index'] =... | [
"@application.route('/article/<main_article_id>')...\n",
"main_article = get_article(main_article_id)\n",
"sims = model.docvecs.most_similar(int(main_article_id), topn=10)\n",
"sim_articles = get_articles([int(index) for index, sim in sims])\n",
"sort_these = []\n",
"for article in sim_articles:\n",
"si... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'",
"Expr'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"VAR_0 = 'pos.close.statement'\n",
"VAR_1 = 'Close Statements'\n",
"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 = []\... | [
"from osv import osv\n",
"from tools.translate import _\n",
"_name = 'pos.close.statement'\n",
"_description = 'Close Statements'\n",
"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",
"li... | [
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
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Conditi... |
[
"def FUNC_4(VAR_3):...\n",
""
] | [
"def read_config_from_host(url):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@classmethod...\n",
"super(CLASS_0.Factory, VAR_4).register_options(VAR_16)\n",
"VAR_16('--supportdir', advanced=True, default='bin/node', help=\n 'Find the Node distributions under this dir. Used as part of the path to lookup the distribution with --binary-util-baseurls and --pants-bootstrapdir'\n )\n"... | [
"@classmethod...\n",
"super(NodeDistribution.Factory, cls).register_options(register)\n",
"register('--supportdir', advanced=True, default='bin/node', help=\n 'Find the Node distributions under this dir. Used as part of the path to lookup the distribution with --binary-util-baseurls and --pants-bootstrapdir... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_10(VAR_28, VAR_25, VAR_24):...\n",
"VAR_31 = True\n",
"VAR_32 = 0\n",
"VAR_30 = 0\n",
"VAR_33 = 0\n",
"VAR_34 = None\n",
"for VAR_27 in VAR_24:\n",
"if VAR_27['submittable']:\n",
"if VAR_34 and VAR_30 > 0:\n",
"if VAR_27['confirm_the_level']:\n",
"VAR_31 = FUNC_10(VAR_28, VAR_27, VAR_2... | [
"def r_collect(module, parent, children):...\n",
"passed = True\n",
"max_points = 0\n",
"submissions = 0\n",
"points = 0\n",
"confirm_entry = None\n",
"for entry in children:\n",
"if entry['submittable']:\n",
"if confirm_entry and submissions > 0:\n",
"if entry['confirm_the_level']:\n",
"passed ... | [
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'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"AugAssign'",
"Assign'",
"AugAssign'",
"Assign'",
"Condition",
"AugAssign'",... |
[
"@login_required...\n",
"from .forms import CommitteeMemberPersonForm, CommitteeMemberForm\n",
"VAR_15 = FUNC_8(VAR_3=candidate_id, VAR_2=request)\n",
"return HttpResponseRedirect(reverse('register'))\n",
"if VAR_15.thesis.is_locked():\n",
"return HttpResponseForbidden('Thesis has already been submitted a... | [
"@login_required...\n",
"from .forms import CommitteeMemberPersonForm, CommitteeMemberForm\n",
"candidate = _get_candidate(candidate_id=candidate_id, request=request)\n",
"return HttpResponseRedirect(reverse('register'))\n",
"if candidate.thesis.is_locked():\n",
"return HttpResponseForbidden('Thesis has a... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"ImportFrom'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self, VAR_5):...\n",
"VAR_14 = 'string'.format(VAR_5)\n",
"self.cur.execute(VAR_14)\n",
"return self.cur.fetchall()\n"
] | [
"def get_roster(self, server_id):...\n",
"sql = (\n \"\"\"SELECT username, role\n FROM roles\n WHERE roles.server_id = {0};\n \"\"\"\n .format(server_id))\n",
"self.cur.execute(sql)\n",
"return self.cur.fetchall()\n"
] | [
0,
4,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.project:\n",
"return ''\n",
"return os.path.join(self.project.results_path, '.cache', 'steps', '{}.json'\n .format(self.id))\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.project:\n",
"return ''\n",
"return os.path.join(self.project.results_path, '.cache', 'steps', '{}.json'\n .format(self.id))\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_9(VAR_1, VAR_2, VAR_3):...\n",
"VAR_4 = lambda VAR_16, new_steps: max(VAR_16, new_steps)\n",
"return FUNC_10(VAR_1, VAR_2, VAR_3, VAR_4)\n"
] | [
"def set_steps_at_least(achievement_id, player_id, steps):...\n",
"steps_function = lambda current_steps, new_steps: max(current_steps, new_steps)\n",
"return update_steps(achievement_id, player_id, steps, steps_function)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"return database_utilities.execute_query(\n f\"select * from admins where email = '{VAR_1}'\")\n"
] | [
"def get(self, email):...\n",
"\"\"\"docstring\"\"\"\n",
"return database_utilities.execute_query(\n f\"select * from admins where email = '{email}'\")\n"
] | [
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@VAR_0.route('/')...\n",
"VAR_8 = VAR_3.connection\n",
"VAR_9 = VAR_8.cursor()\n",
"VAR_9.execute(\n 'SELECT subject_id, subject_name FROM subjects WHERE 1 ORDER BY subject_id ASC'\n )\n",
"VAR_10 = VAR_9.fetchall()\n",
"return render_template('home.html', subjects=rv)\n"
] | [
"@app.route('/')...\n",
"conn = mysql.connection\n",
"cur = conn.cursor()\n",
"cur.execute(\n 'SELECT subject_id, subject_name FROM subjects WHERE 1 ORDER BY subject_id ASC'\n )\n",
"rv = cur.fetchall()\n",
"return render_template('home.html', subjects=rv)\n"
] | [
0,
4,
4,
4,
4,
4
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_24(self):...\n",
"self.assertEqual(448, os.stat(f.name)[0] & 511)\n",
"self.assertEqual(420, os.stat(path)[0] & 511)\n"
] | [
"def test_permissions(self):...\n",
"self.assertEqual(448, os.stat(f.name)[0] & 511)\n",
"self.assertEqual(420, os.stat(path)[0] & 511)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_15, VAR_16, VAR_17):...\n",
"self.checked += 1\n",
"self.curline = 0\n",
"for VAR_25 in VAR_15:\n",
"if pe.tok:\n",
"VAR_25 = VAR_25.decode(locale.getpreferredencoding(False), errors='ignore')\n",
"VAR_27 = VAR_25.find(VAR_14) + pe.tok.lexpos\n",
"sys.stdout.write('%s: %d:0 %s\\... | [
"def parse_lines(self, fd, maxlines, fname):...\n",
"self.checked += 1\n",
"self.curline = 0\n",
"for line in fd:\n",
"if pe.tok:\n",
"line = line.decode(locale.getpreferredencoding(False), errors='ignore')\n",
"col = line.find(expr) + pe.tok.lexpos\n",
"sys.stdout.write('%s: %d:0 %s\\n' % (fname, sel... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"AugAssign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"AugAssign'",
"Assign'",
"AugAssign'",
"Condition",
"Expr'",
"AugAssign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"AugAssign'"
] |
[
"def __init__(self, VAR_6, VAR_7=None):...\n",
"if VAR_7 is not None:\n",
"self._r_root_item_ = VAR_7._r_root_item_\n",
"self._r_root_item_ = VAR_6\n",
"self._r_steps_ = list(VAR_7._r_steps_)\n",
"self._r_steps_ = []\n"
] | [
"def __init__(self, initial_item, path_to_clone=None):...\n",
"if path_to_clone is not None:\n",
"self._r_root_item_ = path_to_clone._r_root_item_\n",
"self._r_root_item_ = initial_item\n",
"self._r_steps_ = list(path_to_clone._r_steps_)\n",
"self._r_steps_ = []\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@api.public...\n",
"FUNC_31(self, 'PUT')\n"
] | [
"@api.public...\n",
"record(self, 'PUT')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"@require_http_methods(['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = BadRequestRateLimiter()\n",
"if VAR_16.is_rate_limit_exceeded(VAR_3):\n",
"VAR_0.warning('Password reset rate limit exceeded')\n",
"VAR_10 = VAR_3.user\n",
"return HttpResponseForbidden()\n",
"VAR_17 = VAR_10.email if VAR_10.... | [
"@require_http_methods(['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"limiter = BadRequestRateLimiter()\n",
"if limiter.is_rate_limit_exceeded(request):\n",
"AUDIT_LOG.warning('Password reset rate limit exceeded')\n",
"user = request.user\n",
"return HttpResponseForbidden()\n",
"email = user.email if us... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@route('GET', '/-test/jquery.js', VAR_1=website)...\n",
"get_current_http_response().set_header('Content-Type',\n 'text/javascript; charset=utf-8')\n",
"return (as_path(__file__).dirname() / 'jquery.js').text()\n"
] | [
"@route('GET', '/-test/jquery.js', website=website)...\n",
"get_current_http_response().set_header('Content-Type',\n 'text/javascript; charset=utf-8')\n",
"return (as_path(__file__).dirname() / 'jquery.js').text()\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_1(VAR_0, VAR_1, VAR_2):...\n",
"VAR_5 = {'help': customer_commands.process_help, 'id': customer_commands.\n process_id, 'purchase': customer_commands.process_purchase, 'brand':\n customer_commands.process_brand, 'itemtype': customer_commands.\n process_type, 'userinfo': customer_commands.proces... | [
"def handle_query(tokens, id, query):...\n",
"commands = {'help': customer_commands.process_help, 'id': customer_commands\n .process_id, 'purchase': customer_commands.process_purchase, 'brand':\n customer_commands.process_brand, 'itemtype': customer_commands.\n process_type, 'userinfo': customer_commands... | [
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"Test creating a Push via the API\"\"\"\n",
"self.client.login(VAR_8='autotest2', VAR_9='password')\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
... | [
"def test_admin_can_hook(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"Test creating a Push via the API\"\"\"\n",
"self.client.login(username='autotest2', password='password')\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = ... | [
0,
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_18._check_executable(VAR_0):\n",
"if VAR_19 is None:\n",
"return repr(VAR_0) + ' is not installed.'\n",
"return True\n",
"check_call(VAR_19, stdout=DEVNULL, stderr=DEVNULL)\n",
"return VAR_20\n",
"return True\n"
] | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if cls._check_executable(executable):\n",
"if command is None:\n",
"return repr(executable) + ' is not installed.'\n",
"return True\n",
"check_call(command, stdout=DEVNULL, stderr=DEVNULL)\n",
"return fail_msg\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Condition",
"Return'",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_9(self, VAR_12, VAR_13=True):...\n",
"VAR_6 = 'DROP TABLE IF EXISTS %s' % VAR_12\n",
"if VAR_13:\n",
"VAR_6 += ' CASCADE'\n",
"VAR_6 += ';'\n",
"return VAR_6\n"
] | [
"def delete_table(self, table_name, cascade=True):...\n",
"operation = 'DROP TABLE IF EXISTS %s' % table_name\n",
"if cascade:\n",
"operation += ' CASCADE'\n",
"operation += ';'\n",
"return operation\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"AugAssign'",
"AugAssign'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.edges:\n",
"return sum(self.edges.values())\n",
"return _np.array([0, 0])\n"
] | [
"def totalEdgeWeight(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.edges:\n",
"return sum(self.edges.values())\n",
"return _np.array([0, 0])\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(self, VAR_47):...\n",
"if VAR_101.user_is_admin:\n",
"return True\n",
"if VAR_101.user_is_loggedin:\n",
"VAR_18 = Thing._by_fullname(VAR_47, data=True)\n",
"abort(403, 'forbidden')\n",
"VAR_109 = VAR_18.subreddit_slow\n",
"if VAR_109.is_special(VAR_101.user):\n",
"return True\n"
] | [
"def run(self, thing_name):...\n",
"if c.user_is_admin:\n",
"return True\n",
"if c.user_is_loggedin:\n",
"item = Thing._by_fullname(thing_name, data=True)\n",
"abort(403, 'forbidden')\n",
"subreddit = item.subreddit_slow\n",
"if subreddit.is_special(c.user):\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"\"\"\" Views for a student's account information. \"\"\"\n",
"import json\n",
"import logging\n",
"import urlparse\n",
"from datetime import datetime\n",
"import pytz\n",
"from django.conf import settings\n",
"from django.contrib import messages\n",
"from django.contrib.auth import get_user_model\n... | [
"\"\"\" Views for a student's account information. \"\"\"\n",
"import json\n",
"import logging\n",
"import urlparse\n",
"from datetime import datetime\n",
"import pytz\n",
"from django.conf import settings\n",
"from django.contrib import messages\n",
"from django.contrib.auth import get_user_model\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... | [
"Expr'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"I... |
[
"def FUNC_10(self, VAR_10, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"self._create_server(VAR_12)\n",
"VAR_5 = {}\n",
"VAR_5['volumeName'] = VAR_10['name']\n",
"VAR_5['serverName'] = VAR_12['host']\n",
"self._cliq_run_xml('assignVolumeToServer', VAR_5)\n",
"VAR_32 = self._get_iscsi_properties(VAR_10)... | [
"def initialize_connection(self, volume, connector):...\n",
"\"\"\"docstring\"\"\"\n",
"self._create_server(connector)\n",
"cliq_args = {}\n",
"cliq_args['volumeName'] = volume['name']\n",
"cliq_args['serverName'] = connector['host']\n",
"self._cliq_run_xml('assignVolumeToServer', cliq_args)\n",
"iscs... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.getAdjacencyMatrix().count_nonzero()\n"
] | [
"def modelSize(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.getAdjacencyMatrix().count_nonzero()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_21(self, VAR_2, VAR_3, VAR_7, *VAR_5):...\n",
"self.write_data({'type': 'credit_mining_error', 'event': VAR_5[0]})\n"
] | [
"def on_credit_minig_error(self, subject, changetype, ojbectID, *args):...\n",
"self.write_data({'type': 'credit_mining_error', 'event': args[0]})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_6=None, VAR_7=None):...\n",
"super(CLASS_1, self).__init__()\n",
"self._error_msg = VAR_6\n",
"self.disclaimer_banner_file = VAR_7\n"
] | [
"def __init__(self, error_msg=None, disclaimer_banner_file=None):...\n",
"super(LoginWebSite, self).__init__()\n",
"self._error_msg = error_msg\n",
"self.disclaimer_banner_file = disclaimer_banner_file\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_23(*VAR_17, **VAR_18):...\n",
"return VAR_59\n"
] | [
"def _mock_adapter(*args, **kwargs):...\n",
"return mock_adapter\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"return openid.create_login_url(VAR_3, VAR_23)\n"
] | [
"@staticmethod...\n",
"return openid.create_login_url(request, dest_url)\n"
] | [
0,
0
] | [
"Condition",
"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 FUNC_0(VAR_0=None):...\n",
"VAR_1 = frappe.db.sql_list('select name from `tabLeave Type` order by name asc'\n )\n",
"VAR_3 = FUNC_1(VAR_1)\n",
"VAR_4 = FUNC_2(VAR_0, VAR_1)\n",
"return VAR_3, VAR_4\n"
] | [
"def execute(filters=None):...\n",
"leave_types = frappe.db.sql_list(\n 'select name from `tabLeave Type` order by name asc')\n",
"columns = get_columns(leave_types)\n",
"data = get_data(filters, leave_types)\n",
"return columns, data\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_2, VAR_3, VAR_4, *VAR_6, **VAR_14):...\n",
"for VAR_39 in self.browse(VAR_2, VAR_3, VAR_4):\n",
"if VAR_39.tasks:\n",
"return super(VAR_51, self).unlink(VAR_2, VAR_3, VAR_4, *VAR_6, **kwargs)\n"
] | [
"def unlink(self, cr, uid, ids, *args, **kwargs):...\n",
"for proj in self.browse(cr, uid, ids):\n",
"if proj.tasks:\n",
"return super(project, self).unlink(cr, uid, ids, *args, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'"
] |
[
"\"\"\"\ndesc: application for end users to access retail data\n\"\"\"\n",
"import queries\n",
"import configparser\n",
"import customer_commands\n",
"import help_functions\n",
"def FUNC_0():...\n",
"VAR_4 = configparser.ConfigParser()\n",
"VAR_4.read('config.ini')\n",
"return queries.Query(host=con... | [
"\"\"\"\ndesc: application for end users to access retail data\n\"\"\"\n",
"import queries\n",
"import configparser\n",
"import customer_commands\n",
"import help_functions\n",
"def init():...\n",
"config = configparser.ConfigParser()\n",
"config.read('config.ini')\n",
"return queries.Query(host=con... | [
0,
0,
0,
0,
4,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"self.render('index.html')\n"
] | [
"def get(self):...\n",
"self.render('index.html')\n"
] | [
0,
6
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = 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_19]\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'"
] |
[
"@transaction.atomic...\n",
"VAR_6 = CreateStudentForm(VAR_0.POST)\n",
"if not VAR_6.is_valid():\n",
"return FUNC_0(VAR_0, VAR_2=form)\n",
"VAR_7 = Student(andrew_id=form.cleaned_data['andrew_id'], VAR_11=form.\n cleaned_data['first_name'], last_name=form.cleaned_data['last_name'])\n",
"VAR_7.save()\n"... | [
"@transaction.atomic...\n",
"form = CreateStudentForm(request.POST)\n",
"if not form.is_valid():\n",
"return make_view(request, create_student_form=form)\n",
"new_student = Student(andrew_id=form.cleaned_data['andrew_id'], first_name=\n form.cleaned_data['first_name'], last_name=form.cleaned_data['last_n... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Return'"
] |
[
"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):...\n",
"VAR_0 = TestApp(main({}))\n",
"VAR_0.get('/service', status=400)\n",
"VAR_1 = VAR_0.post('/service', params='buh', status=400)\n",
"self.assertTrue('Not a json body' in VAR_1.body)\n",
"VAR_1 = VAR_0.post('/service', params=json.dumps('buh'))\n",
"self.assertEqual(VAR_1.body, ... | [
"def test_validation(self):...\n",
"app = TestApp(main({}))\n",
"app.get('/service', status=400)\n",
"res = app.post('/service', params='buh', status=400)\n",
"self.assertTrue('Not a json body' in res.body)\n",
"res = app.post('/service', params=json.dumps('buh'))\n",
"self.assertEqual(res.body, json.du... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@auth.route('/change-email', methods=['GET', 'POST'])...\n",
"VAR_1 = ChangeEmailForm()\n",
"if VAR_1.validate_on_submit():\n",
"if current_user.verify_password(VAR_1.password.data):\n",
"return render_template('auth/change_email.html', VAR_1=form)\n",
"VAR_4 = VAR_1.email.data\n",
"flash('Invalid pass... | [
"@auth.route('/change-email', methods=['GET', 'POST'])...\n",
"form = ChangeEmailForm()\n",
"if form.validate_on_submit():\n",
"if current_user.verify_password(form.password.data):\n",
"return render_template('auth/change_email.html', form=form)\n",
"new_email = form.email.data\n",
"flash('Invalid passw... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __eq__(self, VAR_1):...\n",
"if not isinstance(VAR_1, CLASS_0):\n",
"return False\n",
"return self._uuid == VAR_1._uuid\n"
] | [
"def __eq__(self, other):...\n",
"if not isinstance(other, Host):\n",
"return False\n",
"return self._uuid == other._uuid\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_20(self, VAR_7):...\n",
"if '%(key)s' in VAR_7:\n",
"VAR_7 = VAR_7.replace('%(key)s', 'name')\n",
"return frappe.db.sql(VAR_7, as_dict=not self.as_list)\n"
] | [
"def run_custom_query(self, query):...\n",
"if '%(key)s' in query:\n",
"query = query.replace('%(key)s', 'name')\n",
"return frappe.db.sql(query, as_dict=not self.as_list)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_31(self):...\n",
""
] | [
"def touch_or_create(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0(VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = dict(external_id=resp.get('orcid'), external_method='orcid')\n",
"return VAR_5\n"
] | [
"def account_info(remote, resp):...\n",
"\"\"\"docstring\"\"\"\n",
"account_info = dict(external_id=resp.get('orcid'), external_method='orcid')\n",
"return account_info\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_7 = {'sha': 'df1e628f2244b73f9cdf944f880a2b3470a122f4', 'fingerprint':\n '88:25:ed:67:56:91:3d:c6:1b:7f:4... | [
"def test_push_hook(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"body = {'sha': 'df1e628f2244b73f9cdf944f880a2b3470a122f4', 'fingerprint':\n '88:25:ed:67:56:91:... | [
0,
0,
0,
5,
0,
0,
0,
0,
5,
5,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"@api.public...\n",
"VAR_6.fail('Handler code should not be called')\n"
] | [
"@api.public...\n",
"test.fail('Handler code should not be called')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_7(VAR_6):...\n",
"VAR_12 = f\"\"\"\n DELETE FROM {VAR_1} \n WHERE user_id={VAR_6}\n \"\"\"\n",
"VAR_14 = create_connection()\n",
"VAR_14.close()\n",
"VAR_15 = VAR_14.cursor()\n",
"VAR_15.execute(VAR_12)\n",
"VAR_14.commit()\n",
"return 'Ok'\n"
] | [
"def delete_cart(userId):...\n",
"sql_query = f\"\"\"\n DELETE FROM {CARTS_TABLE} \n WHERE user_id={userId}\n \"\"\"\n",
"connection = create_connection()\n",
"connection.close()\n",
"cursor = connection.cursor()\n",
"cursor.execute(sql_query)\n",
"connection.commit()\n"... | [
0,
4,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@property...\n",
"return 'google oauth'\n"
] | [
"@property...\n",
"return 'google oauth'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"import datetime\n",
"import logging\n",
"import os\n",
"import sys\n",
"import time\n",
"import unittest\n",
"import test_env_bot_code\n",
"test_env_bot_code.setup_test_env()\n",
"import net_utils\n",
"import xsrf_client\n",
"def FUNC_0(self):...\n",
"super(CLASS_0, self).setUp()\n",
"self.... | [
"import datetime\n",
"import logging\n",
"import os\n",
"import sys\n",
"import time\n",
"import unittest\n",
"import test_env_bot_code\n",
"test_env_bot_code.setup_test_env()\n",
"import net_utils\n",
"import xsrf_client\n",
"def setUp(self):...\n",
"super(UrlHelperTest, self).setUp()\n",
"... | [
5,
5,
0,
5,
5,
5,
5,
5,
5,
5,
0,
5,
5,
5,
5,
5,
5,
0,
5,
5,
5,
0,
5,
0,
5,
0,
5,
5,
0,
5,
5,
0,
0,
5,
5,
5,
0,
5,
5,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Expr'",
"Import'",
"Import'",
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
... |
[
"def FUNC_1(self, VAR_10, VAR_11=None):...\n",
"VAR_10 = decode_if_byte_string(VAR_10, force_text=True)\n",
"VAR_10 = VAR_10.rstrip(os.path.sep) + os.path.sep\n",
"VAR_11 = decode_if_byte_string(VAR_11)\n",
"VAR_11 = ensure_leading_trailing_slash(VAR_11)\n",
"if self.autorefresh:\n",
"self.directories.i... | [
"def add_files(self, root, prefix=None):...\n",
"root = decode_if_byte_string(root, force_text=True)\n",
"root = root.rstrip(os.path.sep) + os.path.sep\n",
"prefix = decode_if_byte_string(prefix)\n",
"prefix = ensure_leading_trailing_slash(prefix)\n",
"if self.autorefresh:\n",
"self.directories.insert(0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
"return users.is_current_user_admin()\n"
] | [
"@staticmethod...\n",
"return users.is_current_user_admin()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"import time\n",
"VAR_0 = 'pos.open.statement'\n",
"VAR_1 = 'Open Statements'\n",
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = []\n",
"VAR_7 = self.pool.get('ir.model.data')\n",
"VAR_8 = self.p... | [
"from osv import osv\n",
"from tools.translate import _\n",
"import time\n",
"_name = 'pos.open.statement'\n",
"_description = 'Open Statements'\n",
"def open_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'... |
[
"def FUNC_2(self, VAR_7, VAR_8=None, VAR_9=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = Database().view_submit(VAR_7)\n",
"VAR_15, VAR_16 = [], []\n",
"for VAR_6 in VAR_2.data['data']:\n",
"if VAR_6['type'] == 'file':\n",
"return {'files': VAR_15, 'path': VAR_2.tmp_path}\n",
"VAR_22 = Storage.ge... | [
"def get_files(self, submit_id, password=None, astree=False):...\n",
"\"\"\"docstring\"\"\"\n",
"submit = Database().view_submit(submit_id)\n",
"files, duplicates = [], []\n",
"for data in submit.data['data']:\n",
"if data['type'] == 'file':\n",
"return {'files': files, 'path': submit.tmp_path}\n",
"f... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
1,
0,
1,
1,
0,
1,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"self.logger.info(VAR_1)\n",
"self.console.info(VAR_1)\n"
] | [
"def log_info(self, msg):...\n",
"\"\"\"docstring\"\"\"\n",
"self.logger.info(msg)\n",
"self.console.info(msg)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"@inlineCallbacks...\n",
"from txpostgres import txpostgres, reconnection\n",
"from txpostgres.reconnection import DeadConnectionDetector\n",
"def FUNC_18(self, VAR_3):...\n",
"print('ERROR: database connection is down (error: {0})'.format(VAR_3.value))\n",
"return DeadConnectionDetector.startReconnecting... | [
"@inlineCallbacks...\n",
"from txpostgres import txpostgres, reconnection\n",
"from txpostgres.reconnection import DeadConnectionDetector\n",
"def startReconnecting(self, f):...\n",
"print('ERROR: database connection is down (error: {0})'.format(f.value))\n",
"return DeadConnectionDetector.startReconnecti... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"VAR_26 = []\n",
"for i in range(self.options.injections):\n",
"VAR_26.append(uniform(0, self.db.campaign['exec_time']))\n",
"VAR_26 = sorted(VAR_26)\n",
"for VAR_35, injection_time in enumerate(VAR_26, VAR_24=1):\n",
"if self.options.debug:\n",
"return 0, False\n",
"print(... | [
"def inject_faults(self):...\n",
"injection_times = []\n",
"for i in range(self.options.injections):\n",
"injection_times.append(uniform(0, self.db.campaign['exec_time']))\n",
"injection_times = sorted(injection_times)\n",
"for injection, injection_time in enumerate(injection_times, start=1):\n",
"if se... | [
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,
0,
0,
0,
0,
0,
0,
2,
0,
0,
2,
0,
0,
2,
0,
0,
0,
2,
2
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
... |
[
"def FUNC_9(VAR_15, VAR_16):...\n",
"VAR_19 = len(VAR_16)\n",
"return all(len(h.args) == VAR_19 or h.varargs for h in VAR_15)\n"
] | [
"def accepts_vpath(handlers, vpath):...\n",
"args_no = len(vpath)\n",
"return all(len(h.args) == args_no or h.varargs for h in handlers)\n"
] | [
0,
0,
1
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self, VAR_16='supervisor'):...\n",
""
] | [
"def set_mode(self, mode='supervisor'):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_9(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_3 = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n",
"self.driver._eql_execute('volume', 'select', VAR_3['volume_name'],\n 'snapshot', 'delete', VAR_3['name'])\n",
"self.mox.ReplayAll()\... | [
"def test_delete_snapshot(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n",
"self.driver._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'delete', snapshot['name'])\n",
... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_3):...\n",
"VAR_10 = {onboarding.INTRODUCTION_INTRO: {'html': '<p>instructor_intro</p>',\n 'description': 'instructor_intro desc', 'title': 'instructor_intro'},\n onboarding.CREATE_COURSE: {'html': '<p>create_course</p>',\n 'description': 'create_course desc', 'title': 'create_course'},\n... | [
"def mocked_setting(setting_name):...\n",
"data = {onboarding.INTRODUCTION_INTRO: {'html': '<p>instructor_intro</p>',\n 'description': 'instructor_intro desc', 'title': 'instructor_intro'},\n onboarding.CREATE_COURSE: {'html': '<p>create_course</p>',\n 'description': 'create_course desc', 'title': 'creat... | [
0,
6,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_4():...\n",
"VAR_14 = []\n",
"for sectionSettingsPair in VAR_51.settingsStructure:\n",
"VAR_14.append('<h2>{}</h2>'.format(sectionSettingsPair[0]))\n",
"return ''.join(VAR_14)\n",
"for sectionOption in sectionSettingsPair[1]:\n",
"VAR_41 = None\n",
"VAR_42 = ''\n",
"if type(sectionOption) ... | [
"def settingsToHtmlForm():...\n",
"settingsInputs = []\n",
"for sectionSettingsPair in settings.settingsStructure:\n",
"settingsInputs.append('<h2>{}</h2>'.format(sectionSettingsPair[0]))\n",
"return ''.join(settingsInputs)\n",
"for sectionOption in sectionSettingsPair[1]:\n",
"option = None\n",
"opti... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Return'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_8, VAR_9, VAR_10, VAR_11=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = VAR_8.components.netatmo\n",
"VAR_13 = CLASS_1(VAR_12.NETATMO_AUTH, VAR_9.get(VAR_2, None))\n",
"VAR_14 = []\n",
"import pyatmo\n",
"if VAR_1 in VAR_9:\n",
"return None\n",
"VAR_10(VAR_14, True)\n",
"for VA... | [
"def setup_platform(hass, config, add_devices, discovery_info=None):...\n",
"\"\"\"docstring\"\"\"\n",
"netatmo = hass.components.netatmo\n",
"data = NetAtmoData(netatmo.NETATMO_AUTH, config.get(CONF_STATION, None))\n",
"dev = []\n",
"import pyatmo\n",
"if CONF_MODULES in config:\n",
"return None\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Condition",
"Return'",
"Expr'",
"For",
"For",
"Condition",
"For",
"Expr'",
"For",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"import asyncpg\n",
"def __init__(self, VAR_0):...\n",
"self.db_conn = VAR_0\n",
"async def FUNC_0(self, VAR_1: int, VAR_2: str):...\n",
"VAR_4 = f'SELECT {VAR_2} FROM user_info WHERE member_id = {VAR_1};'\n",
"return await self.db_conn.fetchval(VAR_4)\n"
] | [
"import asyncpg\n",
"def __init__(self, db_conn):...\n",
"self.db_conn = db_conn\n",
"async def fetch_user_info(self, member_id: int, column: str):...\n",
"query = f'SELECT {column} FROM user_info WHERE member_id = {member_id};'\n",
"return await self.db_conn.fetchval(query)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Import'",
"FunctionDef'",
"Assign'",
"AsyncFunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = model.Identity(model.IDENTITY_USER, 'a@example.com')\n",
"VAR_10 = model.Identity(model.IDENTITY_USER, 'b@example.com')\n",
"model.bootstrap_ip_whitelist('whitelist', ['192.168.1.100/32'])\n",
"model.bootstrap_ip_whitelist_assignment(VAR_9, 'wh... | [
"def test_ip_whitelist(self):...\n",
"\"\"\"docstring\"\"\"\n",
"ident1 = model.Identity(model.IDENTITY_USER, 'a@example.com')\n",
"ident2 = model.Identity(model.IDENTITY_USER, 'b@example.com')\n",
"model.bootstrap_ip_whitelist('whitelist', ['192.168.1.100/32'])\n",
"model.bootstrap_ip_whitelist_assignmen... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.format_wildcards(self.rule.shellcmd\n ) if self.rule.shellcmd else None\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.format_wildcards(self.rule.shellcmd\n ) if self.rule.shellcmd else None\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.