lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(self, VAR_1):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = \"INSERT INTO crimes (description) VALUES ('{}');\".format(VAR_1)\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"VAR_2.commit()\n"
] | [
"def add_input(self, data):...\n",
"connection = self.connect()\n",
"query = \"INSERT INTO crimes (description) VALUES ('{}');\".format(data)\n",
"connection.close()\n",
"cursor.execute(query)\n",
"connection.commit()\n"
] | [
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_0):...\n",
"return VAR_0.scheme in ['http', 'https']\n"
] | [
"def is_host(parsed_uri):...\n",
"return parsed_uri.scheme in ['http', 'https']\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"VAR_5 = self.current_course_instance.get_edit_url()\n",
"VAR_4 = self.client.get(VAR_5)\n",
"self.assertEqual(VAR_4.status_code, 302)\n",
"self.client.login(username='testUser', password='testPassword')\n",
"VAR_4 = self.client.get(VAR_5)\n",
"self.assertEqual(VAR_4.status_co... | [
"def test_course_teacher_views(self):...\n",
"url = self.current_course_instance.get_edit_url()\n",
"response = self.client.get(url)\n",
"self.assertEqual(response.status_code, 302)\n",
"self.client.login(username='testUser', password='testPassword')\n",
"response = self.client.get(url)\n",
"self.assert... | [
0,
0,
0,
0,
0,
0,
0,
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'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"... |
[
"def FUNC_9(VAR_10):...\n",
"for VAR_7, VAR_6 in VAR_10.items():\n",
"if VAR_6 == -1:\n",
"print('{0:3} (0x{0:X}): {1}'.format(VAR_6, VAR_7))\n"
] | [
"def print_all_syscalls(syscalls):...\n",
"for syscall_name, syscall_number in syscalls.items():\n",
"if syscall_number == -1:\n",
"print('{0:3} (0x{0:X}): {1}'.format(syscall_number, syscall_name))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_20(self, VAR_21, VAR_22, VAR_4=None, VAR_23=None, VAR_24=None, **...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_37 = VAR_4 or VAR_21.spec_path\n",
"VAR_38 = os.path.join(get_buildroot(), VAR_37)\n",
"if not os.path.exists(VAR_38):\n",
"os.makedirs(VAR_38)\n",
"if not self.source_roots.find_by_path(VA... | [
"def add_new_target(self, address, target_type, target_base=None,...\n",
"\"\"\"docstring\"\"\"\n",
"rel_target_base = target_base or address.spec_path\n",
"abs_target_base = os.path.join(get_buildroot(), rel_target_base)\n",
"if not os.path.exists(abs_target_base):\n",
"os.makedirs(abs_target_base)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_18(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_47 = self.auth_method\n",
"if not VAR_47:\n",
"for VAR_47 in self.get_auth_methods(config.ensure_configured()):\n",
"if VAR_47 not in VAR_4:\n",
"if VAR_47 in VAR_4:\n",
"return VAR_4[VAR_47]\n"
] | [
"def _get_users_api(self):...\n",
"\"\"\"docstring\"\"\"\n",
"method = self.auth_method\n",
"if not method:\n",
"for method in self.get_auth_methods(config.ensure_configured()):\n",
"if method not in _METHOD_TO_USERS_API:\n",
"if method in _METHOD_TO_USERS_API:\n",
"return _METHOD_TO_USERS_API[method]... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"For",
"Condition",
"Condition",
"Return'"
] |
[
"def FUNC_3(VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_2(*VAR_6)\n"
] | [
"def wrap_diff(x):...\n",
"\"\"\"docstring\"\"\"\n",
"return diff(*x)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_0(*VAR_0, **VAR_1):...\n",
"def FUNC_5(VAR_12):...\n",
"def FUNC_9(self, *VAR_15, **VAR_75):...\n",
"for validator in VAR_0:\n",
"if VAR_102.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n",
"return FUNC_9\n",
"validator(VAR_75)\n",
"VAR_16 = self.build_arg_list(VAR_12, VAR_75)\... | [
"def validate(*simple_vals, **param_vals):...\n",
"def val(fn):...\n",
"def newfn(self, *a, **env):...\n",
"for validator in simple_vals:\n",
"if request.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n",
"return newfn\n",
"validator(env)\n",
"kw = self.build_arg_list(fn, env)\n",
"retur... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"FunctionDef'",
"For",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Return'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self, VAR_13):...\n",
"return VAR_13.name in self._localrules or VAR_13.norun\n"
] | [
"def is_local(self, rule):...\n",
"return rule.name in self._localrules or rule.norun\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(VAR_0):...\n",
"return 'Meetup : %s' % VAR_0.title\n"
] | [
"def meetup_article_title(meetup):...\n",
"return 'Meetup : %s' % meetup.title\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import pymysql\n",
"import dbconfig\n",
"def FUNC_0(self, VAR_0='crimemap'):...\n",
"return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\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, password=\n dbconfig.db_password, db=database)\n"
] | [
0,
0,
0,
0
] | [
"Import'",
"Import'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(self, VAR_13):...\n",
"self.cursor.execute(\"SELECT * FROM brand WHERE name ILIKE '%\" + VAR_13 + \"%';\")\n",
"return self.cursor.fetchall()\n"
] | [
"def find_brand_by_name(self, brand_name):...\n",
"self.cursor.execute(\"SELECT * FROM brand WHERE name ILIKE '%\" + brand_name +\n \"%';\")\n",
"return self.cursor.fetchall()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(self, VAR_14):...\n",
""
] | [
"def is_image(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_15(self):...\n",
"VAR_33 = self.ref\n",
"if '/' in VAR_33:\n",
"VAR_33 = VAR_33.split('/', 1)[1]\n",
"return VAR_33\n"
] | [
"def noremote_ref(self):...\n",
"nr_ref = self.ref\n",
"if '/' in nr_ref:\n",
"nr_ref = nr_ref.split('/', 1)[1]\n",
"return nr_ref\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
""
] | [
"def testDownloadFileDownloadError(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_13(self, VAR_10, VAR_11, VAR_12, VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24 = self.common._cli_run('createhost -persona %s -domain %s %s %s' % (\n VAR_13, VAR_12, VAR_10, ' '.join(VAR_11)), None)\n",
"if VAR_24 and len(VAR_24) > 1:\n",
"return self.common.parse_create_host_error(VAR_10,... | [
"def _create_3par_fibrechan_host(self, hostname, wwn, domain, persona_id):...\n",
"\"\"\"docstring\"\"\"\n",
"out = self.common._cli_run('createhost -persona %s -domain %s %s %s' % (\n persona_id, domain, hostname, ' '.join(wwn)), None)\n",
"if out and len(out) > 1:\n",
"return self.common.parse_create_h... | [
0,
0,
2,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_20(VAR_3):...\n",
"VAR_18 = \"SELECT token FROM {} WHERE name='{}'\".format(CFG(\n 'tokens_table_name'), VAR_3)\n",
"VAR_0, VAR_10 = FUNC_0()\n",
"VAR_19 = FUNC_2(VAR_10, VAR_18)\n",
"VAR_0.close()\n",
"return VAR_19\n"
] | [
"def getTokensExternal(poll_name):...\n",
"req = \"SELECT token FROM {} WHERE name='{}'\".format(CFG('tokens_table_name'\n ), poll_name)\n",
"conn, c = connectDB()\n",
"tmp = queryAll(c, req)\n",
"conn.close()\n",
"return tmp\n"
] | [
0,
4,
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
""
] | [
"def book_ride(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(self):...\n",
"super(CLASS_0, self).setUp()\n",
"self.shard = os.environ.get('SHARD')\n",
"self.env_var_override = EnvironmentVarGuard()\n"
] | [
"def setUp(self):...\n",
"super(TestPaverBokChoyCmd, self).setUp()\n",
"self.shard = os.environ.get('SHARD')\n",
"self.env_var_override = EnvironmentVarGuard()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_10):...\n",
"VAR_27 = self.builder.get_object('password_unlock_entry')\n",
"if VAR_27.get_text() != '':\n",
"self.database_manager = DatabaseManager(self.database_filepath, VAR_27.\n get_text())\n",
"self.show_unlock_failed_revealer()\n",
"self.open_database_page()\n",
"VAR_27.g... | [
"def on_password_unlock_button_clicked(self, widget):...\n",
"password_unlock_entry = self.builder.get_object('password_unlock_entry')\n",
"if password_unlock_entry.get_text() != '':\n",
"self.database_manager = DatabaseManager(self.database_filepath,\n password_unlock_entry.get_text())\n",
"self.show_un... | [
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@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_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'"
] |
[
"@staticmethod...\n",
"VAR_25 = '%s.cfg' % VAR_9\n",
"if VAR_25 != os.path.basename(VAR_25):\n",
"VAR_30 = 'Directory traversal attempt detected for host name %r'\n",
"return VAR_25\n"
] | [
"@staticmethod...\n",
"name = '%s.cfg' % hostname\n",
"if name != os.path.basename(name):\n",
"msg = 'Directory traversal attempt detected for host name %r'\n",
"return name\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"@event.listens_for(Engine, 'before_cursor_execute', retval=True)...\n",
"VAR_4.info.setdefault('query_start_time', []).append(datetime.now())\n",
"VAR_28 = inspect.stack()[1:-1]\n",
"if sys.version_info.major == 3:\n",
"VAR_28 = [(x.filename, x.lineno, x.function) for x in VAR_28]\n",
"VAR_28 = [(x[1], x... | [
"@event.listens_for(Engine, 'before_cursor_execute', retval=True)...\n",
"conn.info.setdefault('query_start_time', []).append(datetime.now())\n",
"stack = inspect.stack()[1:-1]\n",
"if sys.version_info.major == 3:\n",
"stack = [(x.filename, x.lineno, x.function) for x in stack]\n",
"stack = [(x[1], x[2], ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"For",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@auth.route('/logout')...\n",
"logout_user()\n",
"return redirect(url_for('auth.test'))\n"
] | [
"@auth.route('/logout')...\n",
"logout_user()\n",
"return redirect(url_for('auth.test'))\n"
] | [
0,
0,
6
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_4(VAR_2):...\n",
"print('username: ', end='')\n",
"VAR_3 = input()\n",
"while len(VAR_3) == 0:\n",
"print(\"\"\"username must exceed zero characters.\nusername: \"\"\", end='')\n",
"return FUNC_3(VAR_3, VAR_2)\n",
"VAR_3 = input()\n"
] | [
"def get_customer_id(query):...\n",
"print('username: ', end='')\n",
"username = input()\n",
"while len(username) == 0:\n",
"print(\"\"\"username must exceed zero characters.\nusername: \"\"\", end='')\n",
"return username_to_id(username, query)\n",
"username = input()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Assign'"
] |
[
"def FUNC_0(self, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = 'string'.format(VAR_5=' '.join(start_urls), VAR_4=report_dir)\n",
"return VAR_6\n"
] | [
"def _expected_command(self, report_dir, start_urls):...\n",
"\"\"\"docstring\"\"\"\n",
"expected_statement = (\n 'pa11ycrawler run {start_urls} --pa11ycrawler-allowed-domains=localhost --pa11ycrawler-reports-dir={report_dir} --pa11ycrawler-deny-url-matcher=logout --pa11y-reporter=\"1.0-json\" --depth-limit=... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"import logging\n",
"import traceback\n",
"from ..anagonda.context.autocomplete import AutoComplete\n",
"from commands.base import Command\n",
"\"\"\"Run GoCode\n \"\"\"\n",
"def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5, VAR_6):...\n",
"self.vid = VAR_2\n",
"self.path = VAR_4\n",
"... | [
"import logging\n",
"import traceback\n",
"from ..anagonda.context.autocomplete import AutoComplete\n",
"from commands.base import Command\n",
"\"\"\"Run GoCode\n \"\"\"\n",
"def __init__(self, callback, uid, vid, code, path, offset, go_env):...\n",
"self.vid = vid\n",
"self.path = path\n",
"self... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"from django.db import models, migrations\n",
"VAR_0 = [('userprofile', '0001_initial'), ('course', '0001_initial')]\n",
"VAR_1 = [migrations.CreateModel(name='Notification', fields=[('id', models.\n AutoField(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)), ('subject', models.... | [
"from django.db import models, migrations\n",
"dependencies = [('userprofile', '0001_initial'), ('course', '0001_initial')]\n",
"operations = [migrations.CreateModel(name='Notification', fields=[('id',\n models.AutoField(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)), ('subjec... | [
0,
0,
4
] | [
"ImportFrom'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(self, VAR_11='', VAR_12=None, VAR_13=None, VAR_6=None):...\n",
"VAR_5 = self.session.query(self.obj)\n",
"VAR_5 = self._get_base_query(VAR_5=query, VAR_6=filters)\n",
"VAR_25 = VAR_5.all()\n",
"VAR_26 = GroupByCol(VAR_11, 'Group by')\n",
"return VAR_26.apply(VAR_25)\n"
] | [
"def query_simple_group(self, group_by='', aggregate_func=None,...\n",
"query = self.session.query(self.obj)\n",
"query = self._get_base_query(query=query, filters=filters)\n",
"query_result = query.all()\n",
"group = GroupByCol(group_by, 'Group by')\n",
"return group.apply(query_result)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"VAR_16 = VAR_8.copy()\n",
"VAR_16['Accept'] = 'application/vnd.github.VERSION.diff'\n",
"VAR_9 = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"VAR_0 = VAR_5['reposit... | [
"def get_files_involved_in_pr(data):...\n",
"\"\"\"docstring\"\"\"\n",
"headers = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"diff_headers = headers.copy()\n",
"diff_headers['Accept'] = 'application/vnd.github.VERSION.diff'\n",
"auth = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"For",
"For",
"Condition",
"Expr'"
] |
[
"from datetime import datetime\n",
"import pyodbc\n",
"import sys\n",
"import subprocess as sp\n",
"from os import system\n",
"def FUNC_0():...\n",
"system('cls')\n",
"def FUNC_1():...\n",
"print('-' * 70)\n",
"VAR_0 = 'laserInv'\n",
"VAR_1 = False\n",
"VAR_2 = False\n",
"VAR_3 = None\n",
... | [
"from datetime import datetime\n",
"import pyodbc\n",
"import sys\n",
"import subprocess as sp\n",
"from os import system\n",
"def clear():...\n",
"system('cls')\n",
"def divider():...\n",
"print('-' * 70)\n",
"DBNAME = 'laserInv'\n",
"openConn = False\n",
"resupplyComplete = False\n",
"conf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0... | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def __init__(self, VAR_46=50, VAR_47=100):...\n",
"\"\"\"docstring\"\"\"\n",
"self.regex = re.compile(\n '((?P<value>.+)(?P=value){{{min_repeat},{max_repeat}}})$'.format(VAR_46\n =min_repeat - 1, VAR_47=max_repeat - 1))\n"
] | [
"def __init__(self, min_repeat=50, max_repeat=100):...\n",
"\"\"\"docstring\"\"\"\n",
"self.regex = re.compile(\n '((?P<value>.+)(?P=value){{{min_repeat},{max_repeat}}})$'.format(\n min_repeat=min_repeat - 1, max_repeat=max_repeat - 1))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_12(self, VAR_10, VAR_12, **VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {}\n",
"VAR_5['volumeName'] = VAR_10['name']\n",
"VAR_5['serverName'] = VAR_12['host']\n",
"self._cliq_run_xml('unassignVolumeToServer', VAR_5)\n"
] | [
"def terminate_connection(self, volume, connector, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"cliq_args = {}\n",
"cliq_args['volumeName'] = volume['name']\n",
"cliq_args['serverName'] = connector['host']\n",
"self._cliq_run_xml('unassignVolumeToServer', cliq_args)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"self.total += VAR_3.total\n",
"self.success += VAR_3.success\n",
"self.failure += VAR_3.failure\n",
"self.error += VAR_3.error\n",
"self.undecided += VAR_3.undecided\n",
"self.total_time += VAR_3.total_time\n",
"self.max_time = max(self.max_time, VAR_3.max_time)\n"
] | [
"def merge(self, log2):...\n",
"self.total += log2.total\n",
"self.success += log2.success\n",
"self.failure += log2.failure\n",
"self.error += log2.error\n",
"self.undecided += log2.undecided\n",
"self.total_time += log2.total_time\n",
"self.max_time = max(self.max_time, log2.max_time)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"Assign'"
] |
[
"@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'"
] |
[
"def FUNC_7(self, VAR_8):...\n",
"VAR_9 = 'iSCSI target name is '\n",
"VAR_29 = self._get_prefixed_value(VAR_8, VAR_9)[:-1]\n",
"VAR_30 = '%s:%s,1 %s 0' % (self._group_ip, '3260', VAR_29)\n",
"VAR_31 = {}\n",
"VAR_31['provider_location'] = VAR_30\n",
"if self.configuration.eqlx_use_chap:\n",
"VAR_31['... | [
"def _get_volume_data(self, lines):...\n",
"prefix = 'iSCSI target name is '\n",
"target_name = self._get_prefixed_value(lines, prefix)[:-1]\n",
"lun_id = '%s:%s,1 %s 0' % (self._group_ip, '3260', target_name)\n",
"model_update = {}\n",
"model_update['provider_location'] = lun_id\n",
"if self.configurat... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"self.check_xsrf()\n",
"VAR_4 = self.get_arg('email')\n",
"VAR_4 = VAR_4.strip()\n",
"VAR_5 = self.get_arg('password')\n",
"VAR_6 = self.get_arg('password2')\n",
"VAR_7 = dbapi.User()\n",
"VAR_0 = ''\n",
"if VAR_4 and VAR_5 == VAR_6:\n",
"if VAR_7.get_user(VAR_4) == 0:\n"... | [
"def post(self):...\n",
"self.check_xsrf()\n",
"email = self.get_arg('email')\n",
"email = email.strip()\n",
"password = self.get_arg('password')\n",
"password2 = self.get_arg('password2')\n",
"user = dbapi.User()\n",
"error = ''\n",
"if email and password == password2:\n",
"if user.get_user(email... | [
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
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",... |
[
"__packagename__ = 'dwave-hybrid'\n",
"__title__ = 'D-Wave Hybrid'\n",
"__version__ = '0.1.4'\n",
"__author__ = 'D-Wave Systems Inc.'\n",
"__authoremail__ = 'radomir@dwavesys.com'\n",
"__description__ = 'Hybrid Asynchronous Decomposition Solver Framework'\n",
"__url__ = 'https://github.com/dwavesystems/... | [
"__packagename__ = 'dwave-hybrid'\n",
"__title__ = 'D-Wave Hybrid'\n",
"__version__ = '0.1.4'\n",
"__author__ = 'D-Wave Systems Inc.'\n",
"__authoremail__ = 'radomir@dwavesys.com'\n",
"__description__ = 'Hybrid Asynchronous Decomposition Solver Framework'\n",
"__url__ = 'https://github.com/dwavesystems/... | [
0,
0,
1,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_9, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def ensure_export(self, context, volume):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_18(self):...\n",
"return FUNC_18.dumps(self.properties())\n"
] | [
"def json(self):...\n",
"return json.dumps(self.properties())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"if not hasattr(self, '_app_css_hash'):\n",
"self._app_css_hash = hashlib.sha1(open(os.path.join(str(VAR_0),\n 'datasette/static/app.css')).read().encode('utf8')).hexdigest()[:6]\n",
"return self._app_css_hash\n"
] | [
"def app_css_hash(self):...\n",
"if not hasattr(self, '_app_css_hash'):\n",
"self._app_css_hash = hashlib.sha1(open(os.path.join(str(app_root),\n 'datasette/static/app.css')).read().encode('utf8')).hexdigest()[:6]\n",
"return self._app_css_hash\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer(VAR_5=True),\n max_retries=5)\n"
] | [
"def test_y_delete_load_balancer_vpc(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer(use_vpc=True),\n max_retries=5)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(VAR_2, VAR_3):...\n",
"from configparser import ConfigParser, ExtendedInterpolation\n",
"VAR_64 = FUNC_0() + '/haproxy-wi.cfg'\n",
"print('Content-type: text/html\\n')\n",
"return VAR_65.get(VAR_2, VAR_3)\n",
"print('Content-type: text/html\\n')\n",
"VAR_65 = ConfigParser(interpolation=Exten... | [
"def get_config_var(sec, var):...\n",
"from configparser import ConfigParser, ExtendedInterpolation\n",
"path_config = get_app_dir() + '/haproxy-wi.cfg'\n",
"print('Content-type: text/html\\n')\n",
"return config.get(sec, var)\n",
"print('Content-type: text/html\\n')\n",
"config = ConfigParser(interpola... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Expr'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_10(self, VAR_14):...\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.parser.parse(VAR_14, lexer=self.lexer)\n"
] | [
"def parse(self, expr):...\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.parser.parse(expr, lexer=self.lexer)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_13 = []\n",
"if not isinstance(self['cluster_options'], list):\n",
"self['cluster_options'] = [self['cluster_options']]\n",
"if self['cluster_options']:\n",
"for option in self['cluster_options']:\n",
"self['cluster_options'] = VAR_13\n",
"VAR_9 = option.split('.')[0]\n"... | [
"def parse_cluster_options(self):...\n",
"opts = []\n",
"if not isinstance(self['cluster_options'], list):\n",
"self['cluster_options'] = [self['cluster_options']]\n",
"if self['cluster_options']:\n",
"for option in self['cluster_options']:\n",
"self['cluster_options'] = opts\n",
"cluster = option.spl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"self.mock(time, 'time', lambda : 126.0)\n",
"VAR_6 = os_utilities.get_state()\n",
"VAR_6['sleep_streak'] = 12\n",
"for disk in VAR_6['disks'].itervalues():\n",
"self.assertGreater(disk.pop('free_mb'), 1.0)\n",
"VAR_8 = bot_main.get_state(None, 12)\n",
"for disk in VAR_8['dis... | [
"def test_get_state(self):...\n",
"self.mock(time, 'time', lambda : 126.0)\n",
"expected = os_utilities.get_state()\n",
"expected['sleep_streak'] = 12\n",
"for disk in expected['disks'].itervalues():\n",
"self.assertGreater(disk.pop('free_mb'), 1.0)\n",
"actual = bot_main.get_state(None, 12)\n",
"for ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_2 is None:\n",
"if 'access_token' in VAR_2:\n",
"return FUNC_3(VAR_1, VAR_2)\n",
"if 'oauth_token' in VAR_2 and 'oauth_token_secret' in VAR_2:\n",
"return FUNC_2(VAR_1, VAR_2)\n",
"if 'error' in VAR_2:\n"
] | [
"def response_token_setter(remote, resp):...\n",
"\"\"\"docstring\"\"\"\n",
"if resp is None:\n",
"if 'access_token' in resp:\n",
"return oauth2_token_setter(remote, resp)\n",
"if 'oauth_token' in resp and 'oauth_token_secret' in resp:\n",
"return oauth1_token_setter(remote, resp)\n",
"if 'error' in r... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition"
] |
[
"def FUNC_6(self):...\n",
"VAR_4 = 'autotest-errors'\n",
"VAR_2 = '/api/apps'\n",
"VAR_5 = {'id': 'camelCase'}\n",
"VAR_3 = self.client.post(VAR_2, json.dumps(VAR_5), content_type=\n 'application/json')\n",
"self.assertContains(VAR_3, 'App IDs can only contain [a-z0-9-]',\n status_code=400)\n",
"V... | [
"def test_app_errors(self):...\n",
"app_id = 'autotest-errors'\n",
"url = '/api/apps'\n",
"body = {'id': 'camelCase'}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertContains(response, 'App IDs can only contain [a-z0-9-]',\n status_code=400... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Assign'",
"Expr'"
] |
[
"__packagename__ = 'dwave-hybrid'\n",
"__title__ = 'D-Wave Hybrid'\n",
"__version__ = '0.1.4'\n",
"__author__ = 'D-Wave Systems Inc.'\n",
"__authoremail__ = 'radomir@dwavesys.com'\n",
"__description__ = 'Hybrid Asynchronous Decomposition Solver Framework'\n",
"__url__ = 'https://github.com/dwavesystems/... | [
"__packagename__ = 'dwave-hybrid'\n",
"__title__ = 'D-Wave Hybrid'\n",
"__version__ = '0.1.4'\n",
"__author__ = 'D-Wave Systems Inc.'\n",
"__authoremail__ = 'radomir@dwavesys.com'\n",
"__description__ = 'Hybrid Asynchronous Decomposition Solver Framework'\n",
"__url__ = 'https://github.com/dwavesystems/... | [
0,
0,
1,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_31():...\n",
"VAR_24 = vim.eval('tagfiles()')\n",
"VAR_25 = VAR_0.getcwd()\n",
"return [VAR_0.path.join(VAR_25, x) for x in VAR_24]\n"
] | [
"def GetTagFiles():...\n",
"tag_files = vim.eval('tagfiles()')\n",
"current_working_directory = os.getcwd()\n",
"return [os.path.join(current_working_directory, x) for x in tag_files]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, *VAR_4, **VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_9 in VAR_4:\n",
"self._set_inoutput_item(VAR_9)\n",
"for VAR_10, VAR_9 in VAR_6.items():\n",
"self._set_inoutput_item(VAR_9, VAR_10=name)\n"
] | [
"def set_input(self, *input, **kwinput):...\n",
"\"\"\"docstring\"\"\"\n",
"for item in input:\n",
"self._set_inoutput_item(item)\n",
"for name, item in kwinput.items():\n",
"self._set_inoutput_item(item, name=name)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"from __future__ import unicode_literals\n",
"from django.db import models, migrations\n",
"import django.db.models.deletion\n",
"import diploma.models\n",
"import lib.models\n",
"import lib.fields\n",
"VAR_0 = [('exercise', '0024_auto_20160919_1951'), ('course',\n '0030_auto_20160912_1341'), ('userp... | [
"from __future__ import unicode_literals\n",
"from django.db import models, migrations\n",
"import django.db.models.deletion\n",
"import diploma.models\n",
"import lib.models\n",
"import lib.fields\n",
"dependencies = [('exercise', '0024_auto_20160919_1951'), ('course',\n '0030_auto_20160912_1341'), ... | [
0,
0,
0,
0,
0,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Assign'"
] |
[
"async def FUNC_8(VAR_6):...\n",
"VAR_14 = await FUNC_9(VAR_6, '/leaders')\n",
"assert VAR_14 == '0'\n"
] | [
"async def test_show_leaders(test_client):...\n",
"text = await _get(test_client, '/leaders')\n",
"assert text == '0'\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Assert'"
] |
[
"def FUNC_8(self):...\n",
"self.uut.executable = 'echo'\n",
"self.uut.config_file = lambda : ['config line1']\n",
"VAR_6 = self.uut.generate_config_file()\n",
"self.assertTrue(os.path.isfile(VAR_6))\n",
"os.remove(VAR_6)\n",
"self.uut.lint('filename')\n"
] | [
"def test_config_file_generator(self):...\n",
"self.uut.executable = 'echo'\n",
"self.uut.config_file = lambda : ['config line1']\n",
"config_filename = self.uut.generate_config_file()\n",
"self.assertTrue(os.path.isfile(config_filename))\n",
"os.remove(config_filename)\n",
"self.uut.lint('filename')\n"... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_24(self):...\n",
"self.compilation_ko(\n \"\"\"\n/* this is a comment /* with a nested comment inside */\nit is allowed by the RFC :p */\n\"\"\"\n )\n"
] | [
"def test_nested_comments(self):...\n",
"self.compilation_ko(\n \"\"\"\n/* this is a comment /* with a nested comment inside */\nit is allowed by the RFC :p */\n\"\"\"\n )\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_21(self):...\n",
"if not self._IsServerAlive():\n",
"return\n",
"SendEventNotificationAsync('CurrentIdentifierFinished')\n"
] | [
"def OnCurrentIdentifierFinished(self):...\n",
"if not self._IsServerAlive():\n",
"return\n",
"SendEventNotificationAsync('CurrentIdentifierFinished')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"@staticmethod...\n",
"return mongo.db.analysis.find_one({'info.id': int(VAR_1)}, sort=[('_id',\n pymongo.DESCENDING)])\n"
] | [
"@staticmethod...\n",
"return mongo.db.analysis.find_one({'info.id': int(task_id)}, sort=[('_id',\n pymongo.DESCENDING)])\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"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_9(self):...\n",
"VAR_17 = []\n",
"VAR_18 = threading.Event()\n",
"self.mock(VAR_18, 'wait', VAR_17.append)\n",
"self.mock(bot_main, 'run_manifest', self.fail)\n",
"self.mock(bot_main, 'update_bot', self.fail)\n",
"self.expected_requests([(\n 'https://localhost:1/auth/api/v1/accounts/self/xs... | [
"def test_poll_server_sleep(self):...\n",
"slept = []\n",
"bit = threading.Event()\n",
"self.mock(bit, 'wait', slept.append)\n",
"self.mock(bot_main, 'run_manifest', self.fail)\n",
"self.mock(bot_main, 'update_bot', self.fail)\n",
"self.expected_requests([(\n 'https://localhost:1/auth/api/v1/accounts... | [
0,
0,
0,
0,
0,
0,
5,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertFalse(Script.objects.get(VAR_2=5).qa_begun,\n 'The Script should have qa_begun of False at the beginning')\n",
"VAR_1 = self.client.get('/qa/extractionscript/5/')\n",
"self.assertTrue(Script.objects.get(VAR_2=5).qa_begun,\n 'qa_begun sho... | [
"def test_qa_begin(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertFalse(Script.objects.get(pk=5).qa_begun,\n 'The Script should have qa_begun of False at the beginning')\n",
"response = self.client.get('/qa/extractionscript/5/')\n",
"self.assertTrue(Script.objects.get(pk=5).qa_begun,\n 'qa_begun... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = jc.Contract()\n",
"return st.OperationContract(self.agent.make_delete_app_operation(VAR_1=self\n .bindings, application=self.TEST_APP), VAR_5=contract)\n"
] | [
"def delete_app(self):...\n",
"\"\"\"docstring\"\"\"\n",
"contract = jc.Contract()\n",
"return st.OperationContract(self.agent.make_delete_app_operation(bindings=\n self.bindings, application=self.TEST_APP), contract=contract)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self, VAR_14=None, VAR_15=False, VAR_16=False, VAR_17=1, VAR_18...\n",
"self.global_resources = dict() if VAR_52 is None else VAR_52\n",
"self.global_resources['_cores'] = VAR_17\n",
"self.global_resources['_nodes'] = VAR_18\n",
"def FUNC_2(VAR_87):...\n",
"return map(self._rules.__getitem__,... | [
"def execute(self, targets=None, dryrun=False, touch=False, cores=1, nodes=1,...\n",
"self.global_resources = dict() if resources is None else resources\n",
"self.global_resources['_cores'] = cores\n",
"self.global_resources['_nodes'] = nodes\n",
"def rules(items):...\n",
"return map(self._rules.__getitem... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self, VAR_6):...\n",
"for tgt in VAR_6:\n",
"for type_constraint, target_predicate in self._native_target_matchers.items():\n",
"return False\n",
"if type_constraint.satisfied_by(tgt) and target_predicate(tgt):\n",
"return True\n"
] | [
"def _any_targets_have_native_sources(self, targets):...\n",
"for tgt in targets:\n",
"for type_constraint, target_predicate in self._native_target_matchers.items():\n",
"return False\n",
"if type_constraint.satisfied_by(tgt) and target_predicate(tgt):\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"For",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_7():...\n",
"return FUNC_8(RegisterForm())\n"
] | [
"def render_register():...\n",
"return render_registerForm(RegisterForm())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"\"\"\"\nCreated on Sat Dec 23 13:43:09 2017\n\n@author: Adam\n\"\"\"\n",
"import sys\n",
"import os\n",
"import time\n",
"import warnings\n",
"import getpass\n",
"import sqlite3\n",
"from importlib import import_module\n",
"import pymysql\n",
"from cryptography.fernet import Fernet\n",
"from .c... | [
"\"\"\"\nCreated on Sat Dec 23 13:43:09 2017\n\n@author: Adam\n\"\"\"\n",
"import sys\n",
"import os\n",
"import time\n",
"import warnings\n",
"import getpass\n",
"import sqlite3\n",
"from importlib import import_module\n",
"import pymysql\n",
"from cryptography.fernet import Fernet\n",
"from .c... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_12():...\n",
"VAR_18 = requests.get(FUNC_2('healthy'))\n",
"VAR_18.raise_for_status()\n",
"return VAR_18.json()\n"
] | [
"def _ServerIsHealthy():...\n",
"response = requests.get(_BuildUri('healthy'))\n",
"response.raise_for_status()\n",
"return response.json()\n"
] | [
0,
7,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"self.compilation_ok(\"\"\"\nif true {\n\n}\n\"\"\")\n",
"self.representation_is(\"\"\"\nif (type: control)\n true (type: test)\n\"\"\")\n"
] | [
"def test_true_test(self):...\n",
"self.compilation_ok(\"\"\"\nif true {\n\n}\n\"\"\")\n",
"self.representation_is(\"\"\"\nif (type: control)\n true (type: test)\n\"\"\")\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = request.args.get('group_by')\n",
"if not VAR_4:\n",
"VAR_4 = ''\n",
"return VAR_4\n"
] | [
"def get_group_by_args():...\n",
"\"\"\"docstring\"\"\"\n",
"group_by = request.args.get('group_by')\n",
"if not group_by:\n",
"group_by = ''\n",
"return group_by\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_1():...\n",
"VAR_1 = [{'fieldname': 'territory', 'fieldtype': 'Link', 'label': _(\n 'Territory'), 'options': 'Territory', 'width': 100}, {'fieldname':\n 'item_group', 'fieldtype': 'Link', 'label': _('Item Group'), 'options':\n 'Item Group', 'width': 150}, {'fieldname': 'item_name', 'fieldtype':... | [
"def get_columns():...\n",
"columns = [{'fieldname': 'territory', 'fieldtype': 'Link', 'label': _(\n 'Territory'), 'options': 'Territory', 'width': 100}, {'fieldname':\n 'item_group', 'fieldtype': 'Link', 'label': _('Item Group'), 'options':\n 'Item Group', 'width': 150}, {'fieldname': 'item_name', 'fiel... | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@property...\n",
"return self._log\n"
] | [
"@property...\n",
"return self._log\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@api.public...\n",
"self.response.write('OK')\n"
] | [
"@api.public...\n",
"self.response.write('OK')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_10(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = kijiji_api.KijijiApi()\n",
"VAR_20.login(VAR_0.username, VAR_0.password)\n",
"VAR_22 = ''\n",
"for line in open(VAR_0.inf_file, 'rt'):\n",
"[VAR_24, VAR_25] = line.strip().rstrip('\\n').split('=')\n",
"VAR_23 = VAR_20.get_all_ads()\n",
... | [
"def check_ad(args):...\n",
"\"\"\"docstring\"\"\"\n",
"api = kijiji_api.KijijiApi()\n",
"api.login(args.username, args.password)\n",
"AdName = ''\n",
"for line in open(args.inf_file, 'rt'):\n",
"[key, val] = line.strip().rstrip('\\n').split('=')\n",
"allAds = api.get_all_ads()\n",
"if key == 'postA... | [
0,
0,
0,
0,
5,
0,
0,
5,
0,
5,
5
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"@staticmethod...\n",
"return False\n"
] | [
"@staticmethod...\n",
"return False\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_1(self, VAR_0):...\n",
"return static_file(VAR_0, self.get_base_path())\n"
] | [
"def get(self, path):...\n",
"return static_file(path, self.get_base_path())\n"
] | [
0,
1
] | [
"FunctionDef'",
"Return'"
] |
[
"@cache(VAR_3 % ('{user_id}', '{self.id}'), ONE_HOUR)...\n",
"VAR_20 = [VAR_19.id for VAR_19 in await self.comments]\n",
"if not VAR_20:\n",
"return []\n",
"VAR_21 = await ReactItem.filter(Q(VAR_5=user_id), Q(target_id__in=cids), Q(\n target_kind=K_COMMENT))\n",
"return [item.target_id for item in VAR_... | [
"@cache(MC_KEY_COMMNET_IDS_LIKED_BY_USER % ('{user_id}', '{self.id}'), ONE_HOUR)...\n",
"cids = [c.id for c in await self.comments]\n",
"if not cids:\n",
"return []\n",
"queryset = await ReactItem.filter(Q(user_id=user_id), Q(target_id__in=cids),\n Q(target_kind=K_COMMENT))\n",
"return [item.target_id ... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None, VAR_20=''):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11)\n",
"VAR_31 = {'all': 'all.zip', 'geotiff': os.path.join('odm_orthophoto',\n 'odm_orthophoto.tif'), 'las': os.path.join('odm_georeferencing',\n 'odm_... | [
"def get(self, request, pk=None, project_pk=None, asset=''):...\n",
"\"\"\"docstring\"\"\"\n",
"task = self.get_and_check_task(request, pk, project_pk)\n",
"allowed_assets = {'all': 'all.zip', 'geotiff': os.path.join(\n 'odm_orthophoto', 'odm_orthophoto.tif'), 'las': os.path.join(\n 'odm_georeferencing'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"VAR_15 = self.env['event.event'].search([('fit_repetition_enabled', '=', True)]\n )\n",
"for repeating_event in VAR_15:\n",
"VAR_0.info('Found repeating event: ' + repeating_event.name)\n",
"if repeating_event.fit_repetition == 'daily':\n",
"self._handle_daily_event_repetitio... | [
"def start_automatic_event_creation(self):...\n",
"repeating_event_ids = self.env['event.event'].search([(\n 'fit_repetition_enabled', '=', True)])\n",
"for repeating_event in repeating_event_ids:\n",
"_logger.info('Found repeating event: ' + repeating_event.name)\n",
"if repeating_event.fit_repetition =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def __init__(self, VAR_65, VAR_7, *VAR_15, **VAR_16):...\n",
"self.cache_prefix = VAR_65\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n"
] | [
"def __init__(self, cache_prefix, param, *a, **kw):...\n",
"self.cache_prefix = cache_prefix\n",
"Validator.__init__(self, param, *a, **kw)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_29(self):...\n",
"VAR_18 = self._get_explicit_jdk_paths()\n",
"VAR_38 = CLASS_6(CLASS_5(*VAR_18), CLASS_6(CLASS_2(), CLASS_4.standard(),\n CLASS_3.standard()))\n",
"return CLASS_7(VAR_38, self.get_options().minimum_version, self.get_options\n ().maximum_version)\n"
] | [
"def _create_locator(self):...\n",
"homes = self._get_explicit_jdk_paths()\n",
"environment = _UnknownEnvironment(_ExplicitEnvironment(*homes),\n _UnknownEnvironment(_EnvVarEnvironment(), _LinuxEnvironment.standard(),\n _OSXEnvironment.standard()))\n",
"return _Locator(environment, self.get_options().mi... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"if self.limit_page_length:\n",
"return 'limit %s, %s' % (self.limit_start, self.limit_page_length)\n",
"return ''\n"
] | [
"def add_limit(self):...\n",
"if self.limit_page_length:\n",
"return 'limit %s, %s' % (self.limit_start, self.limit_page_length)\n",
"return ''\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1.value = beamr.interpreters.Url(VAR_1.value[1:-1])\n",
"return VAR_1\n"
] | [
"def t_URL(t):...\n",
"\"\"\"docstring\"\"\"\n",
"t.value = beamr.interpreters.Url(t.value[1:-1])\n",
"return t\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_21(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 4}, 'CONFIDENCE': {'HIGH': 4}}\n",
"self.check_example('mktemp.py', VAR_2)\n"
] | [
"def test_mktemp(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 4}, 'CONFIDENCE': {'HIGH': 4}}\n",
"self.check_example('mktemp.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_32, VAR_33, VAR_30):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_33 & os.O_WRONLY == os.O_WRONLY or VAR_33 & os.O_RDWR == os.O_RDWR:\n",
"VAR_68 = VAR_30 & ~111\n",
"if VAR_33 & os.O_RDONLY == os.O_RDONLY:\n",
"VAR_69 = '%s/%s_sftp_%s' % (self.cfg.get('honeypot', 'download_path'), tim... | [
"def open(self, filename, openFlags, mode):...\n",
"\"\"\"docstring\"\"\"\n",
"if openFlags & os.O_WRONLY == os.O_WRONLY or openFlags & os.O_RDWR == os.O_RDWR:\n",
"hostmode = mode & ~111\n",
"if openFlags & os.O_RDONLY == os.O_RDONLY:\n",
"hostfile = '%s/%s_sftp_%s' % (self.cfg.get('honeypot', 'download_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_20(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.config['hostname'] in self.node_list and self.config['no_local']:\n",
"self.node_list.remove(self.config['hostname'])\n",
"for i in self.config['ip_addrs']:\n",
"if i in self.node_list:\n",
"if self.config['master']:\n",
"self.node_list.re... | [
"def reduce_node_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.config['hostname'] in self.node_list and self.config['no_local']:\n",
"self.node_list.remove(self.config['hostname'])\n",
"for i in self.config['ip_addrs']:\n",
"if i in self.node_list:\n",
"if self.config['master']:\n",
"self.nod... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"For",
"Condition",
"Condition",
"Expr'",
"For",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_49):...\n",
""
] | [
"def run(self, sr_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = ['hp3par_api_url', 'hp3par_username', 'hp3par_password', 'san_ip',\n 'san_login', 'san_password']\n",
"self.common.check_flags(self.configuration, VAR_18)\n"
] | [
"def _check_flags(self):...\n",
"\"\"\"docstring\"\"\"\n",
"required_flags = ['hp3par_api_url', 'hp3par_username', 'hp3par_password',\n 'san_ip', 'san_login', 'san_password']\n",
"self.common.check_flags(self.configuration, required_flags)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"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"
] | [
"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
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_56(self):...\n",
"self.run_example('binding.py')\n",
"VAR_10 = self.b_mgr.get_issue_list()\n",
"VAR_11 = VAR_10[0].get_code().splitlines()\n",
"VAR_12 = VAR_10[0].lineno\n",
"self.assertEqual('%i ' % (VAR_12 - 1), VAR_11[0][:2])\n",
"self.assertEqual('%i ' % VAR_12, VAR_11[1][:2])\n",
"self.... | [
"def test_code_line_numbers(self):...\n",
"self.run_example('binding.py')\n",
"issues = self.b_mgr.get_issue_list()\n",
"code_lines = issues[0].get_code().splitlines()\n",
"lineno = issues[0].lineno\n",
"self.assertEqual('%i ' % (lineno - 1), code_lines[0][:2])\n",
"self.assertEqual('%i ' % lineno, code... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_0.add_cog(CLASS_0(VAR_0))\n"
] | [
"def setup(bot):...\n",
"bot.add_cog(Assistance(bot))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_3, VAR_7, VAR_8, VAR_6):...\n",
"if VAR_8 == wzrpc.status.success:\n",
"self.p.log.debug('Keepalive was successfull')\n",
"if VAR_8 == wzrpc.status.e_req_denied:\n",
"self.p.log.warn('Keepalive status {0}, reauthentificating and rebinding'.\n format(wzrpc.name_status(VAR_8)))\n",
... | [
"def handle_keepalive_reply(self, reqid, seqnum, status, data):...\n",
"if status == wzrpc.status.success:\n",
"self.p.log.debug('Keepalive was successfull')\n",
"if status == wzrpc.status.e_req_denied:\n",
"self.p.log.warn('Keepalive status {0}, reauthentificating and rebinding'.\n format(wzrpc.name_sta... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_18(self):...\n",
"self._test_strtype('blob', None, 4000)\n"
] | [
"def test_large_null_blob(self):...\n",
"self._test_strtype('blob', None, 4000)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_0, VAR_1, *VAR_2, **VAR_3):...\n",
"VAR_11 = CounterCountingForm()\n",
"VAR_12 = JustURL.objects.get(VAR_1=pk)\n",
"return render(VAR_0, 'url-detail-view.html', {'object': VAR_12, 'form': VAR_11}\n )\n"
] | [
"def get(self, request, pk, *args, **kwargs):...\n",
"form = CounterCountingForm()\n",
"object = JustURL.objects.get(pk=pk)\n",
"return render(request, 'url-detail-view.html', {'object': object, 'form': form}\n )\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"from flask import Flask, request, jsonify\n",
"import time\n",
"import requests\n",
"import json\n",
"from TextProcessing import makeNGrams\n",
"from Ranking import Ranking\n",
"import psycopg2\n",
"import pprint\n",
"import random\n",
"random.seed(500)\n",
"VAR_0 = Flask(__name__)\n",
"VAR_1... | [
"from flask import Flask, request, jsonify\n",
"import time\n",
"import requests\n",
"import json\n",
"from TextProcessing import makeNGrams\n",
"from Ranking import Ranking\n",
"import psycopg2\n",
"import pprint\n",
"import random\n",
"random.seed(500)\n",
"app = Flask(__name__)\n",
"conn_st... | [
0,
0,
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'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign... |
[
"def FUNC_21(VAR_18, VAR_29, VAR_30=60):...\n",
"VAR_50 = re.compile(\n 'Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.|Scoring\\\\.\\\\.\\\\.|Evaluated')\n",
"VAR_51 = re.compile('Compilation failed|Evaluated \\\\(|Scored \\\\(')\n",
"VAR_34 = FUNC_0()\n",
"VAR_52 = 0.1\n",
"while VAR_30 > 0:\n",
... | [
"def get_evaluation_result(contest_id, submission_id, timeout=60):...\n",
"WAITING_STATUSES = re.compile(\n 'Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.|Scoring\\\\.\\\\.\\\\.|Evaluated')\n",
"COMPLETED_STATUS = re.compile('Compilation failed|Evaluated \\\\(|Scored \\\\(')\n",
"browser = get_aws_bro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Expr'"
] |
[
"def __init__(self, VAR_24=None, VAR_31=False, VAR_32=False):...\n",
"self.kill_mode = VAR_31\n",
"self.check_mode = VAR_32\n",
"self.logger = logging.getLogger(__name__)\n",
"self.logger.setLevel(logging.DEBUG)\n",
"self.config = None\n",
"self.session = None\n",
"if VAR_31:\n",
"self.logger.info('... | [
"def __init__(self, configfile=None, kill_mode=False, check_mode=False):...\n",
"self.kill_mode = kill_mode\n",
"self.check_mode = check_mode\n",
"self.logger = logging.getLogger(__name__)\n",
"self.logger.setLevel(logging.DEBUG)\n",
"self.config = None\n",
"self.session = None\n",
"if kill_mode:\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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign... |
[
"def FUNC_8(self):...\n",
""
] | [
"def describe(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@auth.route('/confirm')...\n",
"VAR_0 = current_user.generate_confirmation_token()\n",
"send_email(current_user.email, 'Confirm Your Account', 'auth/email/confirm',\n VAR_2=current_user, VAR_0=token)\n",
"flash('A new confirmation email has been sent.')\n",
"return redirect(url_for('main.index'))\n"
] | [
"@auth.route('/confirm')...\n",
"token = current_user.generate_confirmation_token()\n",
"send_email(current_user.email, 'Confirm Your Account', 'auth/email/confirm',\n user=current_user, token=token)\n",
"flash('A new confirmation email has been sent.')\n",
"return redirect(url_for('main.index'))\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(VAR_0):...\n",
"VAR_3 = {'origin': '127.0.0.1', 'args': {}}\n",
"VAR_1 = VAR_0.url + '/get'\n",
"VAR_2 = load_source(VAR_1)\n",
"assert isinstance(VAR_2, collections.Mapping)\n",
"VAR_2.pop('headers')\n",
"VAR_2.pop('url')\n",
"assert VAR_2 == VAR_3\n"
] | [
"def test_url(httpbin):...\n",
"native = {'origin': '127.0.0.1', 'args': {}}\n",
"source = httpbin.url + '/get'\n",
"result = load_source(source)\n",
"assert isinstance(result, collections.Mapping)\n",
"result.pop('headers')\n",
"result.pop('url')\n",
"assert result == native\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Expr'",
"Expr'",
"Assert'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.