lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(VAR_2, VAR_3, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = VAR_3[0]\n",
"VAR_15 = VAR_3[1:]\n",
"if len(VAR_15) == 0:\n",
"VAR_2[VAR_14] = VAR_4\n",
"if VAR_14 in VAR_2:\n",
"FUNC_2(VAR_2, VAR_15, VAR_4)\n",
"VAR_33 = {}\n",
"FUNC_2(VAR_33, VAR_15, VAR_4)\n",
"VAR_2[VAR_14] = ... | [
"def _override_cfg(container, yamlkeys, value):...\n",
"\"\"\"docstring\"\"\"\n",
"key = yamlkeys[0]\n",
"rest = yamlkeys[1:]\n",
"if len(rest) == 0:\n",
"container[key] = value\n",
"if key in container:\n",
"_override_cfg(container, rest, value)\n",
"subtree = {}\n",
"_override_cfg(subtree, rest,... | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_2(self):...\n",
"return \"\"\"Task: %s (ID %d)\nFile: %s\n\"\"\" % (self.task[1], self.task[0], repr\n (self.filenames)) + GenericRequest.specific_info(self)\n"
] | [
"def specific_info(self):...\n",
"return \"\"\"Task: %s (ID %d)\nFile: %s\n\"\"\" % (self.task[1], self.task[0], repr\n (self.filenames)) + GenericRequest.specific_info(self)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_21 == '/':\n",
"return True\n",
"VAR_58 = self.getfile(VAR_21)\n",
"VAR_58 = None\n",
"if VAR_58 is None or VAR_58 is False:\n",
"return False\n",
"if VAR_58[VAR_2] == VAR_12:\n",
"return True\n",
"return False\n"
] | [
"def isdir(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"if path == '/':\n",
"return True\n",
"dir = self.getfile(path)\n",
"dir = None\n",
"if dir is None or dir is False:\n",
"return False\n",
"if dir[A_TYPE] == T_DIR:\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_10(self, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"for t in ids_to_tasks(VAR_12).split(','):\n",
"VAR_29 = get_task_module(t)\n",
"if hasattr(VAR_29, 'add_cmdline_args'):\n",
"VAR_29.add_cmdline_args(self)\n"
] | [
"def add_task_args(self, task):...\n",
"\"\"\"docstring\"\"\"\n",
"for t in ids_to_tasks(task).split(','):\n",
"agent = get_task_module(t)\n",
"if hasattr(agent, 'add_cmdline_args'):\n",
"agent.add_cmdline_args(self)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"if not self.current_user:\n",
"self.render('../login.html')\n",
"self.redirect('/')\n",
"return\n"
] | [
"def get(self):...\n",
"if not self.current_user:\n",
"self.render('../login.html')\n",
"self.redirect('/')\n",
"return\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(VAR_2):...\n",
"VAR_14 = {}\n",
"VAR_14['last_name'] = VAR_2.META.get('Shibboleth-sn', '')\n",
"VAR_14['first_name'] = VAR_2.META.get('Shibboleth-givenName', '')\n",
"VAR_14['email'] = VAR_2.META.get('Shibboleth-mail', '')\n",
"return VAR_14\n"
] | [
"def get_shib_info_from_request(request):...\n",
"info = {}\n",
"info['last_name'] = request.META.get('Shibboleth-sn', '')\n",
"info['first_name'] = request.META.get('Shibboleth-givenName', '')\n",
"info['email'] = request.META.get('Shibboleth-mail', '')\n",
"return info\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"return \"'\" + MySQLdb.escape_string(VAR_6) + \"'\"\n"
] | [
"def sqlForNonNone(self, value):...\n",
"\"\"\"docstring\"\"\"\n",
"return \"'\" + MySQLdb.escape_string(value) + \"'\"\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_3(VAR_1, VAR_2, VAR_3='', VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_4(VAR_1, VAR_2['access_token'], VAR_6='', VAR_3=token_type,\n VAR_4=extra_data)\n"
] | [
"def oauth2_token_setter(remote, resp, token_type='', extra_data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return token_setter(remote, resp['access_token'], secret='', token_type=\n token_type, extra_data=extra_data)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_44(self):...\n",
"self.cursor.execute('create table t1(a int, b int, c int, d int)')\n",
"self.cursor.execute('insert into t1 values(1,2,3,4)')\n",
"VAR_24 = self.cursor.execute('select * from t1').fetchone()\n",
"VAR_20 = str(VAR_24)\n",
"self.assertEqual(VAR_20, '(1, 2, 3, 4)')\n",
"VAR_20 =... | [
"def test_row_repr(self):...\n",
"self.cursor.execute('create table t1(a int, b int, c int, d int)')\n",
"self.cursor.execute('insert into t1 values(1,2,3,4)')\n",
"row = self.cursor.execute('select * from t1').fetchone()\n",
"result = str(row)\n",
"self.assertEqual(result, '(1, 2, 3, 4)')\n",
"result =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"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}/containers'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(V... | [
"@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}/containers'.format(**locals())\n",
"response = self.client.get(url)... | [
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'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr... |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"VAR_12 = ''\n",
"VAR_40 = VAR_41 = None\n",
"if VAR_1.sort_field and ',' in VAR_1.sort_field:\n",
"VAR_12 = ', '.join(['`tab{0}`.`{1}` {2}'.format(VAR_0, VAR_34.split()[0].\n strip(), VAR_34.split()[1].strip()) for VAR_34 in VAR_1.sort_field.\n split(',')])\n",
"VA... | [
"def get_order_by(doctype, meta):...\n",
"order_by = ''\n",
"sort_field = sort_order = None\n",
"if meta.sort_field and ',' in meta.sort_field:\n",
"order_by = ', '.join(['`tab{0}`.`{1}` {2}'.format(doctype, f.split()[0].\n strip(), f.split()[1].strip()) for f in meta.sort_field.split(',')])\n",
"sort_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_4 is None or VAR_4 == '':\n",
"return {} if not self.null else None\n",
"while isinstance(VAR_4, str):\n",
"if isinstance(VAR_4, dict):\n",
"VAR_4 = json_decode(VAR_4)\n",
"return CLASS_2(**value)\n",
"if isinstance(VAR_4, str):\n",... | [
"def to_python(self, value):...\n",
"\"\"\"docstring\"\"\"\n",
"if value is None or value == '':\n",
"return {} if not self.null else None\n",
"while isinstance(value, str):\n",
"if isinstance(value, dict):\n",
"value = json_decode(value)\n",
"return JsonDict(**value)\n",
"if isinstance(value, str):... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def __len__(self):...\n",
"return len(self.nodes)\n"
] | [
"def __len__(self):...\n",
"return len(self.nodes)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@VAR_0.filter...\n",
"return reverse('model-remove', VAR_5=_normal_kwargs(model_object.\n course_instance, model_name, id=model_object.id))\n"
] | [
"@register.filter...\n",
"return reverse('model-remove', kwargs=_normal_kwargs(model_object.\n course_instance, model_name, id=model_object.id))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_20(self, VAR_10=None, VAR_11=None, VAR_1=None):...\n",
"VAR_10 = self.add_rule(VAR_10, VAR_11, VAR_1)\n",
"VAR_13 = self.get_rule(VAR_10)\n",
"def FUNC_39(VAR_101):...\n",
"if VAR_101.input:\n",
"VAR_13.set_input(*VAR_101.input[0], **ruleinfo.input[1])\n",
"if VAR_101.output:\n",
"VAR_13.set... | [
"def rule(self, name=None, lineno=None, snakefile=None):...\n",
"name = self.add_rule(name, lineno, snakefile)\n",
"rule = self.get_rule(name)\n",
"def decorate(ruleinfo):...\n",
"if ruleinfo.input:\n",
"rule.set_input(*ruleinfo.input[0], **ruleinfo.input[1])\n",
"if ruleinfo.output:\n",
"rule.set_out... | [
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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Con... |
[
"def FUNC_9(self):...\n",
"self.test_strings = ('normal_string', 'string with spaces',\n 'string with quotes\"a', \"string with s-quotes'b\", 'bsn \\n A',\n 'unrecognized \\\\q escape')\n"
] | [
"def setUp(self):...\n",
"self.test_strings = ('normal_string', 'string with spaces',\n 'string with quotes\"a', \"string with s-quotes'b\", 'bsn \\n A',\n 'unrecognized \\\\q escape')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_0(self, VAR_0):...\n",
"return VAR_0.id\n"
] | [
"def to_representation(self, obj):...\n",
"return obj.id\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import sys\n",
"from os import system\n",
"import psycopg2\n",
"import urllib.parse\n",
"import os\n",
"def FUNC_0():...\n",
"if 'DATABASE_URL' in os.environ and os.environ['DATABASE_URL']:\n",
"urllib.parse.uses_netloc.append('postgres')\n",
"VAR_12 = psycopg2.connect(database='expenses')\n",
"V... | [
"import sys\n",
"from os import system\n",
"import psycopg2\n",
"import urllib.parse\n",
"import os\n",
"def check_heroku_db():...\n",
"if 'DATABASE_URL' in os.environ and os.environ['DATABASE_URL']:\n",
"urllib.parse.uses_netloc.append('postgres')\n",
"conn = psycopg2.connect(database='expenses')\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(VAR_1: HttpRequest):...\n",
""
] | [
"def action_add_single_media(request: HttpRequest):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"from __future__ import unicode_literals\n",
"import frappe, json\n",
"from frappe.utils import cstr, unique\n",
"from frappe import _\n",
"from six import string_types\n",
"def FUNC_0(VAR_0):...\n",
"VAR_12 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n",
"def FUNC_6():...\n"... | [
"from __future__ import unicode_literals\n",
"import frappe, json\n",
"from frappe.utils import cstr, unique\n",
"from frappe import _\n",
"from six import string_types\n",
"def sanitize_searchfield(searchfield):...\n",
"blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n '... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'",
"For",
"Condition",
"Expr'",
"Condition",
... |
[
"def __init__(self, VAR_18, VAR_35=10000, **VAR_16):...\n",
"CLASS_17.__init__(self, VAR_18, VAR_35=length, **kw)\n"
] | [
"def __init__(self, item, length=10000, **kw):...\n",
"VLength.__init__(self, item, length=length, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_17(self, VAR_9=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(VAR_13.PROCESS_TYPE_PLASMA_STORE, VAR_9=check_alive)\n"
] | [
"def kill_plasma_store(self, check_alive=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(ray_constants.PROCESS_TYPE_PLASMA_STORE,\n check_alive=check_alive)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"import os\n",
"import sys\n",
"import unittest\n",
"from coalib.misc.Shell import escape_path_argument, prepare_string_argument, run_interactive_shell_command, run_shell_command\n",
"def FUNC_0(self):...\n",
"VAR_1 = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/hom... | [
"import os\n",
"import sys\n",
"import unittest\n",
"from coalib.misc.Shell import escape_path_argument, prepare_string_argument, run_interactive_shell_command, run_shell_command\n",
"def test_escape_path_argument_sh(self):...\n",
"_type = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-fil... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
] | [
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"E... |
[
"@view_config(route_name='note', permission='edit', request_method='GET',...\n",
"return dict(title='Redigera anteckning', VAR_2=context.note)\n"
] | [
"@view_config(route_name='note', permission='edit', request_method='GET',...\n",
"return dict(title='Redigera anteckning', note=context.note)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_6(self, VAR_10, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def create_volume_from_snapshot(self, volume, snapshot):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_4(self, VAR_1, VAR_3, VAR_4=6, VAR_5=10):...\n",
"if self.is_sys_user(VAR_1):\n",
"VAR_19 = textutil.gen_password_hash(VAR_3, VAR_4, VAR_5)\n",
"VAR_20 = \"echo '{0}'|pw usermod {1} -H 0 \".format(VAR_19, VAR_1)\n",
"VAR_21, VAR_22 = shellutil.run_get_output(VAR_20, log_cmd=False)\n",
"if VAR_21... | [
"def chpasswd(self, username, password, crypt_id=6, salt_len=10):...\n",
"if self.is_sys_user(username):\n",
"passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len)\n",
"cmd = \"echo '{0}'|pw usermod {1} -H 0 \".format(passwd_hash, username)\n",
"ret, output = shellutil.run_get_output(cmd, l... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition"
] |
[
"def FUNC_12(VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = db.connection.cursor(db.pymysql.cursors.DictCursor)\n",
"VAR_11.execute('string', (VAR_1, VAR_2))\n",
"VAR_14 = VAR_11.fetchone()\n",
"VAR_15 = VAR_14['state'] if VAR_14 else 'REVEALED'\n",
"VAR_11.execute('string', {'player_id': VA... | [
"def reveal_achievement(achievement_id, player_id):...\n",
"\"\"\"docstring\"\"\"\n",
"cursor = db.connection.cursor(db.pymysql.cursors.DictCursor)\n",
"cursor.execute(\n \"\"\"SELECT\n state\n FROM player_achievements\n WHERE achieve... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_4(VAR_11, VAR_12=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1['VERBOSITY'] >= 1:\n",
"VAR_0.info('$ ' + ' '.join(VAR_11))\n",
"VAR_19 = dict()\n",
"if VAR_1['VERBOSITY'] >= 3:\n",
"VAR_19['stdout'] = io.open(os.devnull, 'wb')\n",
"VAR_32 = subprocess.call(VAR_11, **kwargs)\n",
"VAR_... | [
"def sh(cmdline, ignore_failure=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if CONFIG['VERBOSITY'] >= 1:\n",
"logger.info('$ ' + ' '.join(cmdline))\n",
"kwargs = dict()\n",
"if CONFIG['VERBOSITY'] >= 3:\n",
"kwargs['stdout'] = io.open(os.devnull, 'wb')\n",
"ret = subprocess.call(cmdline, **kwargs)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition"
] |
[
"\"\"\"string\"\"\"\n",
"import sys\n",
"import citest.aws_testing as aws\n",
"import citest.json_contract as jc\n",
"import citest.service_testing as st\n",
"import spinnaker_testing as sk\n",
"import spinnaker_testing.gate as gate\n",
"\"\"\"string\"\"\"\n",
"@classmethod...\n",
"\"\"\"docstring... | [
"\"\"\"\nSmoke test to see if Spinnaker can interoperate with Amazon Web Services.\n\nSee testable_service/integration_test.py and spinnaker_testing/spinnaker.py\nfor more details.\n\nThe smoke test will use ssh to peek at the spinnaker configuration\nto determine the managed project it should verify, and to determ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Expr'",
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self\n",
"VAR_12 = []\n",
"def FUNC_29(VAR_13):...\n",
"def FUNC_30(VAR_13):...\n",
"self.fail('authenticate should not be called')\n",
"@classmethod...\n",
"return [FUNC_29, FUNC_30]\n"
] | [
"def test_authentication_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"test = self\n",
"calls = []\n",
"def failing(request):...\n",
"def skipped(request):...\n",
"self.fail('authenticate should not be called')\n",
"@classmethod...\n",
"return [failing, skipped]\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"FunctionDef'",
"Expr'",
"Condition",
"Return'"
] |
[
"from base import Field\n",
"VAR_0 = 255\n",
"VAR_1 = 'CHAR'\n",
"def __init__(self, VAR_2=VAR_0, *VAR_3, **VAR_4):...\n",
"super(CLASS_0, self).__init__(*VAR_3, **kwargs)\n",
"self.max_length = VAR_2\n",
"def FUNC_0(self):...\n",
"if self.model_class._meta.database:\n",
"return '{0}({1})'.format(se... | [
"from base import Field\n",
"MAX_LENGTH = 255\n",
"TYPE = 'CHAR'\n",
"def __init__(self, max_length=MAX_LENGTH, *args, **kwargs):...\n",
"super(CharField, self).__init__(*args, **kwargs)\n",
"self.max_length = max_length\n",
"def get_db_field(self):...\n",
"if self.model_class._meta.database:\n",
"r... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(VAR_0, VAR_1):...\n",
"return os.utime(VAR_0, VAR_1, follow_symlinks=os.utime not in os.\n supports_follow_symlinks)\n"
] | [
"def lutime(f, times):...\n",
"return os.utime(f, times, follow_symlinks=os.utime not in os.\n supports_follow_symlinks)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import os\n",
"import sys\n",
"import unittest\n",
"from coalib.misc.Shell import escape_path_argument, prepare_string_argument, run_interactive_shell_command, run_shell_command\n",
"def FUNC_0(self):...\n",
"VAR_1 = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/hom... | [
"import os\n",
"import sys\n",
"import unittest\n",
"from coalib.misc.Shell import escape_path_argument, prepare_string_argument, run_interactive_shell_command, run_shell_command\n",
"def test_escape_path_argument_sh(self):...\n",
"_type = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-fil... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
] | [
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"E... |
[
"\"\"\"string\"\"\"\n",
"import argparse\n",
"import time\n",
"import csv\n",
"import logging\n",
"import sys\n",
"import shutil\n",
"from benchmark import config, data_service\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"logging.debug('Getting cli arguments')\n",
"VAR_0 = argparse.Ar... | [
"\"\"\" Main module for the benchmark. It reads the command line arguments, reads the benchmark configuration, \ndetermines the runtime mode (dynamic vs. static); if dynamic, gets the benchmark data from the server,\nruns the benchmarks, and records the timer results. \"\"\"\n",
"import argparse\n",
"import tim... | [
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(VAR_17, list):\n",
"return ','.join([(str(x) if x is not None else '') for x in VAR_17])\n",
"return str(VAR_17)\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(value, list):\n",
"return ','.join([(str(x) if x is not None else '') for x in value])\n",
"return str(value)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_61 = self._accounts[VAR_16.user_auth.username]\n",
"self._services_by_user[VAR_16.user_auth.uuid] = VAR_61.services\n",
"yield defer.succeed(None)\n"
] | [
"@defer.inlineCallbacks...\n",
"account = self._accounts[leap_session.user_auth.username]\n",
"self._services_by_user[leap_session.user_auth.uuid] = account.services\n",
"yield defer.succeed(None)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@api.multi...\n",
"\"\"\"docstring\"\"\"\n",
"self.filtered(lambda p: not p.partner_latitude or not p.partner_longitude\n ).geo_localize()\n",
"for VAR_54 in self.filtered(lambda p: p.partner_latitude and p.\n",
"VAR_26 = GeoPoint.from_latlon(self.env.cr, VAR_54.partner_latitude, VAR_54.\n partner_lo... | [
"@api.multi...\n",
"\"\"\"docstring\"\"\"\n",
"self.filtered(lambda p: not p.partner_latitude or not p.partner_longitude\n ).geo_localize()\n",
"for partner in self.filtered(lambda p: p.partner_latitude and p.\n",
"geo_point = GeoPoint.from_latlon(self.env.cr, partner.partner_latitude,\n partner.partn... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"For",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_16(self, VAR_21):...\n",
"for i, VAR_18 in enumerate(list(self._handlers)):\n",
"VAR_40, VAR_41, VAR_41 = VAR_18\n",
"self._received.append(VAR_21)\n",
"VAR_42 = VAR_40(VAR_21)\n",
"VAR_21, VAR_42 = VAR_42\n",
"if VAR_42:\n",
"self._handlers.remove(VAR_18)\n"
] | [
"def _receive_message(self, msg):...\n",
"for i, handler in enumerate(list(self._handlers)):\n",
"handle_message, _, _ = handler\n",
"self._received.append(msg)\n",
"handled = handle_message(msg)\n",
"msg, handled = handled\n",
"if handled:\n",
"self._handlers.remove(handler)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"import logging\n",
"from google.appengine.api import users\n",
"from google.appengine.ext import ndb\n",
"from gae_libs.handlers.base_handler import BaseHandler\n",
"from gae_libs.handlers.base_handler import Permission\n",
"from gae_libs.http import auth_util\n",
"from libs import analysis_status\n",
... | [
"import logging\n",
"from google.appengine.api import users\n",
"from google.appengine.ext import ndb\n",
"from gae_libs.handlers.base_handler import BaseHandler\n",
"from gae_libs.handlers.base_handler import Permission\n",
"from gae_libs.http import auth_util\n",
"from libs import analysis_status\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'"... |
[
"def __getstate__(self):...\n",
"return self.serialize()\n"
] | [
"def __getstate__(self):...\n",
"return self.serialize()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"for VAR_7 in self.targets:\n",
"self.schedule(self.add_comment, (VAR_7, self.msgfun()))\n",
"if len(self.targets) == 0:\n",
"self.schedule(self.scan_targets_loop)\n",
"self.schedule(self.comment_loop)\n"
] | [
"def comment_loop(self):...\n",
"for t in self.targets:\n",
"self.schedule(self.add_comment, (t, self.msgfun()))\n",
"if len(self.targets) == 0:\n",
"self.schedule(self.scan_targets_loop)\n",
"self.schedule(self.comment_loop)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_6, VAR_8=1):...\n",
"VAR_35 = dateutil_parse(VAR_6, ignoretz=True).replace(microsecond=0)\n",
"return VAR_35 - timedelta(seconds=(dt - dt.min).seconds % alignment)\n"
] | [
"def parse_datetime(value, alignment=1):...\n",
"dt = dateutil_parse(value, ignoretz=True).replace(microsecond=0)\n",
"return dt - timedelta(seconds=(dt - dt.min).seconds % alignment)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_8():...\n",
"VAR_10 = get_executing_test()\n",
"VAR_5 = VAR_10.spynner_browser\n",
"if VAR_5:\n",
"VAR_10.spynner_browser = None\n",
"VAR_5.close()\n"
] | [
"def stop_spynner_browser():...\n",
"test = get_executing_test()\n",
"browser = test.spynner_browser\n",
"if browser:\n",
"test.spynner_browser = None\n",
"browser.close()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"VAR_1 = '/api/apps'\n",
"VAR_2 = self.client.post(VAR_1)\n",
"self.assertEqual(VAR_2.status_code, 201)\n",
"VAR_3 = VAR_2.data['id']\n",
"VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d... | [
"def test_run_chaos(self):...\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': j... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"E... |
[
"def FUNC_6(self, VAR_26):...\n",
"if VAR_26:\n",
"VAR_106 = int(VAR_26, 36)\n",
"abort(404, 'page not found')\n",
"return Message._byID(VAR_106, True)\n"
] | [
"def run(self, message_id):...\n",
"if message_id:\n",
"aid = int(message_id, 36)\n",
"abort(404, 'page not found')\n",
"return Message._byID(aid, True)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"@odin.map_list_field(to_field='array_string')...\n",
"return VAR_47.split(',')\n"
] | [
"@odin.map_list_field(to_field='array_string')...\n",
"return value.split(',')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@app.route('/api/settings', methods=['PUT'])...\n",
"controller.settings.update(VAR_3)\n",
"VAR_13 = controller.settings.to_map()\n",
"return dict([setting for setting in VAR_13.items() if setting[0] in VAR_3])\n"
] | [
"@app.route('/api/settings', methods=['PUT'])...\n",
"controller.settings.update(json)\n",
"updated_settings = controller.settings.to_map()\n",
"return dict([setting for setting in updated_settings.items() if setting[0] in\n json])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Return'"
] |
[
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"VAR_5 = None\n",
"VAR_5 = tempfile.NamedTemporaryFile(delete=False)\n",
"if VAR_5:\n",
"VAR_5.close()\n",
"os.remove(VAR_5.name)\n",
"self._mox.StubOutWithMock(url_helper, 'UrlOpen')\n",
"VAR_12 = 'data'\n",
"url_helper.UrlOpen(mox.IgnoreArg(), method='GET').AndReturn(VAR... | [
"def testDownloadFile(self):...\n",
"local_file = None\n",
"local_file = tempfile.NamedTemporaryFile(delete=False)\n",
"if local_file:\n",
"local_file.close()\n",
"os.remove(local_file.name)\n",
"self._mox.StubOutWithMock(url_helper, 'UrlOpen')\n",
"file_data = 'data'\n",
"url_helper.UrlOpen(mox.Ign... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"if self._user_notified_about_crash or self._IsServerAlive():\n",
"return\n",
"self._user_notified_about_crash = True\n",
"if self._server_stderr:\n",
"VAR_27 = ''.join(server_stderr_file.readlines()[:-VAR_1])\n",
"vimsupport.PostVimMessage(VAR_3)\n",
"vimsupport.PostMultiLin... | [
"def _NotifyUserIfServerCrashed(self):...\n",
"if self._user_notified_about_crash or self._IsServerAlive():\n",
"return\n",
"self._user_notified_about_crash = True\n",
"if self._server_stderr:\n",
"error_output = ''.join(server_stderr_file.readlines()[:-\n NUM_YCMD_STDERR_LINES_ON_CRASH])\n",
"vimsup... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
""
] | [
"def book_ride(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_4(self):...\n",
"VAR_1 = '/api/apps'\n",
"VAR_2 = self.client.post(VAR_1)\n",
"self.assertEqual(VAR_2.status_code, 201)\n",
"VAR_3 = VAR_2.data['id']\n",
"VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d... | [
"def test_destroy_chaos(self):...\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... | [
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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_4(self):...\n",
"self._tab_after('s')\n",
"eq_(self.terminal.method_calls, [('write', ('et ',), {})])\n"
] | [
"def test_command_completion(self):...\n",
"self._tab_after('s')\n",
"eq_(self.terminal.method_calls, [('write', ('et ',), {})])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_38(VAR_65, VAR_66):...\n",
"VAR_79 = ElementTree.parse(VAR_66).getroot()\n",
"if VAR_79.tag != 'plugin':\n",
"return VAR_79.find('name').text\n"
] | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"def process_info_file(cp_elem, info_file):...\n",
"plugin_info = ElementTree.parse(info_file).getroot()\n",
"if plugin_info.tag != 'plugin':\n",
"return plugin_info.find('name').text\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"FunctionDef'",
"Assign'",
"Condition",
"Return'"
] |
[
"\"\"\"This module contains the device class and context manager\"\"\"\n",
"import abc\n",
"import logging\n",
"logging.getLogger()\n",
"\"\"\"string\"\"\"\n",
"def __getattr__(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_7(*VAR_15, **VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"retur... | [
"\"\"\"This module contains the device class and context manager\"\"\"\n",
"import abc\n",
"import logging\n",
"logging.getLogger()\n",
"\"\"\"Metaclass that allows derived classes to dynamically instantiate\n new objects based on undefined methods. The dynamic methods pass their arguments\n directly ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Expr'",
"Expr'",
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"from binance.client import Client\n",
"import configparser\n",
"import sqlite3\n",
"def FUNC_0(VAR_0, VAR_1=',', VAR_2=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return [chunk.strip(VAR_2) for chunk in VAR_0.split(VAR_1)]\n"
] | [
"from binance.client import Client\n",
"import configparser\n",
"import sqlite3\n",
"def getlist(option, sep=',', chars=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return [chunk.strip(chars) for chunk in option.split(sep)]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Import'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self, VAR_2, VAR_3, VAR_4, *VAR_5):...\n",
"self.write_data({'type': 'torrent_discovered', 'event': VAR_5[0]})\n"
] | [
"def on_torrent_discovered(self, subject, changetype, objectID, *args):...\n",
"self.write_data({'type': 'torrent_discovered', 'event': args[0]})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_8():...\n",
"VAR_12 = {}\n",
"VAR_13 = request.authorization\n",
"VAR_14 = request.headers\n",
"if VAR_13 and VAR_13.get('username'):\n",
"if not VAR_13.get('password'):\n",
"if 'X-Auth-Token' in VAR_14 and 'X-Auth-From' in VAR_14:\n",
"VAR_12['version'], VAR_12['user_type'], VAR_12['from'] ... | [
"def _get_kms_auth_data():...\n",
"data = {}\n",
"auth = request.authorization\n",
"headers = request.headers\n",
"if auth and auth.get('username'):\n",
"if not auth.get('password'):\n",
"if 'X-Auth-Token' in headers and 'X-Auth-From' in headers:\n",
"data['version'], data['user_type'], data['from'] =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._unit_of_measurement\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._unit_of_measurement\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"import sys\n",
"import os\n",
"import sqlite3\n",
"import requests\n",
"from PIL import Image\n",
"from io import BytesIO\n",
"from configs import *\n",
"VAR_0 = 10\n",
"def FUNC_0():...\n",
"if len(sys.argv) > 1:\n",
"VAR_0 = int(sys.argv[1])\n",
"if sys.version_info.major < 3:\n",
"print(... | [
"import sys\n",
"import os\n",
"import sqlite3\n",
"import requests\n",
"from PIL import Image\n",
"from io import BytesIO\n",
"from configs import *\n",
"NUM_IMAGES_TO_GET = 10\n",
"def main():...\n",
"if len(sys.argv) > 1:\n",
"NUM_IMAGES_TO_GET = int(sys.argv[1])\n",
"if sys.version_info.ma... | [
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,
4,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Assign'",
... |
[
"def FUNC_26():...\n",
"frappe.throw(_('Cannot use sub-query or function in fields'), frappe.DataError)\n"
] | [
"def _raise_exception():...\n",
"frappe.throw(_('Cannot use sub-query or function in fields'), frappe.DataError)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_22 = self.add_argument_group('Mechanical Turk')\n",
"VAR_23 = VAR_20.path.join(self.parlai_home, 'logs', 'mturk')\n",
"VAR_22.add_argument('--mturk-log-path', default=default_log_path, help=\n 'path to MTurk logs, defaults to {parlai_dir}/logs/mturk')\n",
"VAR_22.add_argume... | [
"def add_mturk_args(self):...\n",
"mturk = self.add_argument_group('Mechanical Turk')\n",
"default_log_path = os.path.join(self.parlai_home, 'logs', 'mturk')\n",
"mturk.add_argument('--mturk-log-path', default=default_log_path, help=\n 'path to MTurk logs, defaults to {parlai_dir}/logs/mturk')\n",
"mturk... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_28(self):...\n",
"VAR_13 = 1234.567\n",
"self.cursor.execute('create table t1(n float)')\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_float(self):...\n",
"value = 1234.567\n",
"self.cursor.execute('create table t1(n float)')\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_3(VAR_5):...\n",
"VAR_7 = load_website_config(VAR_5)\n",
"VAR_10 = FUNC_4(VAR_5, VAR_7)\n",
"VAR_12 = IOLoop.instance()\n",
"VAR_12.add_callback(lambda : VAR_0.info('started website {}'.format(VAR_5)))\n",
"start_http_server(VAR_10, VAR_12=io_loop, host=config.host, port=config.port)\n"
] | [
"def start_website(purpose):...\n",
"config = load_website_config(purpose)\n",
"http_handler = create_website_http_handler(purpose, config)\n",
"io_loop = IOLoop.instance()\n",
"io_loop.add_callback(lambda : LOGGER.info('started website {}'.format(purpose))\n )\n",
"start_http_server(http_handler, io_l... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_10=None, VAR_14=None, VAR_15=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_15:\n",
"VAR_10 = sys.argv[1:] if VAR_10 is None else VAR_10\n",
"return super().parse_known_args(VAR_10, VAR_14)\n",
"VAR_10 = [a for a in VAR_10 if a != '-h' and a != '--help']\n"
] | [
"def parse_known_args(self, args=None, namespace=None, nohelp=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if nohelp:\n",
"args = sys.argv[1:] if args is None else args\n",
"return super().parse_known_args(args, namespace)\n",
"args = [a for a in args if a != '-h' and a != '--help']\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_20(*VAR_17, **VAR_18):...\n",
"VAR_61 = VAR_52(*VAR_17, **kwargs)\n",
"if VAR_27:\n",
"mock.patch.object(VAR_61, '_validate_result').start()\n",
"return VAR_61\n"
] | [
"def _new_client_for(*args, **kwargs):...\n",
"sub_client = new_client_for(*args, **kwargs)\n",
"if mock_validate:\n",
"mock.patch.object(sub_client, '_validate_result').start()\n",
"return sub_client\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_7(VAR_10, VAR_11):...\n",
"VAR_10 = VAR_10.replace('/b/', '/osu/').split('&', 1)[0]\n",
"if VAR_11 == '':\n",
"VAR_37 = 'curl ' + VAR_10 + ' | /home/pi/DiscordBots/Oppai/oppai/oppai -'\n",
"VAR_37 = ('curl ' + VAR_10 + ' | /home/pi/DiscordBots/Oppai/oppai/oppai - ' +\n VAR_11)\n",
"VAR_20 = s... | [
"def return_beatmap_infos(url, oppaiParameters):...\n",
"url = url.replace('/b/', '/osu/').split('&', 1)[0]\n",
"if oppaiParameters == '':\n",
"command = 'curl ' + url + ' | /home/pi/DiscordBots/Oppai/oppai/oppai -'\n",
"command = ('curl ' + url + ' | /home/pi/DiscordBots/Oppai/oppai/oppai - ' +\n oppaiP... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5():...\n",
"\"\"\"docstring\"\"\"\n",
"FUNC_1('delete from Player')\n"
] | [
"def deletePlayers():...\n",
"\"\"\"docstring\"\"\"\n",
"execute('delete from Player')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_0(self, *VAR_4, **VAR_5):...\n",
"VAR_11 = self.REQUEST\n",
"VAR_12 = VAR_11.RESPONSE\n",
"return self.getBodyContent(VAR_11)\n"
] | [
"def zmi_body_content(self, *args, **kwargs):...\n",
"request = self.REQUEST\n",
"response = request.RESPONSE\n",
"return self.getBodyContent(request)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"self.uut.executable = 'more'\n",
"self.uut.use_stdin = True\n",
"self.uut.use_stderr = False\n",
"self.uut.process_output = lambda output, filename, file: output\n",
"VAR_1 = self.uut.lint(file=lines)\n",
"self.assertTrue(('abcd\\n', 'efgh\\n') == VAR_1 or ('abcd\\n', 'efgh\\n... | [
"def test_stdin_input(self):...\n",
"self.uut.executable = 'more'\n",
"self.uut.use_stdin = True\n",
"self.uut.use_stderr = False\n",
"self.uut.process_output = lambda output, filename, file: output\n",
"out = self.uut.lint(file=lines)\n",
"self.assertTrue(('abcd\\n', 'efgh\\n') == out or ('abcd\\n', 'e... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"from __future__ import print_function\n",
"import os\n",
"import threading\n",
"from .__init__ import *\n",
"\"\"\"single level in the virtual fs\"\"\"\n",
"def __init__(self, VAR_0, VAR_1, VAR_2=[], VAR_3=[]):...\n",
"self.realpath = VAR_0\n",
"self.vpath = VAR_1\n",
"self.uread = VAR_2\n",
"sel... | [
"from __future__ import print_function\n",
"import os\n",
"import threading\n",
"from .__init__ import *\n",
"\"\"\"single level in the virtual fs\"\"\"\n",
"def __init__(self, realpath, vpath, uread=[], uwrite=[]):...\n",
"self.realpath = realpath\n",
"self.vpath = vpath\n",
"self.uread = uread\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
] | [
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assert'",
"Assert'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Return'",
"Assig... |
[
"def FUNC_25(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return any(self.live_processes())\n"
] | [
"def any_processes_alive(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return any(self.live_processes())\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self, VAR_18, VAR_6, VAR_4, VAR_19):...\n",
"if 'internet_nl_api_password' in VAR_4.changed_data:\n",
"VAR_26 = Fernet(settings.FIELD_ENCRYPTION_KEY)\n",
"super().save_model(VAR_18, VAR_6, VAR_4, VAR_19)\n",
"VAR_27 = VAR_26.encrypt(VAR_6.internet_nl_api_password.encode())\n",
"VAR_6.internet_... | [
"def save_model(self, request, obj, form, change):...\n",
"if 'internet_nl_api_password' in form.changed_data:\n",
"f = Fernet(settings.FIELD_ENCRYPTION_KEY)\n",
"super().save_model(request, obj, form, change)\n",
"encrypted = f.encrypt(obj.internet_nl_api_password.encode())\n",
"obj.internet_nl_api_passw... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(VAR_5, **VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_7(VAR_17):...\n",
"@receiver(VAR_5, **decorator_kwargs)...\n",
"if settings.SUSPEND_SIGNALS:\n",
"return\n",
"return VAR_17(VAR_23, **kwargs)\n"
] | [
"def suspending_receiver(signal, **decorator_kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"def our_wrapper(func):...\n",
"@receiver(signal, **decorator_kwargs)...\n",
"if settings.SUSPEND_SIGNALS:\n",
"return\n",
"return func(sender, **kwargs)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import os\n",
"import sys\n",
"from builtins import filter, object\n",
"from collections import defaultdict\n",
"from contextlib import contextmanager\n",
"from twitter.common.collections import OrderedSet\n",
"fr... | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import os\n",
"import sys\n",
"from builtins import filter, object\n",
"from collections import defaultdict\n",
"from contextlib import contextmanager\n",
"from twitter.common.collections import OrderedSet\n",
"fr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Expr'",
"FunctionDef'... |
[
"@classmethod...\n",
"return [FUNC_29, FUNC_30]\n"
] | [
"@classmethod...\n",
"return [failing, skipped]\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_5(self, VAR_19: UserDTO):...\n",
"\"\"\"docstring\"\"\"\n",
"self.email_address = VAR_19.email_address.lower(\n ) if VAR_19.email_address else None\n",
"self.twitter_id = VAR_19.twitter_id.lower() if VAR_19.twitter_id else None\n",
"self.facebook_id = VAR_19.facebook_id.lower() if VAR_19.facebo... | [
"def update(self, user_dto: UserDTO):...\n",
"\"\"\"docstring\"\"\"\n",
"self.email_address = user_dto.email_address.lower(\n ) if user_dto.email_address else None\n",
"self.twitter_id = user_dto.twitter_id.lower() if user_dto.twitter_id else None\n",
"self.facebook_id = user_dto.facebook_id.lower(\n ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def _get_proxied_attribute_value(self, attribute):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_2(VAR_2):...\n",
"return render(VAR_2, 'etd_app/home.html')\n"
] | [
"def home(request):...\n",
"return render(request, 'etd_app/home.html')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from google.appengine.api import users as gae_users\n",
"from components import auth\n",
"from components import config as config_api\n",
"from components import decorators\n",
"from components import endpoints_webapp2\n",
"from components import prpc\n",
"import webapp2\n",
"from legacy import api a... | [
"from google.appengine.api import users as gae_users\n",
"from components import auth\n",
"from components import config as config_api\n",
"from components import decorators\n",
"from components import endpoints_webapp2\n",
"from components import prpc\n",
"import webapp2\n",
"from legacy import api a... | [
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Expr'",
... |
[
"def FUNC_27(self, VAR_75):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.threads = VAR_75\n",
"return VAR_101\n"
] | [
"def threads(self, threads):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.threads = threads\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"from m5.params import *\n",
"from m5.proxy import *\n",
"from m5.util.fdthelper import *\n",
"from m5.SimObject import SimObject\n",
"from m5.objects.Device import PioDevice\n",
"from m5.objects.Platform import Platform\n",
"VAR_0 = 'BaseGic'\n",
"VAR_1 = True\n",
"VAR_2 = 'dev/arm/base_gic.hh'\n",... | [
"from m5.params import *\n",
"from m5.proxy import *\n",
"from m5.util.fdthelper import *\n",
"from m5.SimObject import SimObject\n",
"from m5.objects.Device import PioDevice\n",
"from m5.objects.Platform import Platform\n",
"type = 'BaseGic'\n",
"abstract = True\n",
"cxx_header = 'dev/arm/base_gic.... | [
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assig... |
[
"def FUNC_2(self):...\n",
""
] | [
"def tearDown(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_10(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self._validated_binaries:\n",
"return\n",
"if self._minimum_version:\n",
"VAR_2 = self._get_version(VAR_12)\n",
"if self._maximum_version:\n",
"if VAR_2 < self._minimum_version:\n",
"VAR_2 = self._get_version(VAR_12)\n",
"self._bin_path = o... | [
"def validate(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self._validated_binaries:\n",
"return\n",
"if self._minimum_version:\n",
"version = self._get_version(java)\n",
"if self._maximum_version:\n",
"if version < self._minimum_version:\n",
"version = self._get_version(java)\n",
"self._bin_path ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"return self.groups\n"
] | [
"def get_groups(self):...\n",
"return self.groups\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_18(self):...\n",
"def FUNC_24():...\n",
"VAR_15 = self.mock_nsx_clustered_api(session_response=connect_timeout)\n",
"VAR_15._validate = mock.Mock()\n",
"self.assertRaises(nsxlib_exc.ServiceClusterUnavailable, VAR_15.get,\n 'api/v1/transport-zones')\n"
] | [
"def test_cluster_proxy_connection_error(self):...\n",
"def connect_timeout():...\n",
"api = self.mock_nsx_clustered_api(session_response=connect_timeout)\n",
"api._validate = mock.Mock()\n",
"self.assertRaises(nsxlib_exc.ServiceClusterUnavailable, api.get,\n 'api/v1/transport-zones')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_8, VAR_9):...\n",
"for line in VAR_8:\n",
"if line.startswith(VAR_9):\n",
"return\n",
"return line[len(VAR_9):]\n"
] | [
"def _get_prefixed_value(self, lines, prefix):...\n",
"for line in lines:\n",
"if line.startswith(prefix):\n",
"return\n",
"return line[len(prefix):]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = self.session.get('https://www.kijiji.ca/m-my-ads.html')\n",
"VAR_18 = {'Action': 'DELETE_ADS', 'Mode': 'ACTIVE', 'needsRedirect':\n 'false', 'ads':\n '[{{\"adId\":\"{}\",\"reason\":\"PREFER_NOT_TO_SAY\",\"otherReason\":\"\"}}]'.\n ... | [
"def delete_ad(self, ad_id):...\n",
"\"\"\"docstring\"\"\"\n",
"my_ads_page = self.session.get('https://www.kijiji.ca/m-my-ads.html')\n",
"params = {'Action': 'DELETE_ADS', 'Mode': 'ACTIVE', 'needsRedirect':\n 'false', 'ads':\n '[{{\"adId\":\"{}\",\"reason\":\"PREFER_NOT_TO_SAY\",\"otherReason\":\"\"}}]... | [
0,
0,
0,
5,
0,
5
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition"
] |
[
"def FUNC_11(self):...\n",
"self.run_test_case(self.scenario.create_server_group(), timeout_ok=True)\n"
] | [
"def test_c_create_server_group(self):...\n",
"self.run_test_case(self.scenario.create_server_group(), timeout_ok=True)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"return self.name\n"
] | [
"def get_name(self):...\n",
"return self.name\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0=['POST', 'GET', 'PUT', 'DELETE']):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_5(VAR_1, *VAR_2, **VAR_3):...\n",
"def FUNC_6():...\n",
"if not request.method in VAR_0:\n",
"return True\n",
"if not request.environ.get('AUTH_TYPE') == 'cookie':\n",
"return True\n",
"if config.get('sk... | [
"def RequireInternalRequest(methods=['POST', 'GET', 'PUT', 'DELETE']):...\n",
"\"\"\"docstring\"\"\"\n",
"def _decorate(f, *a, **kw):...\n",
"def check():...\n",
"if not request.method in methods:\n",
"return True\n",
"if not request.environ.get('AUTH_TYPE') == 'cookie':\n",
"return True\n",
"if con... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
5,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Condition",
"AugAssign'",
"Condition",
"Condition",
"Return'"
] |
[
"@VAR_0.route('/crawling/autoend')...\n",
"VAR_14 = VAR_10.get('crawl_process_id', None)\n",
"if VAR_14 < 0:\n",
"return 'process already killed'\n",
"os.kill(VAR_14, signal.SIGTERM)\n",
"VAR_15 = VAR_10.get('crawl_start_time', None)\n",
"VAR_10['crawl_total_time'] = time.time() - VAR_15\n",
"flash('T... | [
"@app.route('/crawling/autoend')...\n",
"p_id = session.get('crawl_process_id', None)\n",
"if p_id < 0:\n",
"return 'process already killed'\n",
"os.kill(p_id, signal.SIGTERM)\n",
"crawl_start_time = session.get('crawl_start_time', None)\n",
"session['crawl_total_time'] = time.time() - crawl_start_time\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"\"\"\"Handlers for customizing oauthclient endpoints.\"\"\"\n",
"import six\n",
"from flask import current_app, flash, redirect, render_template, request, session, url_for\n",
"from flask.ext.login import current_user\n",
"from functools import partial, wraps\n",
"from werkzeug.utils import import_string... | [
"\"\"\"Handlers for customizing oauthclient endpoints.\"\"\"\n",
"import six\n",
"from flask import current_app, flash, redirect, render_template, request, session, url_for\n",
"from flask.ext.login import current_user\n",
"from functools import partial, wraps\n",
"from werkzeug.utils import import_string... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_1():...\n",
"VAR_6 = './data/input/'\n",
"VAR_7 = VAR_6 + 'download/'\n",
"VAR_8 = './data/temp/'\n",
"VAR_9 = './data/vcf/'\n",
"VAR_10 = './data/zarr/'\n",
"VAR_11 = './data/zarr_benchmark/'\n",
"VAR_12 = FUNC_0()\n",
"VAR_13 = VAR_12['command']\n",
"if VAR_13 == 'config':\n",
"VAR_1... | [
"def _main():...\n",
"input_directory = './data/input/'\n",
"download_directory = input_directory + 'download/'\n",
"temp_directory = './data/temp/'\n",
"vcf_directory = './data/vcf/'\n",
"zarr_directory_setup = './data/zarr/'\n",
"zarr_directory_benchmark = './data/zarr_benchmark/'\n",
"cli_arguments... | [
0,
7,
7,
7,
7,
7,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
7,
7,
7,
0,
7
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign... |
[
"def FUNC_3(self):...\n",
"VAR_15 = self._server_popen.poll()\n",
"return VAR_15 is None\n"
] | [
"def _IsServerAlive(self):...\n",
"returncode = self._server_popen.poll()\n",
"return returncode is None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"if not self.route:\n",
"return frappe.db.get_value('Blog Category', self.blog_category, 'route'\n ) + '/' + self.scrub(self.title)\n"
] | [
"def make_route(self):...\n",
"if not self.route:\n",
"return frappe.db.get_value('Blog Category', self.blog_category, 'route'\n ) + '/' + self.scrub(self.title)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_5(self, VAR_13, VAR_14, VAR_15=None):...\n",
"if VAR_14 == Qt.Horizontal and VAR_15 == Qt.DisplayRole:\n",
"return self.column_headers[VAR_13]\n"
] | [
"def headerData(self, num, orientation, role=None):...\n",
"if orientation == Qt.Horizontal and role == Qt.DisplayRole:\n",
"return self.column_headers[num]\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_7(VAR_4):...\n",
"VAR_11 = FUNC_4(VAR_4)\n",
"VAR_9 = FUNC_0()\n",
"VAR_10 = VAR_9.cursor()\n",
"if VAR_11 is None:\n",
"VAR_11 = VAR_11 - 1\n",
"VAR_10.execute(\n \"\"\"\n INSERT INTO people(name,karma,shame) VALUES('{}',-1,0)\n \"\"\"\n .format(VAR_4))\n",... | [
"def karma_sub(name):...\n",
"karma = karma_ask(name)\n",
"db = db_connect()\n",
"cursor = db.cursor()\n",
"if karma is None:\n",
"karma = karma - 1\n",
"cursor.execute(\n \"\"\"\n INSERT INTO people(name,karma,shame) VALUES('{}',-1,0)\n \"\"\"\n .format(name))\n",
... | [
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"import requests\n",
"import sys\n",
"from bs4 import BeautifulSoup\n",
"import re\n",
"VAR_0 = 'https://abcd.web-security-academy.net/'\n",
"VAR_0 = f'{VAR_0}page'\n",
"VAR_1 = {'category': 'Lifestyle'}\n",
"VAR_2 = [\"'UNION SELECT\", 'NULL', '--']\n",
"VAR_3 = {'category': f\"Lifestyle{' '.join(V... | [
"import requests\n",
"import sys\n",
"from bs4 import BeautifulSoup\n",
"import re\n",
"url = 'https://abcd.web-security-academy.net/'\n",
"url = f'{url}page'\n",
"params = {'category': 'Lifestyle'}\n",
"null = [\"'UNION SELECT\", 'NULL', '--']\n",
"sqli = {'category': f\"Lifestyle{' '.join(null)}\"... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Assign'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.