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.appe... | [
"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... | [
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_IN... | [
"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 I... | [
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'",
"Condi... |
[
"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(... | [
"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 = ... | [
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=... | [
"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_cla... | [
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",... | [
"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 acces... | [
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].aut... | [
"@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.r... | [
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",
"p... | [
"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):...\... | [
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'] = ... | [
"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['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='... | [
"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(fragm... | [
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 ... | [
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",
... | [
"def foo(p, cwd):...\n",
"if not len(p):\n",
"found.append('/%s' % ('/'.join(cwd),))\n",
"if p[0] == '.':\n",
"foo(p[1:], cwd)\n",
"if p[0] == '..':\n",
"foo(p[1:], cwd[:-1])\n",
"names = [x[A_NAME] for x in self.get_path('/'.join(cwd))]\n",
"matches = [x for x in names if fnmatch.fnmatchcase(x, p[0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'"
] |
[
"def __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'], 'acce... | [
"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', ... | [
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 UserD... | [
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"... | [
"@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__.... | [
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_... | [
"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_boun... | [
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",
... | [
"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.P... | [
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='ap... | [
"@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.... | [
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... | [
"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'",
"As... |
[
"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/',... | [
"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/',\... | [
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'"... |
[
"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('Cac... | [
"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.se... | [
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 th... | [
"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')... | [
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",
"... | [
"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.fie... | [
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(VA... | [
"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... | [
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.... | [
"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('... | [
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(V... | [
"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.exe... | [
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_exam... | [
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.lastDat... | [
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(ur... | [
"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.asse... | [
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]... | [
"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 i... | [
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.bl... | [
"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... | [
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_volu... | [
"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.dr... | [
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.g... | [
"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",
... | [
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_... | [
"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 '{}'\".forma... | [
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 ... | [
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(c... | [
"@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(conf... | [
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_succe... | [
"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... | [
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_... | [
"@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'\... | [
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'"... |
[
"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"... | [
"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)... | [
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, su... | [
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.