lines
listlengths 1
444
| raw_lines
listlengths 1
444
| label
listlengths 1
444
| type
listlengths 1
444
|
---|---|---|---|
[
"def FUNC_0(self, *VAR_5, **VAR_4):...\n",
"if self.run_local:\n",
"return utils.execute(*VAR_5, **kwargs)\n",
"VAR_7 = VAR_4.pop('check_exit_code', None)\n",
"VAR_6 = ' '.join(VAR_5)\n",
"return self._run_ssh(VAR_6, VAR_7)\n"
] |
[
"def san_execute(self, *cmd, **kwargs):...\n",
"if self.run_local:\n",
"return utils.execute(*cmd, **kwargs)\n",
"check_exit_code = kwargs.pop('check_exit_code', None)\n",
"command = ' '.join(cmd)\n",
"return self._run_ssh(command, check_exit_code)\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"if ':' not in VAR_0:\n",
"VAR_4 = VAR_0.split(':')\n",
"VAR_5 = importlib.import_module(VAR_4[0])\n",
"return getattr(VAR_5, VAR_4[1])\n"
] |
[
"def str2class(value):...\n",
"\"\"\"docstring\"\"\"\n",
"if ':' not in value:\n",
"name = value.split(':')\n",
"module = importlib.import_module(name[0])\n",
"return getattr(module, name[1])\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __str__(self):...\n",
"VAR_26 = list()\n",
"if self.forced:\n",
"VAR_26.append('Forced execution')\n",
"if self.noio:\n",
"VAR_26 = '; '.join(VAR_26)\n",
"VAR_26.append('Rules with neither input nor output files are always executed.')\n",
"if self.nooutput:\n",
"return VAR_26\n",
"VAR_26.append(\n 'Rules with a run or shell declaration but no output are always executed.')\n",
"if self.missing_output:\n",
"VAR_26.append('Missing output files: {}'.format(', '.join(self.missing_output))\n )\n",
"if self.incomplete_output:\n",
"VAR_26.append('Incomplete output files: {}'.format(', '.join(self.\n incomplete_output)))\n",
"VAR_30 = self.updated_input - self.updated_input_run\n",
"if VAR_30:\n",
"VAR_26.append('Updated input files: {}'.format(', '.join(VAR_30)))\n",
"if self.updated_input_run:\n",
"VAR_26.append('Input files updated by another job: {}'.format(', '.join(\n self.updated_input_run)))\n"
] |
[
"def __str__(self):...\n",
"s = list()\n",
"if self.forced:\n",
"s.append('Forced execution')\n",
"if self.noio:\n",
"s = '; '.join(s)\n",
"s.append('Rules with neither input nor output files are always executed.')\n",
"if self.nooutput:\n",
"return s\n",
"s.append(\n 'Rules with a run or shell declaration but no output are always executed.')\n",
"if self.missing_output:\n",
"s.append('Missing output files: {}'.format(', '.join(self.missing_output)))\n",
"if self.incomplete_output:\n",
"s.append('Incomplete output files: {}'.format(', '.join(self.\n incomplete_output)))\n",
"updated_input = self.updated_input - self.updated_input_run\n",
"if updated_input:\n",
"s.append('Updated input files: {}'.format(', '.join(updated_input)))\n",
"if self.updated_input_run:\n",
"s.append('Input files updated by another job: {}'.format(', '.join(self.\n updated_input_run)))\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"@validate(VUser(), VCreateMeetup(), VAR_4=ValueOrBlank('title'), VAR_8=...\n",
"return BoringPage(pagename='New Meetup', VAR_27=NewMeetup(*a, **kw)).render()\n"
] |
[
"@validate(VUser(), VCreateMeetup(), title=ValueOrBlank('title'),...\n",
"return BoringPage(pagename='New Meetup', content=NewMeetup(*a, **kw)).render()\n"
] |
[
0,
0
] |
[
"Condition",
"Return'"
] |
[
"@pytest.mark.parametrize('inputfile,expected', [('single_file.yml', ['one',...\n",
"VAR_2 = nestedfacts.load_yml_filedir(os.path.join(os.path.dirname(__file__),\n 'data', VAR_0))\n",
"assert VAR_2 == VAR_1\n"
] |
[
"@pytest.mark.parametrize('inputfile,expected', [('single_file.yml', ['one',...\n",
"data = nestedfacts.load_yml_filedir(os.path.join(os.path.dirname(__file__),\n 'data', inputfile))\n",
"assert data == expected\n"
] |
[
0,
0,
0
] |
[
"Condition",
"Assign'",
"Assert'"
] |
[
"import pyxl\n",
"import mysql.connector\n",
"from pypika import MySQLQuery, Table, Field\n",
"def FUNC_0(VAR_0, 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",
"VAR_6 = Table('Presets')\n",
"VAR_7 = MySQLQuery.into(VAR_6).columns('querval', 'description').insert(VAR_1,\n VAR_2)\n",
"print(VAR_7)\n",
"VAR_5 = str(VAR_7)\n",
"VAR_4.execute(VAR_5)\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",
"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 != 'NA':\n",
"VAR_5 = \"UPDATE Presets SET querval='\" + VAR_1 + \"' WHERE id=\" + str(VAR_3\n ) + ';'\n",
"if VAR_2 != 'NA':\n",
"VAR_4.execute(VAR_5)\n",
"VAR_5 = \"UPDATE Presets SET description='\" + VAR_2 + \"' WHERE id=\" + str(VAR_3\n ) + ';'\n",
"VAR_5 = 'ALTER TABLE Presets DROP COLUMN id;'\n",
"VAR_4.execute(VAR_5)\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",
"def FUNC_2(VAR_0, VAR_3):...\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",
"VAR_5 = 'DELETE FROM Presets WHERE id = ' + VAR_3\n",
"VAR_4.execute(VAR_5)\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",
"def FUNC_3(VAR_0, VAR_3):...\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",
"VAR_6 = Table('Presets')\n",
"VAR_7 = MySQLQuery.from_(VAR_6).select(VAR_6.querval).where(VAR_6.id == VAR_3)\n",
"print(VAR_7)\n",
"VAR_5 = str(VAR_7)\n",
"VAR_4.execute(VAR_5)\n",
"VAR_8 = VAR_4.fetchone()\n",
"VAR_9 = str(VAR_8)\n",
"return VAR_9[2:-3]\n"
] |
[
"import pyxl\n",
"import mysql.connector\n",
"from pypika import MySQLQuery, Table, Field\n",
"def write_preset(conn, 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",
"extable = Table('Presets')\n",
"q = MySQLQuery.into(extable).columns('querval', 'description').insert(queryin,\n descriptin)\n",
"print(q)\n",
"quer = str(q)\n",
"cursor.execute(quer)\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",
"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 queryin != 'NA':\n",
"quer = \"UPDATE Presets SET querval='\" + queryin + \"' WHERE id=\" + str(key\n ) + ';'\n",
"if descriptin != 'NA':\n",
"cursor.execute(quer)\n",
"quer = \"UPDATE Presets SET description='\" + descriptin + \"' WHERE id=\" + str(\n key) + ';'\n",
"quer = 'ALTER TABLE Presets DROP COLUMN id;'\n",
"cursor.execute(quer)\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",
"def remove_preset(conn, key):...\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",
"quer = 'DELETE FROM Presets WHERE id = ' + key\n",
"cursor.execute(quer)\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",
"def get_preset(conn, key):...\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",
"extable = Table('Presets')\n",
"q = MySQLQuery.from_(extable).select(extable.querval).where(extable.id == key)\n",
"print(q)\n",
"quer = str(q)\n",
"cursor.execute(quer)\n",
"row = cursor.fetchone()\n",
"strrow = str(row)\n",
"return strrow[2:-3]\n"
] |
[
0,
0,
0,
0,
4,
4,
4,
4,
0,
4,
4,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
4,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
4,
4,
4
] |
[
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(VAR_17):...\n",
"VAR_1 = self.window.active_view()\n",
"VAR_13 = self.sorted_menu[VAR_17][2]\n",
"VAR_19 = self.sorted_menu[VAR_17][0]\n",
"VAR_1.run_command('insert', {'characters': VAR_19 + ' -> ' + VAR_23.\n filename + ' | '})\n"
] |
[
"def link_to_the_file(index):...\n",
"view = self.window.active_view()\n",
"file = self.sorted_menu[index][2]\n",
"title = self.sorted_menu[index][0]\n",
"view.run_command('insert', {'characters': title + ' -> ' + file_info.\n filename + ' | '})\n"
] |
[
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_35(self):...\n",
"self.compilation_ko(\"\"\"\nrequire \"fileinto\", \"enveloppe\";\n\"\"\")\n"
] |
[
"def test_comma_inside_arguments(self):...\n",
"self.compilation_ko(\"\"\"\nrequire \"fileinto\", \"enveloppe\";\n\"\"\")\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.client.login(username='autotest2', password='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",
"VAR_4 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_8 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n dumps({'web': 'node server.js', 'worker': 'node worker.js'})}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(VAR_8), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"self.client.login(username='autotest', password='password')\n",
"VAR_4 = '/api/apps/{app_id}/scale'.format(**locals())\n",
"VAR_8 = {'web': 4, 'worker': 2}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(VAR_8), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_5.status_code, 204)\n"
] |
[
"def test_admin_can_manage_other_containers(self):...\n",
"\"\"\"docstring\"\"\"\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 = response.data['id']\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n dumps({'web': 'node server.js', 'worker': 'node worker.js'})}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"self.client.login(username='autotest', password='password')\n",
"url = '/api/apps/{app_id}/scale'.format(**locals())\n",
"body = {'web': 4, 'worker': 2}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 204)\n"
] |
[
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = get_agent_module(VAR_11)\n",
"if hasattr(VAR_29, 'add_cmdline_args'):\n",
"if hasattr(VAR_29, 'dictionary_class'):\n",
"VAR_29.add_cmdline_args(self)\n",
"VAR_6 = FUNC_2(VAR_29.dictionary_class())\n",
"self.set_defaults(dict_class=s)\n"
] |
[
"def add_model_subargs(self, model):...\n",
"\"\"\"docstring\"\"\"\n",
"agent = get_agent_module(model)\n",
"if hasattr(agent, 'add_cmdline_args'):\n",
"if hasattr(agent, 'dictionary_class'):\n",
"agent.add_cmdline_args(self)\n",
"s = class2str(agent.dictionary_class())\n",
"self.set_defaults(dict_class=s)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1():...\n",
"VAR_4 = VAR_6.get('modtokens', [])\n",
"VAR_5 = None\n",
"if len(VAR_4) < 100:\n",
"VAR_5 = hashlib.sha1(str(random.random())).hexdigest()\n",
"VAR_5 = VAR_4[-1]\n",
"VAR_4.append(VAR_5)\n",
"VAR_6['modtokens'] = VAR_4\n",
"VAR_6.save()\n",
"return VAR_5\n"
] |
[
"def make_token():...\n",
"tokens = session.get('modtokens', [])\n",
"token = None\n",
"if len(tokens) < 100:\n",
"token = hashlib.sha1(str(random.random())).hexdigest()\n",
"token = tokens[-1]\n",
"tokens.append(token)\n",
"session['modtokens'] = tokens\n",
"session.save()\n",
"return token\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@VAR_1.route('/signup')...\n",
"if 'return_url' in request.args:\n",
"VAR_18['return_url'] = request.args['return_url']\n",
"return render_template('register.html')\n"
] |
[
"@app.route('/signup')...\n",
"if 'return_url' in request.args:\n",
"session['return_url'] = request.args['return_url']\n",
"return render_template('register.html')\n"
] |
[
0,
0,
0,
0
] |
[
"Condition",
"Condition",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"return mark_safe(VAR_6.name)\n"
] |
[
"@staticmethod...\n",
"return mark_safe(obj.name)\n"
] |
[
0,
0
] |
[
"Condition",
"Return'"
] |
[
"import pymysql\n",
"import dbconfig\n",
"def FUNC_0(self, VAR_0='crimemap'):...\n",
"return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n"
] |
[
"import pymysql\n",
"import dbconfig\n",
"def connect(self, database='crimemap'):...\n",
"return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n"
] |
[
0,
0,
0,
0
] |
[
"Import'",
"Import'",
"FunctionDef'",
"Return'"
] |
[
"def __call__(self, VAR_2, VAR_3, VAR_4=None):...\n",
"if VAR_3.strip():\n",
"return\n",
"import code\n",
"VAR_48 = dict(locals())\n",
"VAR_48['xmpp'] = self.XMPP\n",
"self.reply(VAR_2,\n \"Dropping into repl shell -- don't expect any further interaction until termination of shell access\"\n )\n",
"code.InteractiveConsole(VAR_48).interact('REPL shell as requested')\n"
] |
[
"def __call__(self, msg, arguments, errorSink=None):...\n",
"if arguments.strip():\n",
"return\n",
"import code\n",
"namespace = dict(locals())\n",
"namespace['xmpp'] = self.XMPP\n",
"self.reply(msg,\n \"Dropping into repl shell -- don't expect any further interaction until termination of shell access\"\n )\n",
"code.InteractiveConsole(namespace).interact('REPL shell as requested')\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Return'",
"Import'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"self.common.terminate_connection(VAR_6, VAR_9['host'], VAR_9['wwpns'])\n",
"self.common.client_logout()\n"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"self.common.terminate_connection(volume, connector['host'], connector['wwpns'])\n",
"self.common.client_logout()\n"
] |
[
0,
0,
0,
0,
0
] |
[
"Condition",
"Docstring",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/login/<remote_app>/')...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1 not in oauth.remote_apps:\n",
"return abort(404)\n",
"VAR_2 = url_for('.authorized', VAR_1=remote_app, next=request.args.get(\n 'next') or request.referrer or None, _external=True)\n",
"return oauth.remote_apps[VAR_1].authorize(callback=callback_url)\n"
] |
[
"@blueprint.route('/login/<remote_app>/')...\n",
"\"\"\"docstring\"\"\"\n",
"if remote_app not in oauth.remote_apps:\n",
"return abort(404)\n",
"callback_url = url_for('.authorized', remote_app=remote_app, next=request.\n args.get('next') or request.referrer or None, _external=True)\n",
"return oauth.remote_apps[remote_app].authorize(callback=callback_url)\n"
] |
[
0,
0,
0,
0,
5,
5
] |
[
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"from twisted.internet.defer import inlineCallbacks, returnValue\n",
"from base import Database\n",
"VAR_0 = 'JOIN'\n",
"VAR_1 = 'LEFT JOIN'\n",
"VAR_2 = {'BOOL': 'bool', 'CHAR': 'varchar', 'FLOAT': 'float', 'INT': 'int',\n 'JSON': 'jsonb', 'DATE': 'timestamp'}\n",
"def FUNC_0(self, VAR_3):...\n",
"print('ERROR: connecting failed with {0}'.format(VAR_3.value))\n",
"@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(self, VAR_3)\n"
] |
[
"from twisted.internet.defer import inlineCallbacks, returnValue\n",
"from base import Database\n",
"JOIN = 'JOIN'\n",
"LEFT_JOIN = 'LEFT JOIN'\n",
"TYPES = {'BOOL': 'bool', 'CHAR': 'varchar', 'FLOAT': 'float', 'INT': 'int',\n 'JSON': 'jsonb', 'DATE': 'timestamp'}\n",
"def connectionError(self, f):...\n",
"print('ERROR: connecting failed with {0}'.format(f.value))\n",
"@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.startReconnecting(self, f)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.create_snapshot(VAR_9)\n",
"self.common.client_logout()\n"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.create_snapshot(snapshot)\n",
"self.common.client_logout()\n"
] |
[
0,
0,
0,
0
] |
[
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self['nodes']:\n",
"return\n",
"VAR_12 = []\n",
"if not isinstance(self['nodes'], list):\n",
"self['nodes'] = [self['nodes']]\n",
"for node in self['nodes']:\n",
"VAR_21 = [i for i, m in enumerate(node) if m == ',']\n",
"self['nodes'] = VAR_12\n",
"VAR_21.append(len(node))\n",
"VAR_22 = 0\n",
"VAR_23 = 0\n",
"for idx in VAR_21:\n",
"if VAR_23 != len(node):\n",
"VAR_23 = idx\n",
"VAR_12.append(node[VAR_23 + 1:])\n",
"VAR_29 = node[VAR_22:idx]\n",
"re.compile(re.escape(VAR_29))\n",
"if '[' in VAR_29 and ']' not in VAR_29:\n",
"VAR_12.append(VAR_29.lstrip(','))\n",
"VAR_22 = idx\n"
] |
[
"def parse_node_strings(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self['nodes']:\n",
"return\n",
"nodes = []\n",
"if not isinstance(self['nodes'], list):\n",
"self['nodes'] = [self['nodes']]\n",
"for node in self['nodes']:\n",
"idxs = [i for i, m in enumerate(node) if m == ',']\n",
"self['nodes'] = nodes\n",
"idxs.append(len(node))\n",
"start = 0\n",
"pos = 0\n",
"for idx in idxs:\n",
"if pos != len(node):\n",
"pos = idx\n",
"nodes.append(node[pos + 1:])\n",
"reg = node[start:idx]\n",
"re.compile(re.escape(reg))\n",
"if '[' in reg and ']' not in reg:\n",
"nodes.append(reg.lstrip(','))\n",
"start = idx\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def __str__(self):...\n",
"return super().__str__() + 'Backend: ' + self.backend + '\\n'\n"
] |
[
"def __str__(self):...\n",
"return super().__str__() + 'Backend: ' + self.backend + '\\n'\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(**VAR_12) ->typing.Callable[[typing.Any], commands.Command]:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12.setdefault('cls', CLASS_1)\n",
"return commands.command(**kwargs)\n"
] |
[
"def command(**kwargs) ->typing.Callable[[typing.Any], commands.Command]:...\n",
"\"\"\"docstring\"\"\"\n",
"kwargs.setdefault('cls', NekoCommand)\n",
"return commands.command(**kwargs)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Expr'",
"Return'"
] |
[
"def FUNC_8(self, VAR_7, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = VAR_7[VAR_8].value\n",
"VAR_1.warn('%s could not get meta for %s', self, VAR_8)\n",
"if VAR_7[VAR_8].repeatable:\n",
"return ''\n",
"return VAR_17\n",
"return VAR_17[0]\n"
] |
[
"def get_safe_value(self, meta, key):...\n",
"\"\"\"docstring\"\"\"\n",
"val = meta[key].value\n",
"logger.warn('%s could not get meta for %s', self, key)\n",
"if meta[key].repeatable:\n",
"return ''\n",
"return val\n",
"return val[0]\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_9, VAR_5, VAR_1, VAR_6, VAR_11={}, **VAR_12):...\n",
"super().__init__(VAR_9, VAR_1, VAR_6, VAR_11, **kwargs)\n",
"self.ref_is_commit = False\n",
"self.ref = 'origin/HEAD'\n",
"if VAR_5.fragment:\n",
"VAR_39 = CLASS_1._parse_fragment(VAR_5)\n",
"self.url = VAR_5._replace(VAR_39='')._replace(scheme=url.scheme.replace(\n 'git+', ''))\n",
"if 'commit' in VAR_39:\n",
"self.ref = VAR_39['commit']\n",
"if 'tag' in VAR_39:\n",
"self.ref_is_commit = True\n",
"self.ref = VAR_39['tag']\n",
"if 'branch' in VAR_39:\n",
"self.ref = 'origin/%s' % VAR_39['branch']\n"
] |
[
"def __init__(self, name, url, directory, options, conf={}, **kwargs):...\n",
"super().__init__(name, directory, options, conf, **kwargs)\n",
"self.ref_is_commit = False\n",
"self.ref = 'origin/HEAD'\n",
"if url.fragment:\n",
"fragment = Subproject._parse_fragment(url)\n",
"self.url = url._replace(fragment='')._replace(scheme=url.scheme.replace(\n 'git+', ''))\n",
"if 'commit' in fragment:\n",
"self.ref = fragment['commit']\n",
"if 'tag' in fragment:\n",
"self.ref_is_commit = True\n",
"self.ref = fragment['tag']\n",
"if 'branch' in fragment:\n",
"self.ref = 'origin/%s' % fragment['branch']\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"@api.public...\n",
"self.response.write(json.dumps({'peer_id': api.get_peer_identity().to_bytes\n (), 'cur_id': api.get_current_identity().to_bytes()}))\n"
] |
[
"@api.public...\n",
"self.response.write(json.dumps({'peer_id': api.get_peer_identity().to_bytes\n (), 'cur_id': api.get_current_identity().to_bytes()}))\n"
] |
[
0,
0
] |
[
"Condition",
"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 enterprise_exclusions]\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"return CLASS_0._TalkToHandlerAsync(VAR_9, VAR_7, 'POST', VAR_10)\n"
] |
[
"@staticmethod...\n",
"return BaseRequest._TalkToHandlerAsync(data, handler, 'POST', timeout)\n"
] |
[
0,
0
] |
[
"Condition",
"Return'"
] |
[
"def FUNC_33(VAR_57, VAR_22):...\n",
"if not len(VAR_57):\n",
"VAR_56.append('/%s' % ('/'.join(VAR_22),))\n",
"if VAR_57[0] == '.':\n",
"FUNC_33(VAR_57[1:], VAR_22)\n",
"if VAR_57[0] == '..':\n",
"FUNC_33(VAR_57[1:], VAR_22[:-1])\n",
"VAR_65 = [x[VAR_1] for x in self.get_path('/'.join(VAR_22))]\n",
"VAR_74 = [x for x in VAR_65 if fnmatch.fnmatchcase(x, VAR_57[0])]\n",
"for match in VAR_74:\n",
"FUNC_33(VAR_57[1:], VAR_22 + [match])\n"
] |
[
"def foo(p, cwd):...\n",
"if not len(p):\n",
"found.append('/%s' % ('/'.join(cwd),))\n",
"if p[0] == '.':\n",
"foo(p[1:], cwd)\n",
"if p[0] == '..':\n",
"foo(p[1:], cwd[:-1])\n",
"names = [x[A_NAME] for x in self.get_path('/'.join(cwd))]\n",
"matches = [x for x in names if fnmatch.fnmatchcase(x, p[0])]\n",
"for match in matches:\n",
"foo(p[1:], cwd + [match])\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'"
] |
[
"def __init__(self, VAR_14, VAR_15):...\n",
"super(CLASS_2, self).__init__(VAR_15=mode)\n",
"self._accounts = VAR_14\n"
] |
[
"def __init__(self, accounts, mode):...\n",
"super(StubServicesFactory, self).__init__(mode=mode)\n",
"self._accounts = accounts\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_10(self):...\n",
"self.assertTrue(os.path.realpath(f.name).startswith(os.path.realpath(path)),\n 'file should be created in root_dir if specified.')\n"
] |
[
"def test_temporary_file_within_other_dir(self):...\n",
"self.assertTrue(os.path.realpath(f.name).startswith(os.path.realpath(path)),\n 'file should be created in root_dir if specified.')\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_19(self, *VAR_67):...\n",
"self._localrules.update(VAR_67)\n"
] |
[
"def localrules(self, *rulenames):...\n",
"self._localrules.update(rulenames)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name}\n",
"self.stubs.Set(self.driver, '_get_iscsi_properties', self.\n _fake_get_iscsi_properties)\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'access',\n 'create', 'initiator', self.connector['initiator'], 'authmethod chap',\n 'username', self.configuration.eqlx_chap_login)\n",
"self.mox.ReplayAll()\n",
"VAR_8 = self.driver.initialize_connection(VAR_1, self.connector)\n",
"self.assertEqual(VAR_8['data'], self._fake_get_iscsi_properties(VAR_1))\n"
] |
[
"def test_initialize_connection(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name}\n",
"self.stubs.Set(self.driver, '_get_iscsi_properties', self.\n _fake_get_iscsi_properties)\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'access',\n 'create', 'initiator', self.connector['initiator'], 'authmethod chap',\n 'username', self.configuration.eqlx_chap_login)\n",
"self.mox.ReplayAll()\n",
"iscsi_properties = self.driver.initialize_connection(volume, self.connector)\n",
"self.assertEqual(iscsi_properties['data'], self._fake_get_iscsi_properties(\n volume))\n"
] |
[
0,
0,
0,
0,
2,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(VAR_7, VAR_8, VAR_2):...\n",
"VAR_10 = sqlite3.connect(VAR_1)\n",
"VAR_11 = VAR_10.cursor()\n",
"VAR_11.execute('string', (VAR_7, VAR_2, VAR_8))\n",
"VAR_10.commit()\n",
"VAR_10.close()\n"
] |
[
"def add_notes(secure_fname, file_id, username):...\n",
"connection = sqlite3.connect(DATABASE_PATH)\n",
"cursor = connection.cursor()\n",
"cursor.execute(\n \"\"\"INSERT INTO Notes(secure_name, user_id, uuid_filename)\n VALUES (?, \n (SELECT user_id FROM UserData WHERE username = ?),\n ?)\"\"\"\n , (secure_fname, username, file_id))\n",
"connection.commit()\n",
"connection.close()\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_3(VAR_5, 'freeze')\n"
] |
[
"def startProgramFreezing(program_entity):...\n",
"\"\"\"docstring\"\"\"\n",
"return _processProgramFreezing(program_entity, 'freeze')\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_16 = self.common.get_volume_stats(VAR_4)\n",
"VAR_16['storage_protocol'] = 'FC'\n",
"VAR_17 = self.configuration.safe_get('volume_backend_name')\n",
"VAR_16['volume_backend_name'] = VAR_17 or self.__class__.__name__\n",
"self.common.client_logout()\n",
"return VAR_16\n"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"stats = self.common.get_volume_stats(refresh)\n",
"stats['storage_protocol'] = 'FC'\n",
"backend_name = self.configuration.safe_get('volume_backend_name')\n",
"stats['volume_backend_name'] = backend_name or self.__class__.__name__\n",
"self.common.client_logout()\n",
"return stats\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"@api.public...\n",
"self.response.write(api.get_peer_host() or '<none>')\n",
"VAR_7 = self.make_test_app('/request', CLASS_7)\n",
"def FUNC_26(VAR_20):...\n",
"api.reset_local_state()\n",
"return VAR_7.get('/request', VAR_20=headers).body\n"
] |
[
"def test_get_peer_host(self):...\n",
"@api.public...\n",
"self.response.write(api.get_peer_host() or '<none>')\n",
"app = self.make_test_app('/request', Handler)\n",
"def call(headers):...\n",
"api.reset_local_state()\n",
"return app.get('/request', headers=headers).body\n"
] |
[
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self, VAR_2, VAR_3):...\n",
"VAR_4 = Path(VAR_3)\n",
"if VAR_2 == 'localhost':\n",
"VAR_5 = self.local_listing(VAR_4)\n",
"VAR_5 = self.remote_listing(VAR_2, VAR_4)\n",
"return VAR_5\n"
] |
[
"def get_contents(self, host, path):...\n",
"parsed_path = Path(path)\n",
"if host == 'localhost':\n",
"contents = self.local_listing(parsed_path)\n",
"contents = self.remote_listing(host, parsed_path)\n",
"return contents\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_2, VAR_3, VAR_4, VAR_5, VAR_6=[]):...\n",
"VAR_6.append((VAR_3, VAR_4))\n",
"print(VAR_3, VAR_4)\n",
"if VAR_2.board[VAR_3][VAR_4].get() == 'L':\n",
"VAR_5 = self.left_bounce(VAR_5)\n",
"if VAR_2.board[VAR_3][VAR_4].get() == 'R':\n",
"if VAR_5 == 'north':\n",
"VAR_5 = self.right_bounce(VAR_5)\n",
"VAR_3 -= 1\n",
"if VAR_5 == 'east':\n",
"if (VAR_3 >= 0 and VAR_3 < VAR_2.dim_x) and (VAR_4 >= 0 and VAR_4 < VAR_2.dim_y\n",
"VAR_4 += 1\n",
"if VAR_5 == 'south':\n",
"self.walk(VAR_2, VAR_3, VAR_4, VAR_5)\n",
"VAR_3 += 1\n",
"if VAR_5 == 'west':\n",
"VAR_4 -= 1\n"
] |
[
"def walk(self, board, row, col, direction, path=[]):...\n",
"path.append((row, col))\n",
"print(row, col)\n",
"if board.board[row][col].get() == 'L':\n",
"direction = self.left_bounce(direction)\n",
"if board.board[row][col].get() == 'R':\n",
"if direction == 'north':\n",
"direction = self.right_bounce(direction)\n",
"row -= 1\n",
"if direction == 'east':\n",
"if (row >= 0 and row < board.dim_x) and (col >= 0 and col < board.dim_y):\n",
"col += 1\n",
"if direction == 'south':\n",
"self.walk(board, row, col, direction)\n",
"row += 1\n",
"if direction == 'west':\n",
"col -= 1\n"
] |
[
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"AugAssign'",
"Condition",
"Condition",
"AugAssign'",
"Condition",
"Expr'",
"AugAssign'",
"Condition",
"AugAssign'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] |
[
0,
0
] |
[
"Condition",
"Condition"
] |
[
"@VAR_0.route('/uploads/<filename>')...\n",
"return send_from_directory(VAR_0.config['UPLOAD_FOLDER'], VAR_5)\n"
] |
[
"@app.route('/uploads/<filename>')...\n",
"return send_from_directory(app.config['UPLOAD_FOLDER'], filename)\n"
] |
[
0,
4
] |
[
"Condition",
"Return'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3):...\n",
"self.http_server = reactor.listenTCP(VAR_2, Site(Redirect(VAR_3)))\n"
] |
[
"def setUpHttpRedirectServer(self, port, redirect_url):...\n",
"self.http_server = reactor.listenTCP(port, Site(Redirect(redirect_url)))\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_8(self, VAR_16, VAR_12=None, VAR_13=False):...\n",
"return self._rest_call(VAR_16, VAR_24='GET', VAR_12=headers, VAR_13=silent)\n"
] |
[
"def url_get(self, url, headers=None, silent=False):...\n",
"return self._rest_call(url, method='GET', headers=headers, silent=silent)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(VAR_13, VAR_14, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_13 = str(VAR_13)\n",
"VAR_14 = str(VAR_14)\n",
"FUNC_0(VAR_13)\n",
"FUNC_0(VAR_14)\n",
"VAR_26 = pathlib.Path(VAR_13).glob('**/*.vcf')\n",
"for VAR_0 in VAR_26:\n",
"VAR_31 = str(VAR_0)\n",
"VAR_32 = FUNC_8(VAR_31)\n",
"VAR_32 = VAR_32[0:len(VAR_32) - 4]\n",
"VAR_38 = str(pathlib.Path(VAR_14, VAR_32))\n",
"print('[Setup][Data] Converting VCF file to Zarr format: {}'.format(VAR_31))\n",
"print(' - Output: {}'.format(VAR_38))\n",
"FUNC_11(VAR_16=path_str, VAR_17=path_zarr_output, VAR_15=conversion_config)\n"
] |
[
"def setup_vcf_to_zarr(input_vcf_dir, output_zarr_dir, conversion_config):...\n",
"\"\"\"docstring\"\"\"\n",
"input_vcf_dir = str(input_vcf_dir)\n",
"output_zarr_dir = str(output_zarr_dir)\n",
"create_directory_tree(input_vcf_dir)\n",
"create_directory_tree(output_zarr_dir)\n",
"pathlist_vcf = pathlib.Path(input_vcf_dir).glob('**/*.vcf')\n",
"for path in pathlist_vcf:\n",
"path_str = str(path)\n",
"file_output_str = path_leaf(path_str)\n",
"file_output_str = file_output_str[0:len(file_output_str) - 4]\n",
"path_zarr_output = str(pathlib.Path(output_zarr_dir, file_output_str))\n",
"print('[Setup][Data] Converting VCF file to Zarr format: {}'.format(path_str))\n",
"print(' - Output: {}'.format(path_zarr_output))\n",
"convert_to_zarr(input_vcf_path=path_str, output_zarr_path=path_zarr_output,\n conversion_config=conversion_config)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_24(VAR_36):...\n",
"return type(VAR_36).__name__ == 'cython_function_or_method'\n"
] |
[
"def is_cython(obj):...\n",
"\"\"\"docstring\"\"\"\n",
"def check_cython(x):...\n",
"return type(x).__name__ == 'cython_function_or_method'\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"VAR_1 = resolve(f'/habitsandpractices/{self.objects.doc.pk}/')\n",
"self.assertEqual(VAR_1.func, views.habitsandpractices)\n"
] |
[
"def test_habitsandpractices(self):...\n",
"found = resolve(f'/habitsandpractices/{self.objects.doc.pk}/')\n",
"self.assertEqual(found.func, views.habitsandpractices)\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@mock.patch('requests.post', FUNC_0)...\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_4 = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"VAR_5 = self.client.post(VAR_4, content_type='application/json')\n",
"self.assertEqual(VAR_5.status_code, 404)\n",
"VAR_4 = '/api/apps/{app_id}/config'.format(**locals())\n",
"VAR_7 = {'values': json.dumps({'NEW_URL1': 'http://localhost:8080/'})}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(VAR_7), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_4 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_10 = json.dumps({'PATH': 'bin:/usr/local/bin:/usr/bin:/bin'})\n",
"VAR_7 = {'image': 'autotest/example'}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(VAR_7), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_4 = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"VAR_5 = self.client.post(VAR_4, content_type='application/json')\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_4 = '/api/apps/{app_id}/releases'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4, content_type='application/json')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"self.assertEqual(VAR_5.data['count'], 4)\n",
"VAR_4 = '/api/apps/{app_id}/releases/v2'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4, content_type='application/json')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"VAR_9 = VAR_5.data\n",
"self.assertEquals(VAR_9['version'], 2)\n",
"VAR_4 = '/api/apps/{app_id}/releases/v4'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4, content_type='application/json')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"VAR_12 = VAR_5.data\n",
"self.assertEquals(VAR_12['version'], 4)\n",
"self.assertNotEqual(VAR_9['uuid'], VAR_12['uuid'])\n",
"self.assertEqual(VAR_9['build'], VAR_12['build'])\n",
"self.assertEqual(VAR_9['config'], VAR_12['config'])\n",
"VAR_4 = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"VAR_7 = {'version': 1}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(VAR_7), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_4 = '/api/apps/{app_id}/releases'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4, content_type='application/json')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"self.assertEqual(VAR_5.data['count'], 5)\n",
"VAR_4 = '/api/apps/{app_id}/releases/v1'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"VAR_8 = VAR_5.data\n",
"VAR_4 = '/api/apps/{app_id}/releases/v5'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"VAR_13 = VAR_5.data\n",
"self.assertEqual(VAR_13['version'], 5)\n",
"self.assertNotEqual(VAR_8['uuid'], VAR_13['uuid'])\n",
"self.assertEqual(VAR_8['build'], VAR_13['build'])\n",
"self.assertEqual(VAR_8['config'], VAR_13['config'])\n",
"VAR_4 = '/api/apps/{app_id}/config'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"self.assertEqual(VAR_5.data['values'], {})\n",
"VAR_4 = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"VAR_7 = {'version': 3}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(VAR_7), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_4 = '/api/apps/{app_id}/config'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"VAR_14 = VAR_5.data['values']\n",
"self.assertIn('NEW_URL1', VAR_14)\n",
"self.assertEqual('http://localhost:8080/', VAR_14['NEW_URL1'])\n"
] |
[
"@mock.patch('requests.post', mock_import_repository_task)...\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"response = self.client.post(url, content_type='application/json')\n",
"self.assertEqual(response.status_code, 404)\n",
"url = '/api/apps/{app_id}/config'.format(**locals())\n",
"body = {'values': json.dumps({'NEW_URL1': 'http://localhost:8080/'})}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"build_config = json.dumps({'PATH': 'bin:/usr/local/bin:/usr/bin:/bin'})\n",
"body = {'image': 'autotest/example'}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"url = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"response = self.client.post(url, content_type='application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"url = '/api/apps/{app_id}/releases'.format(**locals())\n",
"response = self.client.get(url, content_type='application/json')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(response.data['count'], 4)\n",
"url = '/api/apps/{app_id}/releases/v2'.format(**locals())\n",
"response = self.client.get(url, content_type='application/json')\n",
"self.assertEqual(response.status_code, 200)\n",
"release2 = response.data\n",
"self.assertEquals(release2['version'], 2)\n",
"url = '/api/apps/{app_id}/releases/v4'.format(**locals())\n",
"response = self.client.get(url, content_type='application/json')\n",
"self.assertEqual(response.status_code, 200)\n",
"release4 = response.data\n",
"self.assertEquals(release4['version'], 4)\n",
"self.assertNotEqual(release2['uuid'], release4['uuid'])\n",
"self.assertEqual(release2['build'], release4['build'])\n",
"self.assertEqual(release2['config'], release4['config'])\n",
"url = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"body = {'version': 1}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"url = '/api/apps/{app_id}/releases'.format(**locals())\n",
"response = self.client.get(url, content_type='application/json')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(response.data['count'], 5)\n",
"url = '/api/apps/{app_id}/releases/v1'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assertEqual(response.status_code, 200)\n",
"release1 = response.data\n",
"url = '/api/apps/{app_id}/releases/v5'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assertEqual(response.status_code, 200)\n",
"release5 = response.data\n",
"self.assertEqual(release5['version'], 5)\n",
"self.assertNotEqual(release1['uuid'], release5['uuid'])\n",
"self.assertEqual(release1['build'], release5['build'])\n",
"self.assertEqual(release1['config'], release5['config'])\n",
"url = '/api/apps/{app_id}/config'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(response.data['values'], {})\n",
"url = '/api/apps/{app_id}/releases/rollback/'.format(**locals())\n",
"body = {'version': 3}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"url = '/api/apps/{app_id}/config'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assertEqual(response.status_code, 200)\n",
"values = response.data['values']\n",
"self.assertIn('NEW_URL1', values)\n",
"self.assertEqual('http://localhost:8080/', values['NEW_URL1'])\n"
] |
[
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0
] |
[
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"import os\n",
"import sys\n",
"import unittest\n",
"import threading\n",
"VAR_0 = os.path.abspath(__file__)\n",
"import test_env_api\n",
"test_env_api.setup_test_env()\n",
"import bot\n",
"def FUNC_0(self):...\n",
"VAR_1 = bot.Bot(None, {'dimensions': {'foo': 'bar'}},\n 'https://localhost:1/', '1234-1a2b3c4-tainted-joe', 'base_dir', None)\n",
"self.assertEqual({'foo': 'bar'}, VAR_1.dimensions)\n",
"self.assertEqual(os.path.join(os.path.dirname(VAR_0), 'swarming_bot.zip'),\n VAR_1.swarming_bot_zip)\n",
"self.assertEqual('1234-1a2b3c4-tainted-joe', VAR_1.server_version)\n",
"self.assertEqual('base_dir', VAR_1.base_dir)\n",
"def FUNC_1(self):...\n",
"VAR_1 = bot.Bot(None, {}, 'https://localhost:1/',\n '1234-1a2b3c4-tainted-joe', 'base_dir', None)\n",
"VAR_2 = threading.Event()\n",
"VAR_1.call_later(0.001, VAR_2.set)\n",
"self.assertTrue(VAR_2.wait(1))\n",
"def FUNC_2(self):...\n",
"VAR_1 = bot.Bot(None, {}, 'https://localhost:1/',\n '1234-1a2b3c4-tainted-joe', 'base_dir', None)\n",
"VAR_2 = threading.Event()\n",
"VAR_1.call_later(0.1, VAR_2.set)\n",
"VAR_1.cancel_all_timers()\n",
"self.assertFalse(VAR_2.wait(0.3))\n",
"if __name__ == '__main__':\n",
"if '-v' in sys.argv:\n",
"unittest.TestCase.maxDiff = None\n",
"unittest.main()\n"
] |
[
"import os\n",
"import sys\n",
"import unittest\n",
"import threading\n",
"THIS_FILE = os.path.abspath(__file__)\n",
"import test_env_api\n",
"test_env_api.setup_test_env()\n",
"import bot\n",
"def test_bot(self):...\n",
"obj = bot.Bot(None, {'dimensions': {'foo': 'bar'}}, 'https://localhost:1/',\n '1234-1a2b3c4-tainted-joe', 'base_dir', None)\n",
"self.assertEqual({'foo': 'bar'}, obj.dimensions)\n",
"self.assertEqual(os.path.join(os.path.dirname(THIS_FILE),\n 'swarming_bot.zip'), obj.swarming_bot_zip)\n",
"self.assertEqual('1234-1a2b3c4-tainted-joe', obj.server_version)\n",
"self.assertEqual('base_dir', obj.base_dir)\n",
"def test_bot_call_later(self):...\n",
"obj = bot.Bot(None, {}, 'https://localhost:1/', '1234-1a2b3c4-tainted-joe',\n 'base_dir', None)\n",
"ev = threading.Event()\n",
"obj.call_later(0.001, ev.set)\n",
"self.assertTrue(ev.wait(1))\n",
"def test_bot_call_later_cancel(self):...\n",
"obj = bot.Bot(None, {}, 'https://localhost:1/', '1234-1a2b3c4-tainted-joe',\n 'base_dir', None)\n",
"ev = threading.Event()\n",
"obj.call_later(0.1, ev.set)\n",
"obj.cancel_all_timers()\n",
"self.assertFalse(ev.wait(0.3))\n",
"if __name__ == '__main__':\n",
"if '-v' in sys.argv:\n",
"unittest.TestCase.maxDiff = None\n",
"unittest.main()\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Import'",
"Expr'",
"Import'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.request.start_time = datetime_now()\n",
"self.xsrf_token\n",
"self.set_header('Server', 'globaleaks')\n",
"self.set_header('X-Content-Type-Options', 'nosniff')\n",
"self.set_header('X-XSS-Protection', '1; mode=block')\n",
"self.set_header('Cache-control', 'no-cache, no-store, must-revalidate')\n",
"self.set_header('Pragma', 'no-cache')\n",
"self.set_header('Expires', '-1')\n",
"self.set_header('X-Robots-Tag', 'noindex')\n",
"if not GLSetting.devel_mode:\n",
"self.set_header('X-Frame-Options', 'deny')\n",
"VAR_21 = self.request.headers.get('GL-Language', None)\n",
"if not VAR_21:\n",
"VAR_21 = GLSetting.memory_copy.default_language\n",
"self.request.language = VAR_21\n"
] |
[
"def set_default_headers(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.request.start_time = datetime_now()\n",
"self.xsrf_token\n",
"self.set_header('Server', 'globaleaks')\n",
"self.set_header('X-Content-Type-Options', 'nosniff')\n",
"self.set_header('X-XSS-Protection', '1; mode=block')\n",
"self.set_header('Cache-control', 'no-cache, no-store, must-revalidate')\n",
"self.set_header('Pragma', 'no-cache')\n",
"self.set_header('Expires', '-1')\n",
"self.set_header('X-Robots-Tag', 'noindex')\n",
"if not GLSetting.devel_mode:\n",
"self.set_header('X-Frame-Options', 'deny')\n",
"lang = self.request.headers.get('GL-Language', None)\n",
"if not lang:\n",
"lang = GLSetting.memory_copy.default_language\n",
"self.request.language = lang\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"return '{:,}'.format(VAR_3.cycles_between)\n"
] |
[
"def render_cycles_between(self, record):...\n",
"return '{:,}'.format(record.cycles_between)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6():...\n",
"VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n"
] |
[
"def _raise_exception():...\n",
"frappe.throw(_('Invalid Search Field'), frappe.DataError)\n"
] |
[
0,
4
] |
[
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_13(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = 'SELECT path FROM {0} WHERE type=0;'.format(VAR_2)\n",
"VAR_4 = self._run_command(VAR_7)\n",
"VAR_4 = [i[0] for i in VAR_4]\n",
"VAR_4 = None\n",
"return VAR_4\n"
] |
[
"def getFileListPics(self):...\n",
"\"\"\"docstring\"\"\"\n",
"command = 'SELECT path FROM {0} WHERE type=0;'.format(TABLE_NAME)\n",
"data = self._run_command(command)\n",
"data = [i[0] for i in data]\n",
"data = None\n",
"return data\n"
] |
[
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __eq__(self, VAR_11):...\n",
"if VAR_11 is None:\n",
"return False\n",
"return self.rule == VAR_11.rule and (self.dynamic_output or self.\n wildcards_dict == VAR_11.wildcards_dict)\n"
] |
[
"def __eq__(self, other):...\n",
"if other is None:\n",
"return False\n",
"return self.rule == other.rule and (self.dynamic_output or self.\n wildcards_dict == other.wildcards_dict)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_18, VAR_35=10000, VAR_36=errors.BAD_COMMENT, VAR_37=...\n",
"CLASS_0.__init__(self, VAR_18, **kw)\n",
"self.length = VAR_35\n",
"self.len_error = VAR_37\n",
"self.emp_error = VAR_36\n"
] |
[
"def __init__(self, item, length=10000, empty_error=errors.BAD_COMMENT,...\n",
"Validator.__init__(self, item, **kw)\n",
"self.length = length\n",
"self.len_error = length_error\n",
"self.emp_error = empty_error\n"
] |
[
0,
0,
0,
0,
0
] |
[
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(VAR_1, VAR_2, VAR_4=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = f'PRAGMA table_info({VAR_2});'\n",
"if VAR_4:\n",
"print(VAR_16)\n",
"VAR_17 = VAR_1.cursor()\n",
"VAR_20 = VAR_17.execute(VAR_16).fetchall()\n",
"VAR_17.close()\n",
"return VAR_20\n"
] |
[
"def db_describe(conn, table, debug=False):...\n",
"\"\"\"docstring\"\"\"\n",
"sql = f'PRAGMA table_info({table});'\n",
"if debug:\n",
"print(sql)\n",
"cursor = conn.cursor()\n",
"info = cursor.execute(sql).fetchall()\n",
"cursor.close()\n",
"return info\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_9(self, VAR_20=None, VAR_18=None, **VAR_3):...\n",
"VAR_34 = VAR_3.pop('cache', False)\n",
"VAR_20 = self.__prepare(VAR_20, VAR_18)\n",
"return self._select(VAR_20, VAR_3, VAR_34=cache)\n"
] |
[
"def select(self, sql=None, filename=None, **kwargs):...\n",
"cache = kwargs.pop('cache', False)\n",
"sql = self.__prepare(sql, filename)\n",
"return self._select(sql, kwargs, cache=cache)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.host.prefix + self.host.pkg_query(self.host.sos_pkg_name)\n",
"VAR_33 = self.run_command(VAR_6)\n",
"if VAR_33['status'] == 0:\n",
"VAR_15 = VAR_33['stdout'].splitlines()[-1].split('-')[1]\n",
"self.log_error('sos is not installed on this node')\n",
"self.sos_info['version'] = VAR_15\n",
"self.connected = False\n",
"self.log_debug('sos version is %s' % self.sos_info['version'])\n",
"return False\n",
"VAR_6 = self.host.prefix + 'sosreport -l'\n",
"VAR_10 = self.run_command(VAR_6)\n",
"if VAR_10['status'] == 0:\n",
"self._load_sos_plugins(VAR_10['stdout'])\n",
"if self.check_sos_version('3.6'):\n",
"self._load_sos_presets()\n"
] |
[
"def _load_sos_info(self):...\n",
"\"\"\"docstring\"\"\"\n",
"cmd = self.host.prefix + self.host.pkg_query(self.host.sos_pkg_name)\n",
"res = self.run_command(cmd)\n",
"if res['status'] == 0:\n",
"ver = res['stdout'].splitlines()[-1].split('-')[1]\n",
"self.log_error('sos is not installed on this node')\n",
"self.sos_info['version'] = ver\n",
"self.connected = False\n",
"self.log_debug('sos version is %s' % self.sos_info['version'])\n",
"return False\n",
"cmd = self.host.prefix + 'sosreport -l'\n",
"sosinfo = self.run_command(cmd)\n",
"if sosinfo['status'] == 0:\n",
"self._load_sos_plugins(sosinfo['stdout'])\n",
"if self.check_sos_version('3.6'):\n",
"self._load_sos_presets()\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"self.infohashes.clear()\n",
"super(CLASS_1, self).reset()\n"
] |
[
"def reset(self):...\n",
"self.infohashes.clear()\n",
"super(TriblerContentModel, self).reset()\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_23 = self.common.create_volume(VAR_7)\n",
"self.common.client_logout()\n",
"return {'metadata': VAR_23}\n"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"metadata = self.common.create_volume(volume)\n",
"self.common.client_logout()\n",
"return {'metadata': metadata}\n"
] |
[
0,
0,
0,
0,
0
] |
[
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"return shellutil.run('/sbin/service waagent start', VAR_8=False)\n"
] |
[
"def start_agent_service(self):...\n",
"return shellutil.run('/sbin/service waagent start', chk_err=False)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(VAR_1, VAR_6):...\n",
""
] |
[
"def directory_index(path, fullpath):...\n",
""
] |
[
0,
0
] |
[
"FunctionDef'",
"Condition"
] |
[
"def FUNC_25(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.set('modified', now())\n",
"VAR_54.db.set_value(self.doctype, self.name, 'modified', self.modified,\n update_modified=False)\n"
] |
[
"def update_modified(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.set('modified', now())\n",
"frappe.db.set_value(self.doctype, self.name, 'modified', self.modified,\n update_modified=False)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_17(self, *VAR_67):...\n",
"self._ruleorder.add(*VAR_67)\n"
] |
[
"def ruleorder(self, *rulenames):...\n",
"self._ruleorder.add(*rulenames)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_33):...\n",
"if VAR_33 and self.valid_re.match(VAR_33):\n",
"return self.splitter.split(VAR_33)\n"
] |
[
"def run(self, val):...\n",
"if val and self.valid_re.match(val):\n",
"return self.splitter.split(val)\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_26(self):...\n",
"for VAR_25 in self.meta.get('fields'):\n",
"if VAR_25.fieldtype == 'Check':\n",
"if self.docstatus is not None:\n",
"self.set(VAR_25.fieldname, cint(self.get(VAR_25.fieldname)))\n",
"if self.get(VAR_25.fieldname) is not None:\n",
"self.docstatus = cint(self.docstatus)\n",
"if VAR_25.fieldtype == 'Int':\n",
"self.set(VAR_25.fieldname, cint(self.get(VAR_25.fieldname)))\n",
"if VAR_25.fieldtype in ('Float', 'Currency', 'Percent'):\n",
"self.set(VAR_25.fieldname, flt(self.get(VAR_25.fieldname)))\n"
] |
[
"def _fix_numeric_types(self):...\n",
"for df in self.meta.get('fields'):\n",
"if df.fieldtype == 'Check':\n",
"if self.docstatus is not None:\n",
"self.set(df.fieldname, cint(self.get(df.fieldname)))\n",
"if self.get(df.fieldname) is not None:\n",
"self.docstatus = cint(self.docstatus)\n",
"if df.fieldtype == 'Int':\n",
"self.set(df.fieldname, cint(self.get(df.fieldname)))\n",
"if df.fieldtype in ('Float', 'Currency', 'Percent'):\n",
"self.set(df.fieldname, flt(self.get(df.fieldname)))\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"For",
"Condition",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_8(VAR_25, VAR_20, VAR_21, VAR_5=False, VAR_22=None, VAR_23=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_52 = [\n \"\"\"<collection><record>\n<controlfield tag=\"001\">%s</controlfield>\"\"\" %\n VAR_25]\n",
"VAR_20 = VAR_20.items()\n",
"VAR_21 = VAR_21.items()\n",
"VAR_52.append(FUNC_9(VAR_20, VAR_21, VAR_22, VAR_23))\n",
"VAR_52.append('</record></collection>')\n",
"return '\\n'.join(VAR_52)\n"
] |
[
"def build_marc(recid, single_keywords, composite_keywords, spires=False,...\n",
"\"\"\"docstring\"\"\"\n",
"output = [\n \"\"\"<collection><record>\n<controlfield tag=\"001\">%s</controlfield>\"\"\" %\n recid]\n",
"single_keywords = single_keywords.items()\n",
"composite_keywords = composite_keywords.items()\n",
"output.append(_output_marc(single_keywords, composite_keywords,\n author_keywords, acronyms))\n",
"output.append('</record></collection>')\n",
"return '\\n'.join(output)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = len(self.log_files)\n",
"VAR_9 = self.redis_client.lrange('LOG_FILENAMES:{}'.format(self.\n node_ip_address), VAR_8, -1)\n",
"for VAR_10 in VAR_9:\n",
"VAR_0.info('Beginning to track file {}'.format(VAR_10))\n",
"assert VAR_10 not in self.log_files\n",
"self.log_files[VAR_10] = []\n"
] |
[
"def update_log_filenames(self):...\n",
"\"\"\"docstring\"\"\"\n",
"num_current_log_files = len(self.log_files)\n",
"new_log_filenames = self.redis_client.lrange('LOG_FILENAMES:{}'.format(self\n .node_ip_address), num_current_log_files, -1)\n",
"for log_filename in new_log_filenames:\n",
"logger.info('Beginning to track file {}'.format(log_filename))\n",
"assert log_filename not in self.log_files\n",
"self.log_files[log_filename] = []\n"
] |
[
0,
0,
6,
6,
6,
0,
6,
6
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assert'",
"Assign'"
] |
[
"def FUNC_54(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 8, 'HIGH': 6}, 'CONFIDENCE': {'HIGH': 14}}\n",
"self.check_example('weak_cryptographic_key_sizes.py', VAR_2)\n"
] |
[
"def test_weak_cryptographic_key(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 8, 'HIGH': 6}, 'CONFIDENCE': {'HIGH': 14}}\n",
"self.check_example('weak_cryptographic_key_sizes.py', expect)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_16():...\n",
"VAR_38 = socket(AF_INET, SOCK_STREAM)\n",
"VAR_38.bind(('', 0))\n",
"VAR_39 = VAR_38.getsockname()[1]\n",
"VAR_38.close()\n",
"return VAR_39\n"
] |
[
"def find_open_port():...\n",
"sock = socket(AF_INET, SOCK_STREAM)\n",
"sock.bind(('', 0))\n",
"port = sock.getsockname()[1]\n",
"sock.close()\n",
"return port\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_5(VAR_2, VAR_3):...\n",
"VAR_2.browser.quit()\n",
"FUNC_6(VAR_2)\n",
"VAR_2.last_mail = None\n"
] |
[
"def after_feature(context, feature):...\n",
"context.browser.quit()\n",
"cleanup_all_mails(context)\n",
"context.last_mail = None\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_14(self, VAR_12, VAR_13, VAR_14=None):...\n",
"\"\"\"docstring\"\"\"\n",
"assert VAR_14 is None or (VAR_13 is None or VAR_14 >= VAR_23(VAR_13))\n",
"if VAR_14:\n",
"VAR_38 = 'create table t1(s %s(%s))' % (VAR_12, VAR_14)\n",
"VAR_38 = 'create table t1(s %s)' % VAR_12\n",
"self.cursor.execute(VAR_38)\n",
"self.cursor.execute('insert into t1 values(?)', VAR_13)\n",
"VAR_4 = self.cursor.execute('select * from t1').fetchone()[0]\n",
"self.assertEqual(type(VAR_4), type(VAR_13))\n",
"if VAR_13 is not None:\n",
"self.assertEqual(VAR_23(VAR_4), VAR_23(VAR_13))\n",
"self.assertEqual(VAR_4, VAR_13)\n"
] |
[
"def _test_strliketype(self, sqltype, value, colsize=None):...\n",
"\"\"\"docstring\"\"\"\n",
"assert colsize is None or (value is None or colsize >= len(value))\n",
"if colsize:\n",
"sql = 'create table t1(s %s(%s))' % (sqltype, colsize)\n",
"sql = 'create table t1(s %s)' % sqltype\n",
"self.cursor.execute(sql)\n",
"self.cursor.execute('insert into t1 values(?)', value)\n",
"v = self.cursor.execute('select * from t1').fetchone()[0]\n",
"self.assertEqual(type(v), type(value))\n",
"if value is not None:\n",
"self.assertEqual(len(v), len(value))\n",
"self.assertEqual(v, value)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assert'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 3}, 'CONFIDENCE': {'HIGH': 3}}\n",
"self.check_example('eval.py', VAR_2)\n"
] |
[
"def test_eval(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 3}, 'CONFIDENCE': {'HIGH': 3}}\n",
"self.check_example('eval.py', expect)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_24(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = 'os-chmod-{}.py'\n",
"if six.PY2:\n",
"VAR_8 = VAR_8.format('py2')\n",
"VAR_8 = VAR_8.format('py3')\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 2, 'HIGH': 8}, 'CONFIDENCE': {'MEDIUM': 1,\n 'HIGH': 9}}\n",
"self.check_example(VAR_8, VAR_2)\n"
] |
[
"def test_os_chmod(self):...\n",
"\"\"\"docstring\"\"\"\n",
"filename = 'os-chmod-{}.py'\n",
"if six.PY2:\n",
"filename = filename.format('py2')\n",
"filename = filename.format('py3')\n",
"expect = {'SEVERITY': {'MEDIUM': 2, 'HIGH': 8}, 'CONFIDENCE': {'MEDIUM': 1,\n 'HIGH': 9}}\n",
"self.check_example(filename, expect)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@pytest.yield_fixture...\n",
"config.app = Sanic('test_sanic_app')\n",
"config_app()\n",
"yield config.app\n"
] |
[
"@pytest.yield_fixture...\n",
"config.app = Sanic('test_sanic_app')\n",
"config_app()\n",
"yield config.app\n"
] |
[
0,
0,
0,
0
] |
[
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@Throttle(VAR_4)...\n",
"\"\"\"docstring\"\"\"\n",
"import pyatmo\n",
"self.station_data = pyatmo.WeatherStationData(self.auth)\n",
"if self.station is not None:\n",
"self.data = self.station_data.lastData(VAR_19=self.station, exclude=3600)\n",
"self.data = self.station_data.lastData(exclude=3600)\n"
] |
[
"@Throttle(MIN_TIME_BETWEEN_UPDATES)...\n",
"\"\"\"docstring\"\"\"\n",
"import pyatmo\n",
"self.station_data = pyatmo.WeatherStationData(self.auth)\n",
"if self.station is not None:\n",
"self.data = self.station_data.lastData(station=self.station, exclude=3600)\n",
"self.data = self.station_data.lastData(exclude=3600)\n"
] |
[
0,
0,
0,
0,
0,
0,
0
] |
[
"Condition",
"Docstring",
"Import'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_36(self, VAR_29):...\n",
"VAR_6.assertEqual('Too bad', VAR_29.message)\n",
"VAR_12.append('authentication_error')\n",
"super(CLASS_7, self).authentication_error(VAR_29)\n"
] |
[
"def authentication_error(self, err):...\n",
"test.assertEqual('Too bad', err.message)\n",
"calls.append('authentication_error')\n",
"super(Handler, self).authentication_error(err)\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_1: str, VAR_2):...\n",
"self.from_object = VAR_1\n",
"self.client = VAR_2\n"
] |
[
"def __init__(self, from_object: str, client):...\n",
"self.from_object = from_object\n",
"self.client = client\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def __setstate__(self, VAR_1):...\n",
"return self.deserialize(VAR_1)\n"
] |
[
"def __setstate__(self, data):...\n",
"return self.deserialize(data)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"VAR_4 = {'r': u'not ascii £ һ'}\n",
"VAR_1 = 'http://my.url.com'\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(VAR_1), mox.IgnoreArg(), timeout\n =mox.IgnoreArg()).AndReturn(StringIO.StringIO(VAR_2))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(url_helper.UrlOpen(VAR_1, VAR_4=data), VAR_2)\n",
"self._mox.VerifyAll()\n"
] |
[
"def testNonAcsiiData(self):...\n",
"data = {'r': u'not ascii £ һ'}\n",
"url = 'http://my.url.com'\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(url), mox.IgnoreArg(), timeout=\n mox.IgnoreArg()).AndReturn(StringIO.StringIO(response))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(url_helper.UrlOpen(url, data=data), response)\n",
"self._mox.VerifyAll()\n"
] |
[
0,
0,
0,
0,
5,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {}\n",
"VAR_5['volumeName'] = VAR_9\n",
"VAR_18 = self._cliq_run_xml('getVolumeInfo', VAR_5)\n",
"VAR_23 = {}\n",
"VAR_24 = VAR_18.find('response/volume')\n",
"for VAR_43, v in VAR_24.attrib.items():\n",
"VAR_23['volume.' + VAR_43] = v\n",
"VAR_25 = VAR_24.find('status')\n",
"if VAR_25 is not None:\n",
"for VAR_43, v in VAR_25.attrib.items():\n",
"VAR_26 = VAR_24.find('permission')\n",
"VAR_23['status.' + VAR_43] = v\n",
"if VAR_26 is not None:\n",
"for VAR_43, v in VAR_25.attrib.items():\n",
"VAR_0.debug(_('Volume info: %(volume_name)s => %(volume_attributes)s') % {\n 'volume_name': VAR_9, 'volume_attributes': VAR_23})\n",
"VAR_23['permission.' + VAR_43] = v\n",
"return VAR_23\n"
] |
[
"def _cliq_get_volume_info(self, volume_name):...\n",
"\"\"\"docstring\"\"\"\n",
"cliq_args = {}\n",
"cliq_args['volumeName'] = volume_name\n",
"result_xml = self._cliq_run_xml('getVolumeInfo', cliq_args)\n",
"volume_attributes = {}\n",
"volume_node = result_xml.find('response/volume')\n",
"for k, v in volume_node.attrib.items():\n",
"volume_attributes['volume.' + k] = v\n",
"status_node = volume_node.find('status')\n",
"if status_node is not None:\n",
"for k, v in status_node.attrib.items():\n",
"permission_node = volume_node.find('permission')\n",
"volume_attributes['status.' + k] = v\n",
"if permission_node is not None:\n",
"for k, v in status_node.attrib.items():\n",
"LOG.debug(_('Volume info: %(volume_name)s => %(volume_attributes)s') % {\n 'volume_name': volume_name, 'volume_attributes': volume_attributes})\n",
"volume_attributes['permission.' + k] = v\n",
"return volume_attributes\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'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"For",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(VAR_28, VAR_29):...\n",
"VAR_29.setFormatter(logging.Formatter(VAR_26, datefmt=DATE_FORMAT))\n",
"VAR_28.addHandler(VAR_29)\n"
] |
[
"def add_handler(logger, handler):...\n",
"handler.setFormatter(logging.Formatter(LOG_FORMAT, datefmt=DATE_FORMAT))\n",
"logger.addHandler(handler)\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"VAR_1 = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/home/usr/a-file')\n",
"self.assertEqual(escape_path_argument('/home/usr/a-dir/', VAR_1),\n '/home/usr/a-dir/')\n",
"self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bla',\n VAR_1), '/home/us\\\\ r/a-file\\\\ with\\\\ spaces.bla')\n",
"self.assertEqual(escape_path_argument('/home/us r/a-dir with spaces/x/',\n VAR_1), '/home/us\\\\ r/a-dir\\\\ with\\\\ spaces/x/')\n",
"self.assertEqual(escape_path_argument(\n 'relative something/with cherries and/pickles.delicious', VAR_1),\n 'relative\\\\ something/with\\\\ cherries\\\\ and/pickles.delicious')\n"
] |
[
"def test_escape_path_argument_sh(self):...\n",
"_type = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', _type),\n '/home/usr/a-file')\n",
"self.assertEqual(escape_path_argument('/home/usr/a-dir/', _type),\n '/home/usr/a-dir/')\n",
"self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bla',\n _type), '/home/us\\\\ r/a-file\\\\ with\\\\ spaces.bla')\n",
"self.assertEqual(escape_path_argument('/home/us r/a-dir with spaces/x/',\n _type), '/home/us\\\\ r/a-dir\\\\ with\\\\ spaces/x/')\n",
"self.assertEqual(escape_path_argument(\n 'relative something/with cherries and/pickles.delicious', _type),\n 'relative\\\\ something/with\\\\ cherries\\\\ and/pickles.delicious')\n"
] |
[
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"self.driver._eql_execute('pool', 'select', self.configuration.eqlx_pool, 'show'\n ).AndReturn(['TotalCapacity: 111GB', 'FreeSpace: 11GB'])\n",
"self.mox.ReplayAll()\n",
"VAR_10 = self.driver.get_volume_stats(refresh=True)\n",
"self.assertEqual(VAR_10['total_capacity_gb'], float('111.0'))\n",
"self.assertEqual(VAR_10['free_capacity_gb'], float('11.0'))\n",
"self.assertEqual(VAR_10['vendor_name'], 'Dell')\n"
] |
[
"def test_get_volume_stats(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"self.driver._eql_execute('pool', 'select', self.configuration.eqlx_pool, 'show'\n ).AndReturn(['TotalCapacity: 111GB', 'FreeSpace: 11GB'])\n",
"self.mox.ReplayAll()\n",
"stats = self.driver.get_volume_stats(refresh=True)\n",
"self.assertEqual(stats['total_capacity_gb'], float('111.0'))\n",
"self.assertEqual(stats['free_capacity_gb'], float('11.0'))\n",
"self.assertEqual(stats['vendor_name'], 'Dell')\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_1, VAR_2='', VAR_3=False, VAR_4=False, VAR_5=CLASS_0):...\n",
"if VAR_1.endswith('/'):\n",
"VAR_1 = VAR_1[:-1]\n",
"if VAR_2.endswith('/'):\n",
"VAR_2 = VAR_2[:-1]\n",
"if VAR_4:\n",
"VAR_12 = CLASS_1, VAR_5\n",
"VAR_12 = VAR_5,\n",
"def FUNC_7(self):...\n",
"VAR_13 = FUNC_0(self.groups['path'])\n",
"if self.groups['path'] != VAR_13:\n",
"self.response.headers.set('Location', self.remote + VAR_13)\n",
"self.filename = self.local + urllib.parse.unquote(self.groups['path'])\n",
"return 307, ''\n",
"return VAR_5.respond(self)\n"
] |
[
"def new(local, remote='', dir_index=False, modify=False, handler=FileHandler):...\n",
"if local.endswith('/'):\n",
"local = local[:-1]\n",
"if remote.endswith('/'):\n",
"remote = remote[:-1]\n",
"if modify:\n",
"inherit = ModifyMixIn, handler\n",
"inherit = handler,\n",
"def respond(self):...\n",
"norm_request = normpath(self.groups['path'])\n",
"if self.groups['path'] != norm_request:\n",
"self.response.headers.set('Location', self.remote + norm_request)\n",
"self.filename = self.local + urllib.parse.unquote(self.groups['path'])\n",
"return 307, ''\n",
"return handler.respond(self)\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Return'"
] |
[
"@receiver(models.signals.post_delete, VAR_3=DataGroup)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = VAR_0.get_dg_folder()\n",
"if os.path.isdir(VAR_20):\n",
"shutil.rmtree(VAR_20)\n"
] |
[
"@receiver(models.signals.post_delete, sender=DataGroup)...\n",
"\"\"\"docstring\"\"\"\n",
"dg_folder = instance.get_dg_folder()\n",
"if os.path.isdir(dg_folder):\n",
"shutil.rmtree(dg_folder)\n"
] |
[
0,
0,
0,
0,
0
] |
[
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = CLASS_1.get_user_by_id(VAR_10)\n",
"return VAR_10.as_dto(VAR_10.username)\n"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"requested_user = UserService.get_user_by_id(requested_user)\n",
"return requested_user.as_dto(requested_user.username)\n"
] |
[
0,
0,
0,
0
] |
[
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_1, VAR_2=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = block.sys_block_path(VAR_1, VAR_2=strict)\n",
"VAR_15 = os.path.join(VAR_14, 'bcache')\n",
"if VAR_2 and not os.path.exists(VAR_15):\n",
"VAR_38 = OSError(\"device '{}' did not have existing syspath '{}'\".format(\n VAR_1, VAR_15))\n",
"return VAR_15\n",
"VAR_38.errno = errno.ENOENT\n"
] |
[
"def get_bcache_sys_path(device, strict=True):...\n",
"\"\"\"docstring\"\"\"\n",
"sysfs_path = block.sys_block_path(device, strict=strict)\n",
"path = os.path.join(sysfs_path, 'bcache')\n",
"if strict and not os.path.exists(path):\n",
"err = OSError(\"device '{}' did not have existing syspath '{}'\".format(\n device, path))\n",
"return path\n",
"err.errno = errno.ENOENT\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = {'TEST_APP': 'awskatotest' + CLASS_0.DEFAULT_TEST_ID}\n",
"return st.ScenarioTestRunner.main(CLASS_0, default_binding_overrides=\n defaults, test_case_list=[AwsKatoIntegrationTest])\n"
] |
[
"def main():...\n",
"\"\"\"docstring\"\"\"\n",
"defaults = {'TEST_APP': 'awskatotest' + AwsKatoTestScenario.DEFAULT_TEST_ID}\n",
"return st.ScenarioTestRunner.main(AwsKatoTestScenario,\n default_binding_overrides=defaults, test_case_list=[AwsKatoIntegrationTest]\n )\n"
] |
[
0,
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_5, VAR_1, VAR_7, VAR_8):...\n",
"VAR_21 = datetime.fromtimestamp(VAR_1) - timedelta(days=1)\n",
"VAR_22 = int(datetime(VAR_21.year, VAR_21.month, VAR_21.day, 23, tzinfo=\n pytz.utc).timestamp())\n",
"VAR_20 = 'string' % (VAR_22, VAR_5, VAR_7, VAR_8)\n",
"self.c.execute(VAR_20)\n"
] |
[
"def add_month_data_row(self, inverter_serial, ts, etoday, etotal):...\n",
"y = datetime.fromtimestamp(ts) - timedelta(days=1)\n",
"y_ts = int(datetime(y.year, y.month, y.day, 23, tzinfo=pytz.utc).timestamp())\n",
"query = (\n \"\"\"\n INSERT INTO MonthData (\n TimeStamp,\n Serial,\n DayYield,\n TotalYield \n ) VALUES (\n %s,\n %s,\n %s,\n %s\n );\n \"\"\"\n % (y_ts, inverter_serial, etoday, etotal))\n",
"self.c.execute(query)\n"
] |
[
0,
0,
0,
4,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@bot.callback_query_handler(VAR_3=lambda call: True)...\n",
"bot.answer_callback_query(callback_query_id=call.id, show_alert=False)\n",
"if VAR_2.data == 'off':\n",
"if db.disconnect():\n",
"if VAR_2.data == 'last active':\n",
"bot.turn_off()\n",
"log.error('Cannot stop bot.')\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('last active users'))\n",
"if VAR_2.data == 'total number photos sent':\n",
"bot.send_message(chat_id=config.MY_TELEGRAM, text='Cannot stop bot.')\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat(\n 'total number photos sent'))\n",
"if VAR_2.data == 'photos today':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('photos today'))\n",
"if VAR_2.data == 'number of users':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('number of users'))\n",
"if VAR_2.data == 'number of gadgets':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('number of gadgets'))\n",
"if VAR_2.data == 'uptime':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('uptime'))\n"
] |
[
"@bot.callback_query_handler(func=lambda call: True)...\n",
"bot.answer_callback_query(callback_query_id=call.id, show_alert=False)\n",
"if call.data == 'off':\n",
"if db.disconnect():\n",
"if call.data == 'last active':\n",
"bot.turn_off()\n",
"log.error('Cannot stop bot.')\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('last active users'))\n",
"if call.data == 'total number photos sent':\n",
"bot.send_message(chat_id=config.MY_TELEGRAM, text='Cannot stop bot.')\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat(\n 'total number photos sent'))\n",
"if call.data == 'photos today':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('photos today'))\n",
"if call.data == 'number of users':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('number of users'))\n",
"if call.data == 'number of gadgets':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('number of gadgets'))\n",
"if call.data == 'uptime':\n",
"bot.send_message(config.MY_TELEGRAM, text=get_admin_stat('uptime'))\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_2(self, VAR_7):...\n",
"VAR_25 = ''\n",
"VAR_26 = '%s> ' % self.configuration.eqlx_group_name\n",
"while not VAR_25.endswith(VAR_26):\n",
"VAR_25 += VAR_7.recv(102400)\n",
"VAR_0.debug(_('CLI output\\n%s'), VAR_25)\n",
"return VAR_25.splitlines()\n"
] |
[
"def _get_output(self, chan):...\n",
"out = ''\n",
"ending = '%s> ' % self.configuration.eqlx_group_name\n",
"while not out.endswith(ending):\n",
"out += chan.recv(102400)\n",
"LOG.debug(_('CLI output\\n%s'), out)\n",
"return out.splitlines()\n"
] |
[
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Expr'",
"Return'"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import re\n",
"from bs4 import BeautifulSoup\n",
"from cmstestsuite.web import GenericRequest, LoginRequest\n",
"def FUNC_0(self):...\n",
"if not LoginRequest.test_success(self):\n",
"return False\n",
"VAR_4 = re.compile('Failed to log in.')\n",
"if VAR_4.search(self.res_data) is not None:\n",
"return False\n",
"VAR_5 = re.compile(self.username)\n",
"if VAR_5.search(self.res_data) is None:\n",
"return False\n",
"return True\n"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import re\n",
"from bs4 import BeautifulSoup\n",
"from cmstestsuite.web import GenericRequest, LoginRequest\n",
"def test_success(self):...\n",
"if not LoginRequest.test_success(self):\n",
"return False\n",
"fail_re = re.compile('Failed to log in.')\n",
"if fail_re.search(self.res_data) is not None:\n",
"return False\n",
"username_re = re.compile(self.username)\n",
"if username_re.search(self.res_data) is None:\n",
"return False\n",
"return True\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@VAR_1.route('/login', methods=['GET', 'POST'])...\n",
"if VAR_14.g.user:\n",
"return VAR_14.redirect(FUNC_5())\n",
"VAR_4 = forms.LoginForm(VAR_14.request.form)\n",
"if VAR_14.request.method == 'POST' and VAR_4.validate():\n",
"if VAR_0.config['MAINTENANCE_MODE'] and not VAR_0.config[\n",
"return VAR_14.render_template('login.html', VAR_4=form)\n",
"VAR_14.flash(VAR_14.Markup(\n '<strong>Logins are currently disabled.</strong>'), 'danger')\n",
"VAR_12 = VAR_4.username.data.strip()\n",
"return VAR_14.redirect(VAR_14.url_for('account.login'))\n",
"VAR_13 = VAR_4.password.data\n",
"VAR_3 = models.User.by_username(VAR_12)\n",
"if not VAR_3:\n",
"VAR_3 = models.User.by_email(VAR_12)\n",
"if not VAR_3 or VAR_13 != VAR_3.password_hash:\n",
"VAR_14.flash(VAR_14.Markup(\n '<strong>Login failed!</strong> Incorrect username or password.'), 'danger'\n )\n",
"if VAR_3.is_banned:\n",
"return VAR_14.redirect(VAR_14.url_for('account.login'))\n",
"VAR_19 = models.Ban.banned(VAR_3.id, None).first().reason\n",
"if VAR_3.status != models.UserStatusType.ACTIVE:\n",
"VAR_20 = 'string'.format(VAR_19)\n",
"VAR_14.flash(VAR_14.Markup(\n '<strong>Login failed!</strong> Account is not activated.'), 'danger')\n",
"VAR_3.last_login_date = datetime.utcnow()\n",
"VAR_14.flash(VAR_14.Markup(VAR_20), 'danger')\n",
"return VAR_14.redirect(VAR_14.url_for('account.login'))\n",
"VAR_3.last_login_ip = ip_address(VAR_14.request.remote_addr).packed\n",
"return VAR_14.redirect(VAR_14.url_for('account.login'))\n",
"if not VAR_0.config['MAINTENANCE_MODE']:\n",
"db.session.add(VAR_3)\n",
"VAR_14.g.user = VAR_3\n",
"db.session.commit()\n",
"VAR_14.session['user_id'] = VAR_3.id\n",
"VAR_14.session.permanent = True\n",
"VAR_14.session.modified = True\n",
"return VAR_14.redirect(FUNC_5())\n"
] |
[
"@bp.route('/login', methods=['GET', 'POST'])...\n",
"if flask.g.user:\n",
"return flask.redirect(redirect_url())\n",
"form = forms.LoginForm(flask.request.form)\n",
"if flask.request.method == 'POST' and form.validate():\n",
"if app.config['MAINTENANCE_MODE'] and not app.config['MAINTENANCE_MODE_LOGINS'\n",
"return flask.render_template('login.html', form=form)\n",
"flask.flash(flask.Markup('<strong>Logins are currently disabled.</strong>'),\n 'danger')\n",
"username = form.username.data.strip()\n",
"return flask.redirect(flask.url_for('account.login'))\n",
"password = form.password.data\n",
"user = models.User.by_username(username)\n",
"if not user:\n",
"user = models.User.by_email(username)\n",
"if not user or password != user.password_hash:\n",
"flask.flash(flask.Markup(\n '<strong>Login failed!</strong> Incorrect username or password.'), 'danger'\n )\n",
"if user.is_banned:\n",
"return flask.redirect(flask.url_for('account.login'))\n",
"ban_reason = models.Ban.banned(user.id, None).first().reason\n",
"if user.status != models.UserStatusType.ACTIVE:\n",
"ban_str = (\n '<strong>Login failed!</strong> You are banned with the reason \"{0}\" If you believe that this is a mistake, contact a moderator on IRC.'\n .format(ban_reason))\n",
"flask.flash(flask.Markup(\n '<strong>Login failed!</strong> Account is not activated.'), 'danger')\n",
"user.last_login_date = datetime.utcnow()\n",
"flask.flash(flask.Markup(ban_str), 'danger')\n",
"return flask.redirect(flask.url_for('account.login'))\n",
"user.last_login_ip = ip_address(flask.request.remote_addr).packed\n",
"return flask.redirect(flask.url_for('account.login'))\n",
"if not app.config['MAINTENANCE_MODE']:\n",
"db.session.add(user)\n",
"flask.g.user = user\n",
"db.session.commit()\n",
"flask.session['user_id'] = user.id\n",
"flask.session.permanent = True\n",
"flask.session.modified = True\n",
"return flask.redirect(redirect_url())\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
] |
[
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._get_users_api().is_current_user_gae_admin(self.request)\n"
] |
[
"def is_current_user_gae_admin(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._get_users_api().is_current_user_gae_admin(self.request)\n"
] |
[
0,
0,
0
] |
[
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_5(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_read_json(%s, %s)', VAR_3[:500], str(VAR_6)[:500])\n",
"if not self._requests:\n",
"return None\n",
"VAR_6.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == VAR_3:\n",
"self.fail('Unknown request %s' % VAR_3)\n",
"VAR_9 = self._requests.pop(i)\n",
"if len(VAR_9) != 3:\n",
"self.fail('Expected json request, got normal data; %s' % VAR_3)\n",
"VAR_10, VAR_11, VAR_12 = VAR_9\n",
"if callable(VAR_11):\n",
"VAR_11(VAR_6)\n",
"self.assertEqual(VAR_11, VAR_6)\n",
"if VAR_12 is not None:\n",
"return VAR_12\n",
"return None\n"
] |
[
"def _url_read_json(self, url, **kwargs):...\n",
"logging.warn('url_read_json(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)\n",
"data = self._requests.pop(i)\n",
"if len(data) != 3:\n",
"self.fail('Expected json request, got normal data; %s' % url)\n",
"_, expected_kwargs, result = data\n",
"if callable(expected_kwargs):\n",
"expected_kwargs(kwargs)\n",
"self.assertEqual(expected_kwargs, kwargs)\n",
"if result is not None:\n",
"return result\n",
"return None\n"
] |
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_28(self):...\n",
"VAR_13 = -1\n",
"self.cursor.execute('create table t1(n int)')\n",
"self.cursor.execute('insert into t1 values (?)', VAR_13)\n",
"VAR_20 = self.cursor.execute('select n from t1').fetchone()[0]\n",
"self.assertEqual(VAR_20, VAR_13)\n"
] |
[
"def test_negative_int(self):...\n",
"value = -1\n",
"self.cursor.execute('create table t1(n int)')\n",
"self.cursor.execute('insert into t1 values (?)', value)\n",
"result = self.cursor.execute('select n from t1').fetchone()[0]\n",
"self.assertEqual(result, value)\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_17(self, VAR_9):...\n",
"if not self.logged_in():\n",
"print('shrub: unauthenticated; use \"login [username] to log in first')\n",
"VAR_20 = self.send_cmd('edit_comment{} {}'.format(self.insecure_mode, VAR_9))\n",
"return\n",
"print(VAR_20)\n"
] |
[
"def do_edit_comment(self, line):...\n",
"if not self.logged_in():\n",
"print('shrub: unauthenticated; use \"login [username] to log in first')\n",
"response = self.send_cmd('edit_comment{} {}'.format(self.insecure_mode, line))\n",
"return\n",
"print(response)\n"
] |
[
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_24(VAR_25, VAR_23, *VAR_24):...\n",
"if VAR_23 == 'on_after_task':\n",
"VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n",
"self.assertEqual(True, VAR_50)\n",
"self.assertEqual(False, VAR_51)\n",
"self.assertEqual({'pool': 'default'}, VAR_5)\n",
"self.assertEqual(VAR_22, VAR_52)\n"
] |
[
"def call_hook(_botobj, name, *args):...\n",
"if name == 'on_after_task':\n",
"failure, internal_failure, dimensions, summary = args\n",
"self.assertEqual(True, failure)\n",
"self.assertEqual(False, internal_failure)\n",
"self.assertEqual({'pool': 'default'}, dimensions)\n",
"self.assertEqual(result, summary)\n"
] |
[
0,
0,
0,
0,
0,
0,
0
] |
[
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@query_cached...\n",
"if self._connection is None:\n",
"self._connection = self._engine.connect()\n",
"VAR_22 = pandas.read_sql(VAR_20=sql, con=self._connection, params=bindings)\n",
"return VAR_22\n"
] |
[
"@query_cached...\n",
"if self._connection is None:\n",
"self._connection = self._engine.connect()\n",
"dataframe = pandas.read_sql(sql=sql, con=self._connection, params=bindings)\n",
"return dataframe\n"
] |
[
0,
0,
0,
0,
0
] |
[
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, **VAR_2):...\n",
"CLASS_0.invalidate(VAR_1.user_profile.user)\n"
] |
[
"def invalidate_content(sender, instance, **kwargs):...\n",
"CachedTopMenu.invalidate(instance.user_profile.user)\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Expr'"
] |
[
"def __str__(self):...\n",
"return ''\n"
] |
[
"def __str__(self):...\n",
"return ''\n"
] |
[
0,
0
] |
[
"FunctionDef'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.