lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"\"\"\"\nhttps://www.w3.org/TR/shacl/#core-components-value-type\n\"\"\"\n",
"import rdflib\n",
"from pyshacl.constraints.constraint_component import ConstraintComponent\n",
"from pyshacl.consts import SH, RDFS_subClassOf, RDF_type\n",
"VAR_0 = SH.term('class')\n",
"\"\"\"string\"\"\"\n",
"def __init__(... | [
"\"\"\"\nhttps://www.w3.org/TR/shacl/#core-components-value-type\n\"\"\"\n",
"import rdflib\n",
"from pyshacl.constraints.constraint_component import ConstraintComponent\n",
"from pyshacl.consts import SH, RDFS_subClassOf, RDF_type\n",
"SH_class = SH.term('class')\n",
"\"\"\"\n The condition specified ... | [
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
1,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_44(self):...\n",
"self.cursor.execute('create table t1(id int)')\n",
"for i in range(1, 5):\n",
"self.cursor.execute('insert into t1 values(?)', i)\n",
"self.cursor.execute('select id from t1 order by id')\n",
"self.assertEqual(self.cursor.fetchone()[0], 1)\n",
"self.cursor.skip(2)\n",
"self... | [
"def test_skip(self):...\n",
"self.cursor.execute('create table t1(id int)')\n",
"for i in range(1, 5):\n",
"self.cursor.execute('insert into t1 values(?)', i)\n",
"self.cursor.execute('select id from t1 order by id')\n",
"self.assertEqual(self.cursor.fetchone()[0], 1)\n",
"self.cursor.skip(2)\n",
"se... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"self.assertTrue(os.path.exists(path),\n 'Temporary dir should exist within the context.')\n",
"self.assertTrue(os.path.isdir(path),\n 'Temporary dir should be a dir and not a file.')\n",
"self.assertFalse(os.path.exists(path),\n 'Temporary dir should not exist outside of t... | [
"def test_temporary_dir_no_args(self):...\n",
"self.assertTrue(os.path.exists(path),\n 'Temporary dir should exist within the context.')\n",
"self.assertTrue(os.path.isdir(path),\n 'Temporary dir should be a dir and not a file.')\n",
"self.assertFalse(os.path.exists(path),\n 'Temporary dir should not... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_22(self):...\n",
"@api.public...\n",
"self.response.write(api.get_peer_host() or '<none>')\n",
"VAR_7 = self.make_test_app('/request', CLASS_7)\n",
"def FUNC_26(VAR_20):...\n",
"api.reset_local_state()\n",
"return VAR_7.get('/request', VAR_20=headers).body\n"
] | [
"def test_get_peer_host(self):...\n",
"@api.public...\n",
"self.response.write(api.get_peer_host() or '<none>')\n",
"app = self.make_test_app('/request', Handler)\n",
"def call(headers):...\n",
"api.reset_local_state()\n",
"return app.get('/request', headers=headers).body\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@auth.autologin...\n",
"VAR_17 = models.Error.get_by_id(int(VAR_1))\n",
"if not VAR_17:\n",
"self.abort(404, 'Error not found')\n",
"VAR_11 = {'error': VAR_17, 'now': utils.utcnow()}\n",
"self.response.out.write(template.render('ereporter2/error.html', VAR_11))\n"
] | [
"@auth.autologin...\n",
"error = models.Error.get_by_id(int(error_id))\n",
"if not error:\n",
"self.abort(404, 'Error not found')\n",
"params = {'error': error, 'now': utils.utcnow()}\n",
"self.response.out.write(template.render('ereporter2/error.html', params))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_8, VAR_9, VAR_10, VAR_5, VAR_11):...\n",
"VAR_14 = 'string'.format(VAR_8, VAR_9, VAR_10, VAR_5, VAR_11)\n",
"self.cur.execute(VAR_14)\n",
"self.conn.commit()\n"
] | [
"def create_event(self, title, start_time, time_zone, server_id, description):...\n",
"sql = (\n \"\"\"INSERT INTO events (title, start_time, time_zone, server_id, description)\n VALUES ('{0}', '{1}', '{2}', '{3}', '{4}')\n \"\"\"\n .format(title, start_time, time_zone, serve... | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_21(self):...\n",
"self.compilation_ok('string')\n"
] | [
"def test_vacationext_with_limit(self):...\n",
"self.compilation_ok(\n \"\"\"\nrequire \"vacation\";\nvacation :days 23 :addresses [\"tjs@example.edu\",\n \"ts4z@landru.example.edu\"]\n \"I'm away until October 19.\n If it's an emergency, call 911, I guess.\" ;\n\"\"\"\n )\n... | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_5, VAR_6, VAR_7):...\n",
"self.tag_name = VAR_5.strip()\n",
"self.value = VAR_6\n",
"self.dtstamp = VAR_7\n"
] | [
"def __init__(self, tag, value, dtstamp):...\n",
"self.tag_name = tag.strip()\n",
"self.value = value\n",
"self.dtstamp = dtstamp\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(VAR_2, VAR_3):...\n",
"VAR_15 = set()\n",
"for level in VAR_2:\n",
"VAR_24 = level[0]\n",
"return VAR_15\n",
"VAR_11 = level[1]\n",
"VAR_15 |= VAR_0[VAR_24].get_attributes(VAR_11, VAR_3)\n"
] | [
"def get_rule_attributes(levellist, doc):...\n",
"ret = set()\n",
"for level in levellist:\n",
"leveltype = level[0]\n",
"return ret\n",
"levelfields = level[1]\n",
"ret |= FnLevel[leveltype].get_attributes(levelfields, doc)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"AugAssign'"
] |
[
"def FUNC_13(VAR_9, VAR_7, VAR_11, VAR_10):...\n",
"if VAR_11 == 'POST':\n",
"return CLASS_0.session.post(FUNC_2(VAR_7), VAR_9=ToUtf8Json(data), headers=\n _HEADERS, VAR_10=timeout)\n",
"if VAR_11 == 'GET':\n",
"return CLASS_0.session.get(FUNC_2(VAR_7), headers=_HEADERS, VAR_10=timeout)\n"
] | [
"def SendRequest(data, handler, method, timeout):...\n",
"if method == 'POST':\n",
"return BaseRequest.session.post(_BuildUri(handler), data=ToUtf8Json(data),\n headers=_HEADERS, timeout=timeout)\n",
"if method == 'GET':\n",
"return BaseRequest.session.get(_BuildUri(handler), headers=_HEADERS,\n timeo... | [
0,
0,
7,
0,
7
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_11(VAR_16):...\n",
"if isinstance(VAR_16, (list, tuple)):\n",
"return tuple(FUNC_11(child) for child in VAR_16)\n",
"return VAR_16\n"
] | [
"def tuplify(nested):...\n",
"if isinstance(nested, (list, tuple)):\n",
"return tuple(tuplify(child) for child in nested)\n",
"return nested\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"async def FUNC_7(self, VAR_5):...\n",
"for h in self.handler:\n",
"await h.push(VAR_5)\n"
] | [
"async def processItem(self, item):...\n",
"for h in self.handler:\n",
"await h.push(item)\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"For",
"Expr'"
] |
[
"from datetime import datetime\n",
"from django.core.exceptions import ValidationError\n",
"from django.shortcuts import get_object_or_404\n",
"from mdta.celery_module import app\n",
"from mdta.apps.projects.models import Project\n",
"from mdta.apps.testcases.models import TestCaseResults\n",
"from mdta... | [
"from datetime import datetime\n",
"from django.core.exceptions import ValidationError\n",
"from django.shortcuts import get_object_or_404\n",
"from mdta.celery_module import app\n",
"from mdta.apps.projects.models import Project\n",
"from mdta.apps.testcases.models import TestCaseResults\n",
"from mdta... | [
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assi... |
[
"def __getitem__(self, VAR_17):...\n",
"if self._r_item_ is VAR_0:\n",
"if not self._r_via_alternate_lookup_:\n",
"VAR_28 = CLASS_3(self)\n",
"self._r_path_.log_getitem(VAR_17, self)\n",
"return self\n",
"if VAR_28._r_is_multi_item_ and not isinstance(VAR_17, slice):\n",
"if isinstance(VAR_17, int):\n... | [
"def __getitem__(self, key_or_index_or_slice):...\n",
"if self._r_item_ is MISSING:\n",
"if not self._r_via_alternate_lookup_:\n",
"copy = Roamer(self)\n",
"self._r_path_.log_getitem(key_or_index_or_slice, self)\n",
"return self\n",
"if copy._r_is_multi_item_ and not isinstance(key_or_index_or_slice, sl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Ass... |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.run_local:\n",
"if not (self.configuration.san_password or self.configuration.san_private_key):\n",
"if not self.configuration.san_ip:\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.run_local:\n",
"if not (self.configuration.san_password or self.configuration.san_private_key):\n",
"if not self.configuration.san_ip:\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Condition"
] |
[
"def FUNC_13(self, VAR_64):...\n",
"self._onsuccess = VAR_64\n"
] | [
"def onsuccess(self, func):...\n",
"self._onsuccess = func\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"@VAR_0.route('/signup', methods=['POST'])...\n",
"VAR_8 = request.form.get('first_name')\n",
"VAR_9 = request.form.get('last_name')\n",
"VAR_6 = request.form.get('email')\n",
"VAR_4 = User(VAR_8, VAR_9, VAR_6)\n",
"if VAR_4.isValid():\n",
"db.session.add(VAR_4)\n",
"VAR_15 = make_response(jsonify(err... | [
"@app.route('/signup', methods=['POST'])...\n",
"first_name = request.form.get('first_name')\n",
"last_name = request.form.get('last_name')\n",
"email = request.form.get('email')\n",
"user = User(first_name, last_name, email)\n",
"if user.isValid():\n",
"db.session.add(user)\n",
"resp = make_response(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_23(VAR_31, VAR_32, VAR_3, VAR_33, VAR_34=apply_wildcards, VAR_35=None...\n",
"for VAR_10, VAR_9 in VAR_32.allitems():\n",
"VAR_48 = len(VAR_31)\n",
"VAR_49 = True\n",
"if callable(VAR_9):\n",
"if not_iterable(VAR_9):\n",
"VAR_9 = VAR_9(VAR_33)\n",
"if not_iterable(VAR_9):\n",
"VAR_9 = [VAR... | [
"def _apply_wildcards(newitems, olditems, wildcards, wildcards_obj,...\n",
"for name, item in olditems.allitems():\n",
"start = len(newitems)\n",
"is_iterable = True\n",
"if callable(item):\n",
"if not_iterable(item):\n",
"item = item(wildcards_obj)\n",
"if not_iterable(item):\n",
"item = [item]\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
] | [
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assig... |
[
"@property...\n",
"return self._output\n"
] | [
"@property...\n",
"return self._output\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"VAR_2 = self.client.get('/datadocument/245401/')\n",
"self.assertContains(VAR_2, '/link_product_form/245401/')\n",
"VAR_6 = {'title': ['Product Title'], 'upc': ['stub_9100'], 'document_type':\n [1], 'return_url': ['/datadocument/245401/']}\n",
"VAR_2 = self.client.post('/link_p... | [
"def test_product_title_duplication(self):...\n",
"response = self.client.get('/datadocument/245401/')\n",
"self.assertContains(response, '/link_product_form/245401/')\n",
"data = {'title': ['Product Title'], 'upc': ['stub_9100'], 'document_type':\n [1], 'return_url': ['/datadocument/245401/']}\n",
"resp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"VAR_9 = []\n",
"VAR_10 = {}\n",
"for kid in self.child_groups:\n",
"VAR_13 = kid.get_hosts()\n",
"for VAR_14 in self.hosts:\n",
"for VAR_15 in VAR_13:\n",
"if VAR_14 not in VAR_10:\n",
"return VAR_9\n",
"if VAR_15 not in VAR_10:\n",
"VAR_10[VAR_14] = 1\n",
"VAR_10[V... | [
"def _get_hosts(self):...\n",
"hosts = []\n",
"seen = {}\n",
"for kid in self.child_groups:\n",
"kid_hosts = kid.get_hosts()\n",
"for mine in self.hosts:\n",
"for kk in kid_hosts:\n",
"if mine not in seen:\n",
"return hosts\n",
"if kk not in seen:\n",
"seen[mine] = 1\n",
"seen[kk] = 1\n",
"i... | [
0,
0,
0,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"For",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(VAR_17, commands.MissingRequiredArgument):\n",
"await VAR_16.message.add_reaction('💭')\n",
"traceback.print_exception(type(VAR_17), VAR_17, VAR_17.__traceback__)\n",
"return\n",
"VAR_17 = VAR_17.__cause__ if VAR_17.__cause__ else VAR_17\n"... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(error, commands.MissingRequiredArgument):\n",
"await ctx.message.add_reaction('💭')\n",
"traceback.print_exception(type(error), error, error.__traceback__)\n",
"return\n",
"error = error.__cause__ if error.__cause__ else error\n",
"if isi... | [
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"return self.vars.copy()\n"
] | [
"def get_vars(self):...\n",
"return self.vars.copy()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import functools\n",
"from flask import Blueprint, flash, redirect, render_template, request, session, url_for, g\n",
"from werkzeug.security import check_password_hash, generate_password_hash\n",
"from DefinitelyNotTwitter.database import get_db\n",
"from . import user\n",
"from . import database as db\... | [
"import functools\n",
"from flask import Blueprint, flash, redirect, render_template, request, session, url_for, g\n",
"from werkzeug.security import check_password_hash, generate_password_hash\n",
"from DefinitelyNotTwitter.database import get_db\n",
"from . import user\n",
"from . import database as db\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"@app.route('/about')...\n",
"return render_template('about.html')\n"
] | [
"@app.route('/about')...\n",
"return render_template('about.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_36():...\n",
"response.set_header('Frame-Options', '')\n"
] | [
"def disable_protection():...\n",
"response.set_header('Frame-Options', '')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_1.route('/login', methods=['GET', 'POST'])...\n",
"if current_user.is_authenticated:\n",
"return redirect(url_for('view_home'))\n",
"VAR_42 = CLASS_8()\n",
"if VAR_42.validate_on_submit():\n",
"login_user(VAR_42.user, remember=True)\n",
"return render_template('login.html', VAR_9=login_form)\n",
... | [
"@app.route('/login', methods=['GET', 'POST'])...\n",
"if current_user.is_authenticated:\n",
"return redirect(url_for('view_home'))\n",
"login_form = LoginForm()\n",
"if login_form.validate_on_submit():\n",
"login_user(login_form.user, remember=True)\n",
"return render_template('login.html', form=login_... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_3(self, VAR_8=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_8 is None:\n",
"return self.request.path\n",
"assert VAR_8[0] == '/'\n",
"if self._request_is_for_prefixed_path():\n",
"return '/%s%s' % (site_settings.OPTIONAL_PATH_PREFIX, VAR_8)\n",
"return VAR_8\n"
] | [
"def build_absolute_path(self, path=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if path is None:\n",
"return self.request.path\n",
"assert path[0] == '/'\n",
"if self._request_is_for_prefixed_path():\n",
"return '/%s%s' % (site_settings.OPTIONAL_PATH_PREFIX, path)\n",
"return path\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assert'",
"For",
"Return'",
"Return'"
] |
[
"def FUNC_11(VAR_22, VAR_23):...\n",
"if not VAR_23:\n",
"return VAR_22\n",
"for k in VAR_23.split('.'):\n",
"if k in VAR_22 and isinstance(VAR_22[k], dict):\n",
"return VAR_22\n",
"VAR_22 = VAR_22[k]\n"
] | [
"def strip_hash(h, keys):...\n",
"if not keys:\n",
"return h\n",
"for k in keys.split('.'):\n",
"if k in h and isinstance(h[k], dict):\n",
"return h\n",
"h = h[k]\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_12(self, VAR_14):...\n",
"if super(CLASS_4, self).on_torrents(VAR_14):\n",
"self.table_view.window().edit_channel_page.channel_dirty = VAR_14['dirty']\n",
"self.table_view.window().edit_channel_page.update_channel_commit_views()\n"
] | [
"def on_torrents(self, response):...\n",
"if super(MyTorrentsTableViewController, self).on_torrents(response):\n",
"self.table_view.window().edit_channel_page.channel_dirty = response['dirty']\n",
"self.table_view.window().edit_channel_page.update_channel_commit_views()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'"
] |
[
"import logging\n",
"from datetime import datetime\n",
"from queue import Queue\n",
"import MySQLdb\n",
"from htmlscraper.listing import Listing\n",
"VAR_0 = logging.getLogger(__name__)\n",
"VAR_1 = {'id': 'id', 'title': 'title', 'pubdate': 'publish_date', 'loc_id':\n 'location_id', 'addr': 'address'... | [
"import logging\n",
"from datetime import datetime\n",
"from queue import Queue\n",
"import MySQLdb\n",
"from htmlscraper.listing import Listing\n",
"logger = logging.getLogger(__name__)\n",
"FIELDS_DICT = {'id': 'id', 'title': 'title', 'pubdate': 'publish_date',\n 'loc_id': 'location_id', 'addr': 'a... | [
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
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Expr'... |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'ANDERSON BEHAVIOR CONSULTING', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='INTERVENTION BEHAVIOUR', VAR_10=[{'name':\n '----INTERVENTION BEHAVIOUR'}, {'name': '----INTERVENTION'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'ANDERSON BEHAVIOR CONSULTING', id='1')\n",
"verify_results(client, jwt, query='INTERVENTION BEHAVIOUR', expected=[{\n 'name': '----INTERVENTION BEHAVIOUR'}, {'name': '----INTERVENTION'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_41(self):...\n",
"VAR_92 = User.objects.filter(username=self.new_value).values_list('pk',\n flat=True)\n",
"if not VAR_92:\n",
"VAR_101 = 'Reviewer %s is not found' % self.new_value\n",
"self.get_update_targets().update(**{str(self.target_field): reviewers[0]})\n"
] | [
"def _update_reviewer(self):...\n",
"reviewers = User.objects.filter(username=self.new_value).values_list('pk',\n flat=True)\n",
"if not reviewers:\n",
"err_msg = 'Reviewer %s is not found' % self.new_value\n",
"self.get_update_targets().update(**{str(self.target_field): reviewers[0]})\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_21(VAR_10):...\n",
"VAR_9.append(1)\n",
"return False\n"
] | [
"def setup_bot(_bot):...\n",
"setup_bots.append(1)\n",
"return False\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if 'network' in VAR_5 and 'domains' in VAR_5['network']:\n",
"VAR_20 = dict((i['domain'], i['ip']) for i in VAR_5['network']['domains'])\n",
"VAR_20 = dict()\n",
"VAR_21 = dict((i['ip'], i['domain']) for i in VAR_5['network']['domains'])\n",
"VAR_21 = di... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if 'network' in report and 'domains' in report['network']:\n",
"domainlookups = dict((i['domain'], i['ip']) for i in report['network'][\n 'domains'])\n",
"domainlookups = dict()\n",
"iplookups = dict((i['ip'], i['domain']) for i in report['network']['do... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Return'",
"For",
"Assign'"
] |
[
"def FUNC_7(self, VAR_5, VAR_6):...\n",
"VAR_14 = 'string' % (self.name, self.password, self.email, self.country, VAR_5)\n",
"if VAR_6 == 1:\n",
"VAR_9 = \"select count(*) from users where name='%s';\" % self.name\n",
"sql.updateDB(self.conn, VAR_14)\n",
"VAR_10 = sql.queryDB(self.conn, VAR_9)\n",
"retu... | [
"def modifyUserInfo(self, userid, flag):...\n",
"sqlText = (\n \"update users set name='%s',password='%s',email='%s',country='%s' where userid='%d';\"\n % (self.name, self.password, self.email, self.country, userid))\n",
"if flag == 1:\n",
"sqlName = \"select count(*) fr... | [
0,
4,
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"@VAR_7.context_processor...\n",
"return dict(admin_base_template=admin.base_template, admin_view=admin.\n index_view, h=helpers, get_url=url_for)\n"
] | [
"@security_ctx.context_processor...\n",
"return dict(admin_base_template=admin.base_template, admin_view=admin.\n index_view, h=helpers, get_url=url_for)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_1):...\n",
"VAR_0.info('loading constants for process')\n",
"self.db = VAR_1\n"
] | [
"def __init__(self, db):...\n",
"LOG.info('loading constants for process')\n",
"self.db = db\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"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_3(self, VAR_15, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = gcp.GceContractBuilder(self.gce_observer)\n",
"VAR_22 = VAR_20.new_clause_builder('Instances Deleted', retryable_for_secs=\n 15, strict=True).list_resources('instances')\n",
"for name in VAR_15:\n",
"VAR_40 = jc.PathContains... | [
"def terminate_instances(self, names, zone):...\n",
"\"\"\"docstring\"\"\"\n",
"builder = gcp.GceContractBuilder(self.gce_observer)\n",
"clause = builder.new_clause_builder('Instances Deleted', retryable_for_secs\n =15, strict=True).list_resources('instances')\n",
"for name in names:\n",
"name_matches_... | [
0,
0,
0,
0,
0,
1,
0,
1,
0,
1
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Expr'"
] |
[
"@tornado.gen.coroutine...\n",
"VAR_17 = 'INSERT INTO boiler_rooms(district_id, name) VALUES (%s, %s)'\n",
"VAR_18 = VAR_9, VAR_8\n",
"yield VAR_1.execute(query=sql, VAR_18=params)\n"
] | [
"@tornado.gen.coroutine...\n",
"sql = 'INSERT INTO boiler_rooms(district_id, name) VALUES (%s, %s)'\n",
"params = dist_id, name\n",
"yield tx.execute(query=sql, params=params)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_open(%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_open(self, url, **kwargs):...\n",
"logging.warn('url_open(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)\n",
"da... | [
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(VAR_1):...\n",
"VAR_3 = [_('Employee') + ':Link/Employee:150', _('Employee Name') + '::200',\n _('Department') + '::150']\n",
"for leave_type in VAR_1:\n",
"VAR_3.append(_(leave_type) + ' ' + _('Opening') + ':Float:160')\n",
"return VAR_3\n",
"VAR_3.append(_(leave_type) + ' ' + _('Taken') +... | [
"def get_columns(leave_types):...\n",
"columns = [_('Employee') + ':Link/Employee:150', _('Employee Name') +\n '::200', _('Department') + '::150']\n",
"for leave_type in leave_types:\n",
"columns.append(_(leave_type) + ' ' + _('Opening') + ':Float:160')\n",
"return columns\n",
"columns.append(_(leave_t... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Return'",
"Expr'",
"Expr'"
] |
[
"import os\n",
"import sys\n",
"import imp\n",
"import logging\n",
"def FUNC_0(VAR_0):...\n",
"return os.path.exists(os.path.join(VAR_0, '__init__.py'))\n"
] | [
"import os\n",
"import sys\n",
"import imp\n",
"import logging\n",
"def _is_package(directory):...\n",
"return os.path.exists(os.path.join(directory, '__init__.py'))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = CLASS_1.get_user_by_username(VAR_8)\n",
"VAR_26 = CLASS_1.get_user_by_id(VAR_9)\n",
"CLASS_1.check_and_update_mapper_level(VAR_10.id)\n",
"return VAR_10.as_dto(VAR_26.username)\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"requested_user = UserService.get_user_by_username(requested_username)\n",
"logged_in_user = UserService.get_user_by_id(logged_in_user_id)\n",
"UserService.check_and_update_mapper_level(requested_user.id)\n",
"return requested_user.as_dto(logged_in_user.use... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_8(self, VAR_13, VAR_14):...\n",
"VAR_35 = Gtk.FileChooserDialog('Choose Keepass Database', self, Gtk.\n FileChooserAction.OPEN, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk\n .STOCK_OPEN, Gtk.ResponseType.OK))\n",
"VAR_36 = Gtk.FileFilter()\n",
"VAR_36.set_name('Keepass 2 Database')\n",
"... | [
"def open_filechooser(self, widget, none):...\n",
"filechooser_opening_dialog = Gtk.FileChooserDialog('Choose Keepass Database',\n self, Gtk.FileChooserAction.OPEN, (Gtk.STOCK_CANCEL, Gtk.ResponseType.\n CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK))\n",
"filter_text = Gtk.FileFilter()\n",
"filter_text.s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"\"\"\"Volume driver for Dell EqualLogic Storage.\"\"\"\n",
"import functools\n",
"import random\n",
"import eventlet\n",
"from eventlet import greenthread\n",
"import greenlet\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\n",
... | [
"\"\"\"Volume driver for Dell EqualLogic Storage.\"\"\"\n",
"import functools\n",
"import random\n",
"import eventlet\n",
"from eventlet import greenthread\n",
"import greenlet\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\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
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Conditi... |
[
"def FUNC_17(self):...\n",
"self.compilation_ok(\"\"\"\nif anyof (true) {\n discard;\n}\n\"\"\")\n",
"self.representation_is(\n \"\"\"\nif (type: control)\n anyof (type: test)\n true (type: test)\n discard (type: action)\n\"\"\"\n )\n"
] | [
"def test_singletest_testlist(self):...\n",
"self.compilation_ok(\"\"\"\nif anyof (true) {\n discard;\n}\n\"\"\")\n",
"self.representation_is(\n \"\"\"\nif (type: control)\n anyof (type: test)\n true (type: test)\n discard (type: action)\n\"\"\"\n )\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"super(CLASS_6, VAR_0).setUpTestData()\n",
"VAR_0.permission = 'testcases.change_testcase'\n",
"VAR_0.case_update_url = reverse('ajax-update_cases_default_tester')\n"
] | [
"@classmethod...\n",
"super(TestUpdateCasePriority, cls).setUpTestData()\n",
"cls.permission = 'testcases.change_testcase'\n",
"cls.case_update_url = reverse('ajax-update_cases_default_tester')\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_11(self, VAR_12, VAR_13=None):...\n",
"return self.streaming_response(f'wins_complete_{now().isoformat()}.csv')\n"
] | [
"def get(self, request, format=None):...\n",
"return self.streaming_response(f'wins_complete_{now().isoformat()}.csv')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0():...\n",
"VAR_5 = conn.cursor()\n",
"VAR_6 = 'SELECT subject, count(*) FROM articles group by subject;'\n",
"VAR_5.execute(VAR_6)\n",
"VAR_7 = sorted(VAR_5.fetchall(), key=lambda tup: tup[0])\n",
"return VAR_7\n"
] | [
"def get_subjects():...\n",
"cur = conn.cursor()\n",
"query = 'SELECT subject, count(*) FROM articles group by subject;'\n",
"cur.execute(query)\n",
"subjects = sorted(cur.fetchall(), key=lambda tup: tup[0])\n",
"return subjects\n"
] | [
0,
0,
4,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7, VAR_12 = self.make_xsrf_handling_app()\n",
"VAR_17 = VAR_7.get('/request').body\n",
"VAR_7.post('/request', VAR_20={'X-XSRF-Token': token})\n",
"self.assertEqual([('POST', True)], VAR_12)\n"
] | [
"def test_xsrf_token_header(self):...\n",
"\"\"\"docstring\"\"\"\n",
"app, calls = self.make_xsrf_handling_app()\n",
"token = app.get('/request').body\n",
"app.post('/request', headers={'X-XSRF-Token': token})\n",
"self.assertEqual([('POST', True)], calls)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_20(self):...\n",
"self._ServerCleanup()\n"
] | [
"def OnVimLeave(self):...\n",
"self._ServerCleanup()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_47(self):...\n",
"self.compilation_ko(\"\"\"\nif header :isnot \"Sent\" 10000 {\n stop;\n}\n\"\"\")\n"
] | [
"def test_bad_arg_value2(self):...\n",
"self.compilation_ko(\"\"\"\nif header :isnot \"Sent\" 10000 {\n stop;\n}\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_13):...\n",
"VAR_31 = get_uniformed_tracker_url(VAR_13)\n",
"if VAR_31:\n",
"VAR_39 = VAR_0.TrackerState.get(url=sanitized_url) or VAR_0.TrackerState(url\n =sanitized_url)\n",
"self.health.trackers.add(VAR_39)\n"
] | [
"def add_tracker(self, tracker_url):...\n",
"sanitized_url = get_uniformed_tracker_url(tracker_url)\n",
"if sanitized_url:\n",
"tracker = db.TrackerState.get(url=sanitized_url) or db.TrackerState(url=\n sanitized_url)\n",
"self.health.trackers.add(tracker)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def __call__(self, *VAR_18, VAR_2=False, VAR_19=False, VAR_20=None, **VAR_21):...\n",
"if VAR_2 and self._r_item_ is VAR_0:\n",
"if VAR_20 is not None:\n",
"VAR_34 = VAR_20(self._r_item_, *VAR_18, **kwargs)\n",
"if callable(self._r_item_):\n",
"if VAR_19:\n",
"VAR_34 = self._r_item_(*VAR_18, **kwargs)\... | [
"def __call__(self, *args, _raise=False, _roam=False, _invoke=None, **kwargs):...\n",
"if _raise and self._r_item_ is MISSING:\n",
"if _invoke is not None:\n",
"call_result = _invoke(self._r_item_, *args, **kwargs)\n",
"if callable(self._r_item_):\n",
"if _roam:\n",
"call_result = self._r_item_(*args, *... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1():...\n",
""
] | [
"def b():...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'TRU', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='TRUE', VAR_10=[{'name': '----TRUE'}, {'name':\n 'TRU'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'TRU', id='1')\n",
"verify_results(client, jwt, query='TRUE', expected=[{'name': '----TRUE'}, {\n 'name': 'TRU'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_21(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.cursor.execute('create table t1(id integer, s varchar(20))')\n",
"self.cursor.execute('insert into t1 values (?,?)', 1, 'test')\n",
"self.cursor.execute('select * from t1')\n",
"self.cnxn.close()\n",
"self.sql = 'select * from t1'\n",
"self.a... | [
"def test_close_cnxn(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.cursor.execute('create table t1(id integer, s varchar(20))')\n",
"self.cursor.execute('insert into t1 values (?,?)', 1, 'test')\n",
"self.cursor.execute('select * from t1')\n",
"self.cnxn.close()\n",
"self.sql = 'select * from t1'\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"self.assertTrue(os.path.exists(path),\n 'Temporary dir should exist within the context.')\n",
"self.assertTrue(os.path.exists(path),\n 'Temporary dir should exist outside of context if cleanup=False.')\n",
"shutil.rmtree(path)\n"
] | [
"def test_temporary_dir_without_cleanup(self):...\n",
"self.assertTrue(os.path.exists(path),\n 'Temporary dir should exist within the context.')\n",
"self.assertTrue(os.path.exists(path),\n 'Temporary dir should exist outside of context if cleanup=False.')\n",
"shutil.rmtree(path)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
"def setUp(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
0,
5
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_16(VAR_18, VAR_19):...\n",
"VAR_25 = VAR_18.options_scope\n",
"return VAR_18.tool_classpath_from_products(self._products, VAR_19, VAR_25=scope\n )\n"
] | [
"def cp(instance, toolname):...\n",
"scope = instance.options_scope\n",
"return instance.tool_classpath_from_products(self._products, toolname,\n scope=scope)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"from django.http import HttpRequest, HttpResponseForbidden, HttpResponseBadRequest\n",
"from django.shortcuts import redirect\n",
"from django.contrib.auth.models import User\n",
"from . import page_skeleton, magic\n",
"from .form import Form, TextField, PlainText, TextArea, SubmitButton, NumberField, Pass... | [
"from django.http import HttpRequest, HttpResponseForbidden, HttpResponseBadRequest\n",
"from django.shortcuts import redirect\n",
"from django.contrib.auth.models import User\n",
"from . import page_skeleton, magic\n",
"from .form import Form, TextField, PlainText, TextArea, SubmitButton, NumberField, Pass... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Assign'",
"AnnAssign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"... |
[
"@VAR_0.route('/tables')...\n",
"return render_template('tables.html', User=User.query.all())\n"
] | [
"@app.route('/tables')...\n",
"return render_template('tables.html', User=User.query.all())\n"
] | [
0,
4
] | [
"Condition",
"Return'"
] |
[
"def FUNC_0(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = self.table_maps['breakdowns'][VAR_5['id']]\n",
"VAR_20 = []\n",
"for db_val, VAR_7 in BREAKDOWN_TYPES:\n",
"VAR_44 = [b for b in VAR_19 if b.type == db_val]\n",
"return VAR_20\n",
"VAR_44 = sorted(VAR_44, key=attrgetter('year'))\n",... | [
"def _extract_breakdowns(self, win):...\n",
"\"\"\"docstring\"\"\"\n",
"breakdowns = self.table_maps['breakdowns'][win['id']]\n",
"retval = []\n",
"for db_val, name in BREAKDOWN_TYPES:\n",
"type_breakdowns = [b for b in breakdowns if b.type == db_val]\n",
"return retval\n",
"type_breakdowns = sorted(t... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@VAR_2.route('/submit_comment/<pic_name>', methods=['POST', 'GET'])...\n",
"if request.method == 'POST':\n",
"VAR_4 = (\n \"INSERT INTO commentsTable(comment, img_name)\\t\\t\\t\\tVALUES('%s', '%s')\" %\n (request.form['comment'], request.form['image-name']))\n",
"VAR_1.execute(VAR_4)\n",
"VAR_0.comm... | [
"@app.route('/submit_comment/<pic_name>', methods=['POST', 'GET'])...\n",
"if request.method == 'POST':\n",
"query = (\n \"INSERT INTO commentsTable(comment, img_name)\\t\\t\\t\\tVALUES('%s', '%s')\" %\n (request.form['comment'], request.form['image-name']))\n",
"cursor.execute(query)\n",
"db.commit()... | [
4,
4,
4,
4,
4,
4
] | [
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self, VAR_0):...\n",
"return VAR_0.imageupload_set.count()\n"
] | [
"def get_images_count(self, obj):...\n",
"return obj.imageupload_set.count()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"\"\"\"docstring\"\"\"\n",
"shutil.rmtree(self.config['tmp_dir'])\n"
] | [
"def delete_tmp_dir(self):...\n",
"\"\"\"docstring\"\"\"\n",
"shutil.rmtree(self.config['tmp_dir'])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_16(self, VAR_8, **VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = dict()\n",
"VAR_22.update(self.rule.workflow.globals)\n",
"VAR_22.update(dict(input=self.input, output=self.output, VAR_24=self.params,\n VAR_16=self._format_wildcards, threads=self.threads, VAR_23=self.\n resources, log=s... | [
"def format_wildcards(self, string, **variables):...\n",
"\"\"\"docstring\"\"\"\n",
"_variables = dict()\n",
"_variables.update(self.rule.workflow.globals)\n",
"_variables.update(dict(input=self.input, output=self.output, params=self.\n params, wildcards=self._format_wildcards, threads=self.threads,\n ... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@app.route('/politicians/id/<name>')...\n",
"VAR_0 = VAR_0.lower()\n",
"VAR_7 = Politician.all()\n",
"VAR_7.filter('name =', VAR_0)\n",
"VAR_2 = None\n",
"for p in VAR_7:\n",
"VAR_2 = p\n",
"if VAR_2 != None:\n",
"VAR_2.search_count = VAR_2.search_count + 1\n",
"return render_template('politician... | [
"@app.route('/politicians/id/<name>')...\n",
"name = name.lower()\n",
"politicians = Politician.all()\n",
"politicians.filter('name =', name)\n",
"politician = None\n",
"for p in politicians:\n",
"politician = p\n",
"if politician != None:\n",
"politician.search_count = politician.search_count + 1\n... | [
0,
6,
0,
0,
6,
6,
6,
6,
6,
0,
6,
6
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Return'"
] |
[
"import base64\n",
"import binascii\n",
"import cgi\n",
"import io\n",
"import json\n",
"import re\n",
"import time\n",
"import tornado\n",
"import urllib\n",
"from bzs import const\n",
"from bzs import db\n",
"from bzs import files\n",
"from bzs import preproc\n",
"from bzs import users\n... | [
"import base64\n",
"import binascii\n",
"import cgi\n",
"import io\n",
"import json\n",
"import re\n",
"import time\n",
"import tornado\n",
"import urllib\n",
"from bzs import const\n",
"from bzs import db\n",
"from bzs import files\n",
"from bzs import preproc\n",
"from bzs import users\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_19(self):...\n",
""
] | [
"def test_x_terminate_instances(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(self):...\n",
"VAR_2 = self.prepare_args()\n",
"VAR_2.limit = self.add_limit()\n",
"if VAR_2.conditions:\n",
"VAR_2.conditions = 'where ' + VAR_2.conditions\n",
"if self.distinct:\n",
"VAR_2.fields = 'distinct ' + VAR_2.fields\n",
"VAR_7 = (\n \"\"\"select %(fields)s from %(tables)s %(c... | [
"def build_and_run(self):...\n",
"args = self.prepare_args()\n",
"args.limit = self.add_limit()\n",
"if args.conditions:\n",
"args.conditions = 'where ' + args.conditions\n",
"if self.distinct:\n",
"args.fields = 'distinct ' + args.fields\n",
"query = (\n \"\"\"select %(fields)s from %(tables)s %(c... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_29):...\n",
"if VAR_29 is None:\n",
"return VAR_101.user.pref_numsites\n",
"return VAR_54(VAR_55(int(VAR_29), 1), 250)\n"
] | [
"def run(self, limit):...\n",
"if limit is None:\n",
"return c.user.pref_numsites\n",
"return min(max(int(limit), 1), 250)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"if self._hosts_cache is None:\n",
"self._hosts_cache = self._get_hosts()\n",
"return self._hosts_cache\n"
] | [
"def get_hosts(self):...\n",
"if self._hosts_cache is None:\n",
"self._hosts_cache = self._get_hosts()\n",
"return self._hosts_cache\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.parser.parse_args(['--new-player'])\n"
] | [
"def test_arg_new_player(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.parser.parse_args(['--new-player'])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import itertools\n",
"import logging\n",
"import os\n",
"import pkgutil\n",
"import plistlib\n",
"from abc import abstractproperty\n",
"from builtins import object, open, str\n",
"from collections import namedtu... | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import itertools\n",
"import logging\n",
"import os\n",
"import pkgutil\n",
"import plistlib\n",
"from abc import abstractproperty\n",
"from builtins import object, open, str\n",
"from collections import namedtu... | [
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
] | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'"... |
[
"def FUNC_18(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return not self._lock.acquired\n"
] | [
"def is_unlocked(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return not self._lock.acquired\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_0(VAR_3=None, VAR_4=None, VAR_5=True):...\n",
"VAR_14, VAR_15 = vimsupport.CurrentLineAndColumn()\n",
"VAR_16 = vimsupport.GetCurrentBufferFilepath()\n",
"VAR_17 = {'filetypes': vimsupport.CurrentFiletypes(), 'line_num': VAR_14,\n 'column_num': VAR_15, 'start_column': VAR_3, 'line_value': vim.cur... | [
"def BuildRequestData(start_column=None, query=None, include_buffer_data=True):...\n",
"line, column = vimsupport.CurrentLineAndColumn()\n",
"filepath = vimsupport.GetCurrentBufferFilepath()\n",
"request_data = {'filetypes': vimsupport.CurrentFiletypes(), 'line_num':\n line, 'column_num': column, 'start_co... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_6, VAR_7):...\n",
"self.vars[VAR_6] = VAR_7\n"
] | [
"def set_variable(self, key, value):...\n",
"self.vars[key] = value\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_4(self):...\n",
"VAR_2 = CLASS_1.construct_testscript_command('test_interactive_program.py')\n",
"self.assertEqual(p.stdout.readline(), 'test_program X\\n')\n",
"self.assertEqual(p.stdout.readline(), 'Type in a number:\\n')\n",
"p.stdin.write('33\\n')\n",
"p.stdin.flush()\n",
"self.assertEqual... | [
"def test_run_interactive_shell_command(self):...\n",
"command = RunShellCommandTest.construct_testscript_command(\n 'test_interactive_program.py')\n",
"self.assertEqual(p.stdout.readline(), 'test_program X\\n')\n",
"self.assertEqual(p.stdout.readline(), 'Type in a number:\\n')\n",
"p.stdin.write('33\\n'... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_3, VAR_4=None, **VAR_5):...\n",
"self.base_field = VAR_3\n",
"self.size = VAR_4\n",
"if self.size:\n",
"self.default_validators = [*self.default_validators,\n ArrayMaxLengthValidator(self.size)]\n",
"if hasattr(self.base_field, 'from_db_value'):\n",
"self.from_db_value = self.... | [
"def __init__(self, base_field, size=None, **kwargs):...\n",
"self.base_field = base_field\n",
"self.size = size\n",
"if self.size:\n",
"self.default_validators = [*self.default_validators,\n ArrayMaxLengthValidator(self.size)]\n",
"if hasattr(self.base_field, 'from_db_value'):\n",
"self.from_db_valu... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.client.get('/api/apps')\n",
"self.assertEqual(VAR_6.status_code, 200)\n",
"self.assertEqual(len(VAR_6.data['results']), 2)\n"
] | [
"def test_admin_can_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"response = self.client.get('/api/apps')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(len(response.data['results']), 2)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@eqlx.with_timeout...\n",
"return 'no timeout'\n"
] | [
"@eqlx.with_timeout...\n",
"return 'no timeout'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_15():...\n",
""
] | [
"def run():...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_6(self):...\n",
"if not (VAR_101.default_sr or VAR_101.user_is_loggedin and VAR_101.site.\n",
"return False\n",
"return True\n"
] | [
"def run(self):...\n",
"if not (c.default_sr or c.user_is_loggedin and c.site.can_submit(c.user)):\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = frozenset(VAR_2)\n",
"VAR_6 = VAR_2 - VAR_0\n",
"VAR_7 = VAR_1 - VAR_2\n",
"if VAR_6 or VAR_7:\n",
"VAR_22 = ' missing: %s' % sorted(VAR_7) if VAR_7 else ''\n",
"VAR_23 = ' superfluous: %s' % sorted(VAR_6) if VAR_6 els... | [
"def has_unexpected_subset_keys(expected_keys, minimum_keys, actual_keys, name):...\n",
"\"\"\"docstring\"\"\"\n",
"actual_keys = frozenset(actual_keys)\n",
"superfluous = actual_keys - expected_keys\n",
"missing = minimum_keys - actual_keys\n",
"if superfluous or missing:\n",
"msg_missing = ' missing: ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_5, VAR_6, VAR_7, VAR_8):...\n",
"return MailService(VAR_5, VAR_6, VAR_7, self._mail_address, VAR_8)\n"
] | [
"def _create_mail_service(self, mail_sender, mail_store, search_engine,...\n",
"return MailService(mail_sender, mail_store, search_engine, self.\n _mail_address, attachment_store)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"VAR_28 = QueryDict('', mutable=True)\n",
"VAR_28.update(self.filter_data)\n",
"VAR_28.update(self.request.GET)\n",
"self.is_filtered = False\n",
"if len([k for k in VAR_28.keys() if k != 'page']) > 0:\n",
"self.is_filtered = True\n",
"self.filter = ConceptFilter(VAR_28)\n",... | [
"def get_queryset(self):...\n",
"data = QueryDict('', mutable=True)\n",
"data.update(self.filter_data)\n",
"data.update(self.request.GET)\n",
"self.is_filtered = False\n",
"if len([k for k in data.keys() if k != 'page']) > 0:\n",
"self.is_filtered = True\n",
"self.filter = ConceptFilter(data)\n",
"s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"VAR_17 = flask.make_response()\n",
"VAR_18 = self.authomatic.login(WerkzeugAdapter(request, VAR_17), 'google',\n VAR_15=session, session_saver=lambda : app.save_session(session,\n response), secure_cookie=True if request.is_secure else False)\n",
"if VAR_18:\n",
"if VAR_18.... | [
"def log_in(self):...\n",
"response = flask.make_response()\n",
"result = self.authomatic.login(WerkzeugAdapter(request, response), 'google',\n session=session, session_saver=lambda : app.save_session(session,\n response), secure_cookie=True if request.is_secure else False)\n",
"if result:\n",
"if res... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for attr in self._attribute_iterator():\n",
"if not is_terminal_attribute(attr):\n",
"yield attr\n"
] | [
"def get_relationship_attributes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for attr in self._attribute_iterator():\n",
"if not is_terminal_attribute(attr):\n",
"yield attr\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Expr'"
] |
[
"def __init__(self, VAR_5, VAR_4):...\n",
"self.el = VAR_5\n",
"self.txt = VAR_4\n"
] | [
"def __init__(self, el, txt):...\n",
"self.el = el\n",
"self.txt = txt\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"@detail_route(methods=['get'])...\n",
"\"\"\"docstring\"\"\"\n",
"get_and_check_project(VAR_9, VAR_11)\n",
"VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n",
"VAR_23 = max(0, int(VAR_9.query_params.get('line', 0)))\n",
"VAR_24 = VAR_28.console_output or ''\n",
"return Response('\\n'.join(VAR_... | [
"@detail_route(methods=['get'])...\n",
"\"\"\"docstring\"\"\"\n",
"get_and_check_project(request, project_pk)\n",
"task = self.queryset.get(pk=pk, project=project_pk)\n",
"line_num = max(0, int(request.query_params.get('line', 0)))\n",
"output = task.console_output or ''\n",
"return Response('\\n'.join(... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_6=None, VAR_7='', VAR_8='', VAR_9=None, VAR_10=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = self.session.query(self.obj)\n",
"if len(VAR_7.split('.')) >= 2:\n",
"VAR_33 = ''\n",
"VAR_23 = self.session.query(func.count('*')).select_from(self.obj)\n",
"for join_relation in VAR_7... | [
"def query(self, filters=None, order_column='', order_direction='', page=...\n",
"\"\"\"docstring\"\"\"\n",
"query = self.session.query(self.obj)\n",
"if len(order_column.split('.')) >= 2:\n",
"tmp_order_column = ''\n",
"query_count = self.session.query(func.count('*')).select_from(self.obj)\n",
"for jo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import re\n",
"from lib.core.data import conf\n",
"from lib.core.settings import MATCH_RATIO\n",
"def FUNC_0(VAR_0, VAR_1=None, VAR_2=False):...\n",
"VAR_3 = None\n",
"if conf.eString and conf.eString in VAR_0:\n",
"VAR_4 = VAR_0.index(conf.eString)\n",
"if conf.eRegexp:\n",... | [
"\"\"\"\n$Id$\n\nThis file is part of the sqlmap project, http://sqlmap.sourceforge.net.\n\nCopyright (c) 2006-2008 Bernardo Damele A. G. <bernardo.damele@gmail.com>\n and Daniele Bellucci <daniele.bellucci@gmail.com>\n\nsqlmap is free software; you can redistribute it and/or modify it under\... | [
0,
0,
0,
0,
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,
2,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"AugAssign'",
"For",
"Return'",
"Return'",
"Condition",
"Expr'",
"Assign'... |
[
"def FUNC_1(self, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"return eduid_init_app('testing', VAR_2)\n"
] | [
"def load_app(self, config):...\n",
"\"\"\"docstring\"\"\"\n",
"return eduid_init_app('testing', config)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"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_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {}\n",
"VAR_3 = {}\n",
"for VAR_15 in VAR_0:\n",
"VAR_11 = VAR_15.check.name\n",
"def FUNC_3(VAR_4, VAR_5, *VAR_6):...\n",
"VAR_12 = VAR_15.partition.fullname\n",
"VAR_14 = 'could not resolve dependency: %s' % VAR_4\n",
"VAR_13 = VAR_1... | [
"def build_deps(cases):...\n",
"\"\"\"docstring\"\"\"\n",
"cases_by_part = {}\n",
"cases_revmap = {}\n",
"for c in cases:\n",
"cname = c.check.name\n",
"def resolve_dep(target, from_map, *args):...\n",
"pname = c.partition.fullname\n",
"errmsg = 'could not resolve dependency: %s' % target\n",
"ena... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'",
"For",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For... |
[
"def FUNC_42(self):...\n",
"VAR_32 = list()\n",
"for VAR_14 in self.get_columns_list():\n",
"if not self.is_relation(VAR_14):\n",
"return VAR_32\n",
"VAR_38 = self.get_property_first_col(VAR_14).name\n",
"VAR_32.append(VAR_14)\n",
"if not self.is_pk(VAR_38) and not self.is_fk(VAR_38) and not self.is_i... | [
"def get_search_columns_list(self):...\n",
"ret_lst = list()\n",
"for col_name in self.get_columns_list():\n",
"if not self.is_relation(col_name):\n",
"return ret_lst\n",
"tmp_prop = self.get_property_first_col(col_name).name\n",
"ret_lst.append(col_name)\n",
"if not self.is_pk(tmp_prop) and not self.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Condition",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.