lines
sequencelengths
1
444
raw_lines
sequencelengths
1
444
label
sequencelengths
1
444
type
sequencelengths
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__(self, VAR_1):...\n", "super(CLASS_0, self).__init__(VAR_1)\n", "VAR_5 = list(self.shape.objects(VAR_0))\n", "if len(VAR_5) > 1:\n", "self.class_rule = VAR_5[0]\n", "@classmethod...\n", "return [VAR_0]\n" ]
[ "\"\"\"\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 by sh:class is that each value node is a SHACL instance of a given type.\n Definition:\n For each value node that is either a literal, or a non-literal that is not a SHACL instance of $class in the data graph, there is a validation result with the value node as sh:value.\n \"\"\"\n", "def __init__(self, shape):...\n", "super(ClassConstraintComponent, self).__init__(shape)\n", "class_rules = list(self.shape.objects(SH_class))\n", "if len(class_rules) > 1:\n", "self.class_rule = class_rules[0]\n", "@classmethod...\n", "return [SH_class]\n" ]
[ 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.assertEqual(self.cursor.fetchone()[0], 4)\n" ]
[ "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", "self.assertEqual(self.cursor.fetchone()[0], 4)\n" ]
[ 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 the context.')\n" ]
[ "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 exist outside of the context.')\n" ]
[ 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, server_id, description))\n", "self.cur.execute(sql)\n", "self.conn.commit()\n" ]
[ 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 [\"[email protected]\",\n \"[email protected]\"]\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 timeout=timeout)\n" ]
[ 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.apps.testcases.utils import create_routing_test_suite, add_testsuite_to_project, remove_section_from_testsuite, add_section_to_testsuite, add_testcase_to_section\n", "from mdta.apps.testcases.testrail import APIClient\n", "@app.task...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = get_object_or_404(Project, pk=project_id)\n", "VAR_3 = create_routing_test_suite(VAR_2=project)\n", "VAR_4 = TestCaseResults.objects.filter(VAR_2=project)\n", "if VAR_4.count() > 2:\n", "VAR_7 = VAR_2.testcaseresults_set.latest('updated')\n", "TestCaseResults.objects.create(VAR_2=project, results=testcases)\n", "print(str(e))\n", "VAR_5 = 'TestCases updated.'\n", "if VAR_7.results == VAR_3:\n", "if not VAR_1:\n", "VAR_7.updated = datetime.now()\n", "VAR_11 = VAR_2.testcaseresults_set.earliest('updated')\n", "VAR_5 = FUNC_1(VAR_2.id)\n", "return VAR_5\n", "VAR_7.save()\n", "VAR_11.results = VAR_3\n", "VAR_11.updated = datetime.now()\n", "VAR_11.save()\n" ]
[ "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.apps.testcases.utils import create_routing_test_suite, add_testsuite_to_project, remove_section_from_testsuite, add_section_to_testsuite, add_testcase_to_section\n", "from mdta.apps.testcases.testrail import APIClient\n", "@app.task...\n", "\"\"\"docstring\"\"\"\n", "project = get_object_or_404(Project, pk=project_id)\n", "testcases = create_routing_test_suite(project=project)\n", "tc_results = TestCaseResults.objects.filter(project=project)\n", "if tc_results.count() > 2:\n", "tc_latest = project.testcaseresults_set.latest('updated')\n", "TestCaseResults.objects.create(project=project, results=testcases)\n", "print(str(e))\n", "msg = 'TestCases updated.'\n", "if tc_latest.results == testcases:\n", "if not call_from:\n", "tc_latest.updated = datetime.now()\n", "tc_earliest = project.testcaseresults_set.earliest('updated')\n", "msg = push_testcases_to_testrail_celery(project.id)\n", "return msg\n", "tc_latest.save()\n", "tc_earliest.results = testcases\n", "tc_earliest.updated = datetime.now()\n", "tc_earliest.save()\n" ]
[ 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'", "Assign'", "Assign'", "Return'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "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", "VAR_28._r_item_ = VAR_28._r_item_[VAR_17]\n", "VAR_28._r_item_ = VAR_0\n", "if isinstance(VAR_17, slice):\n", "VAR_33 = []\n", "VAR_28._r_item_ = VAR_28._r_item_[VAR_17]\n", "VAR_28._r_item_ = VAR_0\n", "VAR_28._r_is_multi_item_ = False\n", "VAR_28._r_is_multi_item_ = True\n", "if VAR_28._r_item_ is VAR_0 and not self._r_via_alternate_lookup_ and not isinstance(\n", "for i in VAR_28._r_item_:\n", "if not self._r_via_alternate_lookup_:\n", "self._r_via_alternate_lookup_ = True\n", "VAR_28._r_path_.log_getitem(VAR_17, VAR_28)\n", "if VAR_28._r_item_ is VAR_0 and VAR_28._r_raise_:\n", "VAR_36 = None\n", "VAR_28._r_item_ = tuple(VAR_33)\n", "VAR_28._r_path_.log_getitem(VAR_17, VAR_28)\n", "VAR_28 = getattr(self, VAR_17)\n", "self._r_via_alternate_lookup_ = False\n", "return VAR_28\n", "VAR_36 = i[VAR_17]\n", "if isinstance(VAR_36, (tuple, list, range)):\n", "VAR_36 = getattr(i, VAR_17)\n", "VAR_33 += VAR_36\n", "if VAR_36 is not None:\n", "VAR_33.append(VAR_36)\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, slice):\n", "if isinstance(key_or_index_or_slice, int):\n", "copy._r_item_ = copy._r_item_[key_or_index_or_slice]\n", "copy._r_item_ = MISSING\n", "if isinstance(key_or_index_or_slice, slice):\n", "multi_items = []\n", "copy._r_item_ = copy._r_item_[key_or_index_or_slice]\n", "copy._r_item_ = MISSING\n", "copy._r_is_multi_item_ = False\n", "copy._r_is_multi_item_ = True\n", "if copy._r_item_ is MISSING and not self._r_via_alternate_lookup_ and not isinstance(\n", "for i in copy._r_item_:\n", "if not self._r_via_alternate_lookup_:\n", "self._r_via_alternate_lookup_ = True\n", "copy._r_path_.log_getitem(key_or_index_or_slice, copy)\n", "if copy._r_item_ is MISSING and copy._r_raise_:\n", "lookup = None\n", "copy._r_item_ = tuple(multi_items)\n", "copy._r_path_.log_getitem(key_or_index_or_slice, copy)\n", "copy = getattr(self, key_or_index_or_slice)\n", "self._r_via_alternate_lookup_ = False\n", "return copy\n", "lookup = i[key_or_index_or_slice]\n", "if isinstance(lookup, (tuple, list, range)):\n", "lookup = getattr(i, key_or_index_or_slice)\n", "multi_items += lookup\n", "if lookup is not None:\n", "multi_items.append(lookup)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Assign'", "Expr'", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "For", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "AugAssign'", "Condition", "Expr'" ]
[ "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(errors=user.error, _csrf_token=session.get(\n '_csrf_token')), 400)\n", "db.session.commit()\n", "return VAR_15\n", "FUNC_4(VAR_4)\n", "return jsonify(status='200', _csrf_token=session.get('_csrf_token'))\n" ]
[ "@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(jsonify(errors=user.error, _csrf_token=session.get(\n '_csrf_token')), 400)\n", "db.session.commit()\n", "return resp\n", "send_email_to_user(user)\n", "return jsonify(status='200', _csrf_token=session.get('_csrf_token'))\n" ]
[ 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_9]\n", "for item_ in VAR_9:\n", "VAR_9 = [VAR_9]\n", "for item_ in VAR_9:\n", "VAR_49 = False\n", "VAR_53 = VAR_34(item_, VAR_3)\n", "if VAR_10:\n", "VAR_49 = False\n", "if not isinstance(item_, str):\n", "VAR_31.append(VAR_53)\n", "VAR_31.set_name(VAR_10, VAR_48, end=len(newitems) if is_iterable else None)\n", "VAR_53 = VAR_34(item_, VAR_3)\n", "if VAR_35 is not None:\n", "VAR_31.append(VAR_53)\n", "VAR_35[VAR_53] = item_\n", "if VAR_35 is not None:\n", "VAR_35[VAR_53] = item_\n" ]
[ "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", "for item_ in item:\n", "item = [item]\n", "for item_ in item:\n", "is_iterable = False\n", "concrete = concretize(item_, wildcards)\n", "if name:\n", "is_iterable = False\n", "if not isinstance(item_, str):\n", "newitems.append(concrete)\n", "newitems.set_name(name, start, end=len(newitems) if is_iterable else None)\n", "concrete = concretize(item_, wildcards)\n", "if ruleio is not None:\n", "newitems.append(concrete)\n", "ruleio[concrete] = item_\n", "if ruleio is not None:\n", "ruleio[concrete] = 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", "Assign'" ]
[ "@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_product_form/245401/', VAR_6=data)\n", "self.assertRedirects(VAR_2, '/datadocument/245401/')\n", "VAR_2 = self.client.get(VAR_2.url)\n", "VAR_7 = Product.objects.get(upc='stub_9100')\n", "self.assertContains(VAR_2, f'product/%s' % VAR_7.id)\n", "VAR_6 = {'title': ['Product Title'], 'upc': ['stub_9101'], 'document_type':\n [1], 'return_url': ['/datadocument/245401/']}\n", "VAR_2 = self.client.post('/link_product_form/245401/', VAR_6=data)\n", "self.assertRedirects(VAR_2, '/datadocument/245401/')\n", "VAR_2 = self.client.get(VAR_2.url)\n", "VAR_7 = Product.objects.get(upc='stub_9101')\n", "self.assertContains(VAR_2, f'product/%s' % VAR_7.id)\n" ]
[ "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", "response = self.client.post('/link_product_form/245401/', data=data)\n", "self.assertRedirects(response, '/datadocument/245401/')\n", "response = self.client.get(response.url)\n", "new_product = Product.objects.get(upc='stub_9100')\n", "self.assertContains(response, f'product/%s' % new_product.id)\n", "data = {'title': ['Product Title'], 'upc': ['stub_9101'], 'document_type':\n [1], 'return_url': ['/datadocument/245401/']}\n", "response = self.client.post('/link_product_form/245401/', data=data)\n", "self.assertRedirects(response, '/datadocument/245401/')\n", "response = self.client.get(response.url)\n", "new_product = Product.objects.get(upc='stub_9101')\n", "self.assertContains(response, f'product/%s' % new_product.id)\n" ]
[ 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[VAR_15] = 1\n", "if self.name == 'all' and VAR_14.implicit:\n", "if self.name == 'all' and VAR_15.implicit:\n", "VAR_9.append(VAR_14)\n", "VAR_9.append(VAR_15)\n" ]
[ "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", "if self.name == 'all' and mine.implicit:\n", "if self.name == 'all' and kk.implicit:\n", "hosts.append(mine)\n", "hosts.append(kk)\n" ]
[ 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", "if isinstance(VAR_17, commands.CheckFailure):\n", "return\n", "VAR_18 = book.Page(title='Whoops! Something went wrong!', VAR_9=strings.\n capitalise(excuses.get_excuse()), color=16760576 if isinstance(error,\n Warning) else 16711680)\n", "VAR_19 = strings.pascal_to_space(type(VAR_17).__name__)\n", "VAR_15 = strings.pascal_to_space(getattr(VAR_15, 'name', str(VAR_15)))\n", "VAR_19 += f' in {VAR_15}: {str(VAR_17)}'\n", "VAR_18.set_footer(text=error_description)\n", "await VAR_16.send(VAR_18=embed)\n", "traceback.print_exception(type(VAR_17), VAR_17, VAR_17.__traceback__)\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 isinstance(error, commands.CheckFailure):\n", "return\n", "embed = book.Page(title='Whoops! Something went wrong!', description=\n strings.capitalise(excuses.get_excuse()), color=16760576 if isinstance(\n error, Warning) else 16711680)\n", "error_description = strings.pascal_to_space(type(error).__name__)\n", "cog = strings.pascal_to_space(getattr(cog, 'name', str(cog)))\n", "error_description += f' in {cog}: {str(error)}'\n", "embed.set_footer(text=error_description)\n", "await ctx.send(embed=embed)\n", "traceback.print_exception(type(error), error, error.__traceback__)\n" ]
[ 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\n", "from . import user as user\n", "from DefinitelyNotTwitter.user import get_user\n", "from DefinitelyNotTwitter.auth import login_required\n", "VAR_0 = Blueprint('admin', __name__, url_prefix='/admin')\n", "def FUNC_0(VAR_1):...\n", "@functools.wraps(VAR_1)...\n", "if g.user is None:\n", "return redirect(url_for('auth.login'))\n", "if g.user['admin'] != 1:\n", "return redirect(url_for('blog.feedpage', VAR_3=0))\n", "return VAR_1(**kwargs)\n" ]
[ "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\n", "from . import user as user\n", "from DefinitelyNotTwitter.user import get_user\n", "from DefinitelyNotTwitter.auth import login_required\n", "bp = Blueprint('admin', __name__, url_prefix='/admin')\n", "def admin_required(view):...\n", "@functools.wraps(view)...\n", "if g.user is None:\n", "return redirect(url_for('auth.login'))\n", "if g.user['admin'] != 1:\n", "return redirect(url_for('blog.feedpage', page=0))\n", "return view(**kwargs)\n" ]
[ 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", "return redirect(url_for('view_home'))\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_form)\n", "return redirect(url_for('view_home'))\n" ]
[ 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', 'bedrooms': 'bedroom_qty',\n 'bathrooms': 'bathroom_qty', 'price': 'price', 'pet_friendly':\n 'pet_friendly_flag', 'furnished': 'furnished_flag', 'urgent':\n 'urgent_flag', 'url': 'url', 'size': 'size', 'desc': 'description'}\n", "def __init__(self, VAR_2, VAR_3, VAR_4, VAR_5, VAR_6):...\n", "VAR_0.info('Initializing an instance of MySQLConnectionPool')\n", "VAR_0.debug(\n 'Type checking for host address, username, password, database name and pool size'\n )\n", "if type(VAR_2) != str:\n", "if type(VAR_3) != str:\n", "if type(VAR_4) != str:\n", "if type(VAR_5) != str:\n", "VAR_0.debug('All type checks passed')\n", "VAR_0.info('Initializing class variables')\n", "self._hostaddr = VAR_2\n", "self._usr = VAR_3\n", "self._pwd = VAR_4\n", "self._dbname = VAR_5\n", "VAR_0.info('Initializing MySQL connection pool')\n", "self._pool = Queue(VAR_6)\n", "for i in range(VAR_6):\n", "self._pool.put(MySQLdb.connect(VAR_2, VAR_3, VAR_4, VAR_5), block=False)\n", "VAR_0.info('Initialized MySQL connection pool')\n", "def FUNC_0(self):...\n", "VAR_0.debug('Retrieving connection from the pool')\n", "VAR_11 = self._pool.get()\n", "VAR_0.debug('Type checking connection')\n", "if not isinstance(VAR_11, MySQLdb.connections.Connection):\n", "return -1\n", "VAR_0.info('Successful MySQL connection get request')\n", "return VAR_11\n" ]
[ "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': 'address', 'bedrooms': 'bedroom_qty',\n 'bathrooms': 'bathroom_qty', 'price': 'price', 'pet_friendly':\n 'pet_friendly_flag', 'furnished': 'furnished_flag', 'urgent':\n 'urgent_flag', 'url': 'url', 'size': 'size', 'desc': 'description'}\n", "def __init__(self, hostaddr, usr, pwd, dbname, size):...\n", "logger.info('Initializing an instance of MySQLConnectionPool')\n", "logger.debug(\n 'Type checking for host address, username, password, database name and pool size'\n )\n", "if type(hostaddr) != str:\n", "if type(usr) != str:\n", "if type(pwd) != str:\n", "if type(dbname) != str:\n", "logger.debug('All type checks passed')\n", "logger.info('Initializing class variables')\n", "self._hostaddr = hostaddr\n", "self._usr = usr\n", "self._pwd = pwd\n", "self._dbname = dbname\n", "logger.info('Initializing MySQL connection pool')\n", "self._pool = Queue(size)\n", "for i in range(size):\n", "self._pool.put(MySQLdb.connect(hostaddr, usr, pwd, dbname), block=False)\n", "logger.info('Initialized MySQL connection pool')\n", "def get_connection(self):...\n", "logger.debug('Retrieving connection from the pool')\n", "db = self._pool.get()\n", "logger.debug('Type checking connection')\n", "if not isinstance(db, MySQLdb.connections.Connection):\n", "return -1\n", "logger.info('Successful MySQL connection get request')\n", "return db\n" ]
[ 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'", "Expr'", "FunctionDef'", "Expr'", "Assign'", "Expr'", "Condition", "Return'", "Expr'", "Return'" ]
[ "@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 = dict()\n", "for i in VAR_5['network']['dns']:\n", "return {'domainlookups': VAR_20, 'iplookups': VAR_21}\n", "for VAR_29 in i['answers']:\n", "VAR_21[VAR_29['data']] = i['request']\n" ]
[ "@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']['domains'])\n", "iplookups = dict()\n", "for i in report['network']['dns']:\n", "return {'domainlookups': domainlookups, 'iplookups': iplookups}\n", "for a in i['answers']:\n", "iplookups[a['data']] = i['request']\n" ]
[ 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", "return True\n", "if VAR_10[0][0] == 0:\n", "sql.updateDB(self.conn, VAR_14)\n", "return False\n", "return True\n" ]
[ "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(*) from users where name='%s';\" % self.name\n", "sql.updateDB(self.conn, sqlText)\n", "checkName = sql.queryDB(self.conn, sqlName)\n", "return True\n", "if checkName[0][0] == 0:\n", "sql.updateDB(self.conn, sqlText)\n", "return False\n", "return True\n" ]
[ 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, VAR_24)\n", "return VAR_10\n" ]
[ "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_host_error(hostname, out)\n", "return hostname\n" ]
[ 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.PathContainsPredicate('name', name)\n", "VAR_21 = self.agent.type_to_payload('terminateInstances', {'instanceIds':\n VAR_15, 'zone': VAR_16, 'credentials': self.bindings['GCE_CREDENTIALS']})\n", "VAR_41 = jc.PathEqPredicate('status', 'STOPPING')\n", "return st.OperationContract(self.new_post_operation(title=\n 'terminate_instances', data=payload, VAR_29='gce/ops'), contract=\n builder.build())\n", "VAR_22.add_mapped_constraint(jc.IF(VAR_40, VAR_41))\n" ]
[ "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_pred = jc.PathContainsPredicate('name', name)\n", "payload = self.agent.type_to_payload('terminateInstances', {'instanceIds':\n names, 'zone': zone, 'credentials': self.bindings['GCE_CREDENTIALS']})\n", "is_stopping_pred = jc.PathEqPredicate('status', 'STOPPING')\n", "return st.OperationContract(self.new_post_operation(title=\n 'terminate_instances', data=payload, path='gce/ops'), contract=builder.\n build())\n", "clause.add_mapped_constraint(jc.IF(name_matches_pred, is_stopping_pred))\n" ]
[ 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", "VAR_9 = self._requests.pop(i)\n", "if len(VAR_9) != 4:\n", "self.fail('Expected normal request, got json data; %s' % VAR_3)\n", "VAR_10, VAR_11, VAR_12, VAR_4 = VAR_9\n", "if callable(VAR_11):\n", "VAR_11(VAR_6)\n", "self.assertEqual(VAR_11, VAR_6)\n", "if VAR_12 is not None:\n", "return FUNC_0(VAR_12, VAR_3, VAR_4)\n", "return None\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", "data = self._requests.pop(i)\n", "if len(data) != 4:\n", "self.fail('Expected normal request, got json data; %s' % url)\n", "_, expected_kwargs, result, headers = data\n", "if callable(expected_kwargs):\n", "expected_kwargs(kwargs)\n", "self.assertEqual(expected_kwargs, kwargs)\n", "if result is not None:\n", "return make_fake_response(result, url, headers)\n", "return None\n" ]
[ 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') + ':Float:160')\n", "VAR_3.append(_(leave_type) + ' ' + _('Balance') + ':Float:160')\n" ]
[ "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_type) + ' ' + _('Taken') + ':Float:160')\n", "columns.append(_(leave_type) + ' ' + _('Balance') + ':Float:160')\n" ]
[ 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.username)\n" ]
[ 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", "VAR_36.add_mime_type('application/x-keepass2')\n", "VAR_35.add_filter(VAR_36)\n", "VAR_37 = VAR_35.run()\n", "if VAR_37 == Gtk.ResponseType.OK:\n", "self.logging_manager.log_debug('File selected: ' + VAR_35.get_filename())\n", "if VAR_37 == Gtk.ResponseType.CANCEL:\n", "VAR_35.close()\n", "self.logging_manager.log_debug('File selection canceled')\n", "VAR_15 = self.create_tab_title_from_filepath(VAR_35.get_filename())\n", "VAR_35.close()\n", "self.start_database_opening_routine(VAR_15, VAR_35.get_filename())\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.set_name('Keepass 2 Database')\n", "filter_text.add_mime_type('application/x-keepass2')\n", "filechooser_opening_dialog.add_filter(filter_text)\n", "response = filechooser_opening_dialog.run()\n", "if response == Gtk.ResponseType.OK:\n", "self.logging_manager.log_debug('File selected: ' +\n filechooser_opening_dialog.get_filename())\n", "if response == Gtk.ResponseType.CANCEL:\n", "filechooser_opening_dialog.close()\n", "self.logging_manager.log_debug('File selection canceled')\n", "tab_title = self.create_tab_title_from_filepath(filechooser_opening_dialog.\n get_filename())\n", "filechooser_opening_dialog.close()\n", "self.start_database_opening_routine(tab_title, filechooser_opening_dialog.\n get_filename())\n" ]
[ 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", "from cinder.openstack.common import log as logging\n", "from cinder.openstack.common import processutils\n", "from cinder import utils\n", "from cinder.volume.drivers.san import SanISCSIDriver\n", "VAR_0 = logging.getLogger(__name__)\n", "VAR_1 = [cfg.StrOpt('eqlx_group_name', default='group-0', help=\n 'Group name to use for creating volumes'), cfg.IntOpt(\n 'eqlx_cli_timeout', default=30, help=\n 'Timeout for the Group Manager cli command execution'), cfg.IntOpt(\n 'eqlx_cli_max_retries', default=5, help=\n 'Maximum retry count for reconnection'), cfg.BoolOpt('eqlx_use_chap',\n default=False, help='Use CHAP authentication for targets?'), cfg.StrOpt\n ('eqlx_chap_login', default='admin', help='Existing CHAP account name'),\n cfg.StrOpt('eqlx_chap_password', default='password', help=\n 'Password for specified CHAP account name', secret=True), cfg.StrOpt(\n 'eqlx_pool', default='default', help=\n 'Pool in which volumes will be created')]\n", "VAR_2 = cfg.CONF\n", "VAR_2.register_opts(VAR_1)\n", "def FUNC_0(VAR_3):...\n", "@functools.wraps(VAR_3)...\n", "VAR_23 = VAR_5.pop('timeout', None)\n", "VAR_24 = eventlet.spawn(VAR_3, self, *VAR_4, **kwargs)\n", "if VAR_23 is None:\n", "return VAR_24.wait()\n", "VAR_36 = eventlet.spawn_after(VAR_23, VAR_24.kill)\n", "VAR_48 = VAR_24.wait()\n", "VAR_36.cancel()\n", "return FUNC_1\n", "return VAR_48\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", "from cinder.openstack.common import log as logging\n", "from cinder.openstack.common import processutils\n", "from cinder import utils\n", "from cinder.volume.drivers.san import SanISCSIDriver\n", "LOG = logging.getLogger(__name__)\n", "eqlx_opts = [cfg.StrOpt('eqlx_group_name', default='group-0', help=\n 'Group name to use for creating volumes'), cfg.IntOpt(\n 'eqlx_cli_timeout', default=30, help=\n 'Timeout for the Group Manager cli command execution'), cfg.IntOpt(\n 'eqlx_cli_max_retries', default=5, help=\n 'Maximum retry count for reconnection'), cfg.BoolOpt('eqlx_use_chap',\n default=False, help='Use CHAP authentication for targets?'), cfg.StrOpt\n ('eqlx_chap_login', default='admin', help='Existing CHAP account name'),\n cfg.StrOpt('eqlx_chap_password', default='password', help=\n 'Password for specified CHAP account name', secret=True), cfg.StrOpt(\n 'eqlx_pool', default='default', help=\n 'Pool in which volumes will be created')]\n", "CONF = cfg.CONF\n", "CONF.register_opts(eqlx_opts)\n", "def with_timeout(f):...\n", "@functools.wraps(f)...\n", "timeout = kwargs.pop('timeout', None)\n", "gt = eventlet.spawn(f, self, *args, **kwargs)\n", "if timeout is None:\n", "return gt.wait()\n", "kill_thread = eventlet.spawn_after(timeout, gt.kill)\n", "res = gt.wait()\n", "kill_thread.cancel()\n", "return __inner\n", "return res\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'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Return'", "Return'" ]
[ "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)\n", "if VAR_18 or VAR_21:\n", "VAR_28 = CLASS_3(self)\n", "return VAR_34\n", "VAR_34 = self._r_item_(*VAR_18, **kwargs)\n", "VAR_34 = self._r_item_\n", "VAR_28._r_item_ = VAR_34\n", "return VAR_28\n" ]
[ "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, **kwargs)\n", "if args or kwargs:\n", "copy = Roamer(self)\n", "return call_result\n", "call_result = self._r_item_(*args, **kwargs)\n", "call_result = self._r_item_\n", "copy._r_item_ = call_result\n", "return copy\n" ]
[ 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.assertRaises(pyodbc.ProgrammingError, self._exec)\n" ]
[ "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", "self.assertRaises(pyodbc.ProgrammingError, self._exec)\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, PasswordField, CheckBox, CheckEnum\n", "from ..models import Profile, Media\n", "from ..uitools.dataforge import get_csrf_form_element\n", "from .magic import get_current_user\n", "import logging\n", "def FUNC_0(VAR_0: HttpRequest, VAR_1: str):...\n", "VAR_7 = None\n", "VAR_11: Profile = None\n", "if VAR_0.GET.get('user_id'):\n", "VAR_7 = int(VAR_0.GET['user_id'])\n", "if VAR_7 is not None:\n", "VAR_11 = Profile.objects.get(pk=user_id)\n", "VAR_8 = Form()\n", "VAR_8.action_url = VAR_1\n", "if VAR_11:\n", "VAR_8.add_content(PlainText('<h3>Edit user \"' + VAR_11.authuser.username +\n '\"</h3>'))\n", "VAR_8.add_content(PlainText('<h3>Add new user</h3>'))\n", "VAR_8.add_content(PlainText(\n '<a href=\"/admin/media/select?action_url=/admin/actions/change-user-avatar&payload='\n + str(VAR_7) + 'string'))\n", "if not VAR_11:\n", "VAR_8.add_content(PlainText(\"username (can't be edited later on): \"))\n", "if VAR_0.GET.get('fault') and VAR_11:\n", "VAR_8.add_content(TextField(name='username'))\n", "VAR_8.add_content(PlainText('Unable to edit user due to: ' + str(VAR_0.GET[\n 'fault'])))\n", "if VAR_0.GET.get('fault'):\n", "current_user: Profile = get_current_user(VAR_0)\n", "VAR_8.add_content(PlainText('Unable to add user due to: ' + str(VAR_0.GET[\n 'fault'])))\n", "if current_user.rights > 3:\n", "if not VAR_11:\n", "if VAR_11:\n", "VAR_8.add_content(CheckBox(name='active', text='User Active', checked=\n CheckEnum.CHECKED))\n", "VAR_19: CheckEnum = CheckEnum.CHECKED\n", "VAR_8.add_content(PlainText('Email address: '))\n", "VAR_8.add_content(PlainText('Email address: '))\n", "if not VAR_11.active:\n", "VAR_8.add_content(TextField(name='email', button_text=str(profile.authuser.\n email)))\n", "VAR_8.add_content(TextField(name='email'))\n", "VAR_19 = CheckEnum.NOT_CHECKED\n", "VAR_8.add_content(CheckBox(name='active', text='User Active', checked=m))\n", "VAR_8.add_content(PlainText('Display name: '))\n", "VAR_8.add_content(PlainText('Display name: '))\n", "VAR_8.add_content(TextField(name='display_name', button_text=profile.\n displayName))\n", "VAR_8.add_content(TextField(name='display_name'))\n", "VAR_8.add_content(PlainText('DECT: '))\n", "VAR_8.add_content(PlainText('DECT: '))\n", "VAR_8.add_content(NumberField(name='dect', button_text=str(profile.dect),\n minimum=0))\n", "VAR_8.add_content(NumberField(name='dect', minimum=0))\n", "VAR_8.add_content(PlainText('Number of allowed reservations: '))\n", "VAR_8.add_content(PlainText('Number of allowed reservations: '))\n", "VAR_8.add_content(NumberField(name='allowed_reservations', button_text=str(\n profile.number_of_allowed_reservations), minimum=0))\n", "VAR_8.add_content(NumberField(name='allowed_reservations', button_text=str(\n 1), minimum=0))\n", "VAR_8.add_content(PlainText('Rights: '))\n", "VAR_8.add_content(PlainText('Rights: '))\n", "VAR_8.add_content(NumberField(name='rights', button_text=str(profile.rights\n ), minimum=0, maximum=4))\n", "VAR_8.add_content(NumberField(name='rights', button_text=str(0), minimum=0,\n maximum=4))\n", "VAR_8.add_content(PlainText('Notes:<br/>'))\n", "VAR_8.add_content(PlainText('Notes:<br/>'))\n", "VAR_8.add_content(TextArea(name='notes', text=str(profile.notes)))\n", "VAR_8.add_content(TextArea(name='notes', placeholder=\n 'Hier könnte ihre Werbung stehen'))\n", "if VAR_11:\n", "VAR_8.add_content(PlainText(\n '<br /><br />Change password (leave blank in order to not change it):'))\n", "VAR_8.add_content(PlainText('<br />Choose a password: '))\n", "VAR_8.add_content(PasswordField(name='password', required=False))\n", "VAR_8.add_content(PlainText('Confirm your password: '))\n", "VAR_8.add_content(PasswordField(name='confirm_password', required=False))\n", "VAR_8.add_content(PlainText(get_csrf_form_element(VAR_0)))\n", "VAR_8.add_content(SubmitButton())\n", "VAR_9 = (\n '<div class=\"w3-row w3-padding-64 w3-twothird w3-container admin-popup\">')\n", "VAR_9 += VAR_8.render_html(VAR_0)\n", "VAR_9 += '</div>'\n", "return VAR_9\n" ]
[ "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, PasswordField, CheckBox, CheckEnum\n", "from ..models import Profile, Media\n", "from ..uitools.dataforge import get_csrf_form_element\n", "from .magic import get_current_user\n", "import logging\n", "def render_edit_page(http_request: HttpRequest, action_url: str):...\n", "user_id = None\n", "profile: Profile = None\n", "if http_request.GET.get('user_id'):\n", "user_id = int(http_request.GET['user_id'])\n", "if user_id is not None:\n", "profile = Profile.objects.get(pk=user_id)\n", "f = Form()\n", "f.action_url = action_url\n", "if profile:\n", "f.add_content(PlainText('<h3>Edit user \"' + profile.authuser.username +\n '\"</h3>'))\n", "f.add_content(PlainText('<h3>Add new user</h3>'))\n", "f.add_content(PlainText(\n '<a href=\"/admin/media/select?action_url=/admin/actions/change-user-avatar&payload='\n + str(user_id) +\n '\"><img class=\"button-img\" alt=\"Change avatar\" src=\"/staticfiles/frontpage/change-avatar.png\"/></a><br />'\n ))\n", "if not profile:\n", "f.add_content(PlainText(\"username (can't be edited later on): \"))\n", "if http_request.GET.get('fault') and profile:\n", "f.add_content(TextField(name='username'))\n", "f.add_content(PlainText('Unable to edit user due to: ' + str(http_request.\n GET['fault'])))\n", "if http_request.GET.get('fault'):\n", "current_user: Profile = get_current_user(http_request)\n", "f.add_content(PlainText('Unable to add user due to: ' + str(http_request.\n GET['fault'])))\n", "if current_user.rights > 3:\n", "if not profile:\n", "if profile:\n", "f.add_content(CheckBox(name='active', text='User Active', checked=CheckEnum\n .CHECKED))\n", "m: CheckEnum = CheckEnum.CHECKED\n", "f.add_content(PlainText('Email address: '))\n", "f.add_content(PlainText('Email address: '))\n", "if not profile.active:\n", "f.add_content(TextField(name='email', button_text=str(profile.authuser.email)))\n", "f.add_content(TextField(name='email'))\n", "m = CheckEnum.NOT_CHECKED\n", "f.add_content(CheckBox(name='active', text='User Active', checked=m))\n", "f.add_content(PlainText('Display name: '))\n", "f.add_content(PlainText('Display name: '))\n", "f.add_content(TextField(name='display_name', button_text=profile.displayName))\n", "f.add_content(TextField(name='display_name'))\n", "f.add_content(PlainText('DECT: '))\n", "f.add_content(PlainText('DECT: '))\n", "f.add_content(NumberField(name='dect', button_text=str(profile.dect),\n minimum=0))\n", "f.add_content(NumberField(name='dect', minimum=0))\n", "f.add_content(PlainText('Number of allowed reservations: '))\n", "f.add_content(PlainText('Number of allowed reservations: '))\n", "f.add_content(NumberField(name='allowed_reservations', button_text=str(\n profile.number_of_allowed_reservations), minimum=0))\n", "f.add_content(NumberField(name='allowed_reservations', button_text=str(1),\n minimum=0))\n", "f.add_content(PlainText('Rights: '))\n", "f.add_content(PlainText('Rights: '))\n", "f.add_content(NumberField(name='rights', button_text=str(profile.rights),\n minimum=0, maximum=4))\n", "f.add_content(NumberField(name='rights', button_text=str(0), minimum=0,\n maximum=4))\n", "f.add_content(PlainText('Notes:<br/>'))\n", "f.add_content(PlainText('Notes:<br/>'))\n", "f.add_content(TextArea(name='notes', text=str(profile.notes)))\n", "f.add_content(TextArea(name='notes', placeholder=\n 'Hier könnte ihre Werbung stehen'))\n", "if profile:\n", "f.add_content(PlainText(\n '<br /><br />Change password (leave blank in order to not change it):'))\n", "f.add_content(PlainText('<br />Choose a password: '))\n", "f.add_content(PasswordField(name='password', required=False))\n", "f.add_content(PlainText('Confirm your password: '))\n", "f.add_content(PasswordField(name='confirm_password', required=False))\n", "f.add_content(PlainText(get_csrf_form_element(http_request)))\n", "f.add_content(SubmitButton())\n", "a = '<div class=\"w3-row w3-padding-64 w3-twothird w3-container admin-popup\">'\n", "a += f.render_html(http_request)\n", "a += '</div>'\n", "return a\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "AnnAssign'", "Expr'", "Condition", "Condition", "Condition", "Expr'", "AnnAssign'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "AugAssign'", "AugAssign'", "Return'" ]
[ "@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", "for index in range(5):\n", "VAR_52 = '{0}: £{1:,}'.format(VAR_44[index].year, VAR_44[index].value)\n", "VAR_52 = None\n", "VAR_20.append(('{0} breakdown {1}'.format(VAR_7, index + 1), VAR_52))\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(type_breakdowns, key=attrgetter('year'))\n", "for index in range(5):\n", "breakdown = '{0}: £{1:,}'.format(type_breakdowns[index].year,\n type_breakdowns[index].value)\n", "breakdown = None\n", "retval.append(('{0} breakdown {1}'.format(name, index + 1), breakdown))\n" ]
[ 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.commit()\n", "return redirect(url_for('view_comment', VAR_3=pic_name))\n" ]
[ "@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()\n", "return redirect(url_for('view_comment', pic_name=pic_name))\n" ]
[ 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=self.log, version=self.rule.version, VAR_3=self.rule.name))\n", "VAR_22.update(VAR_9)\n", "return format(VAR_8, **_variables)\n" ]
[ "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 resources=self.resources, log=self.log, version=self.rule.version, rule\n =self.rule.name))\n", "_variables.update(variables)\n", "return format(string, **_variables)\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_notfound.html', VAR_6=name)\n", "VAR_2.put()\n", "return render_template('politician.html', VAR_6=name, VAR_2=politician)\n" ]
[ "@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", "return render_template('politician_notfound.html', q=name)\n", "politician.put()\n", "return render_template('politician.html', q=name, politician=politician)\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", "def FUNC_0(VAR_0):...\n", "return binascii.b2a_hex(base64.b64encode(VAR_0.encode('utf-8'))).decode('utf-8'\n )\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", "def encode_str_to_hexed_b64(data):...\n", "return binascii.b2a_hex(base64.b64encode(data.encode('utf-8'))).decode('utf-8')\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 %(conditions)s\n\t\t\t%(group_by)s %(order_by)s %(limit)s\"\"\"\n % VAR_2)\n", "return frappe.db.sql(VAR_7, as_dict=not self.as_list, VAR_17=self.debug,\n VAR_29=self.update)\n" ]
[ "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 %(conditions)s\n\t\t\t%(group_by)s %(order_by)s %(limit)s\"\"\"\n % args)\n", "return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug,\n update=self.update)\n" ]
[ 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 namedtuple\n", "from contextlib import contextmanager\n", "from future.utils import PY3\n", "from six import string_types\n", "from pants.base.revision import Revision\n", "from pants.java.util import execute_java, execute_java_async\n", "from pants.subsystem.subsystem import Subsystem\n", "from pants.util.contextutil import temporary_dir\n", "from pants.util.memo import memoized_method, memoized_property\n", "from pants.util.meta import AbstractClass\n", "from pants.util.osutil import OS_ALIASES, normalize_os_name\n", "from pants.util.process_handler import subprocess\n", "VAR_0 = logging.getLogger(__name__)\n", "def FUNC_0(VAR_1, VAR_2):...\n", "if isinstance(VAR_2, string_types):\n", "VAR_2 = Revision.lenient(VAR_2)\n", "if VAR_2 and not isinstance(VAR_2, Revision):\n", "return VAR_2\n" ]
[ "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 namedtuple\n", "from contextlib import contextmanager\n", "from future.utils import PY3\n", "from six import string_types\n", "from pants.base.revision import Revision\n", "from pants.java.util import execute_java, execute_java_async\n", "from pants.subsystem.subsystem import Subsystem\n", "from pants.util.contextutil import temporary_dir\n", "from pants.util.memo import memoized_method, memoized_property\n", "from pants.util.meta import AbstractClass\n", "from pants.util.osutil import OS_ALIASES, normalize_os_name\n", "from pants.util.process_handler import subprocess\n", "logger = logging.getLogger(__name__)\n", "def _parse_java_version(name, version):...\n", "if isinstance(version, string_types):\n", "version = Revision.lenient(version)\n", "if version and not isinstance(version, Revision):\n", "return version\n" ]
[ 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'", "Assign'", "FunctionDef'", "Condition", "Assign'", "Condition", "Return'" ]
[ "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.current.\n line, 'filepath': VAR_16}\n", "if VAR_5:\n", "VAR_17['file_data'] = vimsupport.GetUnsavedAndCurrentBufferData()\n", "if VAR_4:\n", "VAR_17['query'] = VAR_4\n", "return VAR_17\n" ]
[ "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_column': start_column, 'line_value':\n vim.current.line, 'filepath': filepath}\n", "if include_buffer_data:\n", "request_data['file_data'] = vimsupport.GetUnsavedAndCurrentBufferData()\n", "if query:\n", "request_data['query'] = query\n", "return request_data\n" ]
[ 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(p.stdout.readline(), '33\\n')\n", "self.assertEqual(p.stdout.readline(), 'Exiting program.\\n')\n" ]
[ "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')\n", "p.stdin.flush()\n", "self.assertEqual(p.stdout.readline(), '33\\n')\n", "self.assertEqual(p.stdout.readline(), 'Exiting program.\\n')\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._from_db_value\n", "super().__init__(**kwargs)\n" ]
[ "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_value = self._from_db_value\n", "super().__init__(**kwargs)\n" ]
[ 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 else ''\n", "return 'Unexpected %s%s%s; did you make a typo?' % (VAR_3, VAR_22, VAR_23)\n" ]
[ "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: %s' % sorted(missing) if missing else ''\n", "msg_superfluous = ' superfluous: %s' % sorted(superfluous\n ) if superfluous else ''\n", "return 'Unexpected %s%s%s; did you make a typo?' % (name, msg_missing,\n msg_superfluous)\n" ]
[ 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", "self.queryset = self.filter.qs.select_related('transaction').prefetch_related(\n 'value__currency').order_by('-id')\n", "return self.queryset\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", "self.queryset = self.filter.qs.select_related('transaction').prefetch_related(\n 'value__currency').order_by('-id')\n", "return self.queryset\n" ]
[ 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.error:\n", "return VAR_17\n", "VAR_40 = 'Google auth failed with error: {0}'\n", "if VAR_18.user:\n", "logging.error(VAR_40.format(VAR_18.error.message))\n", "VAR_18.user.update()\n", "return abort(403)\n", "VAR_47 = VAR_18.user\n", "self.set_expiration()\n", "self.set_current_user(VAR_3=user.email, VAR_4=user.first_name, VAR_5=user.\n last_name)\n", "VAR_2 = self.redirect_to_index()\n", "self.set_csrf_token(VAR_2)\n", "return VAR_2\n" ]
[ "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 result.error:\n", "return response\n", "msg = 'Google auth failed with error: {0}'\n", "if result.user:\n", "logging.error(msg.format(result.error.message))\n", "result.user.update()\n", "return abort(403)\n", "user = result.user\n", "self.set_expiration()\n", "self.set_current_user(email=user.email, first_name=user.first_name,\n last_name=user.last_name)\n", "resp = self.redirect_to_index()\n", "self.set_csrf_token(resp)\n", "return resp\n" ]
[ 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_24.split('\\n')[VAR_23:]))\n" ]
[ "@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(output.split('\\n')[line_num:]))\n" ]
[ 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.split('.')[:-1]:\n", "VAR_23 = self._get_base_query(VAR_5=query_count, VAR_6=filters)\n", "VAR_37 = self.get_related_model(join_relation)\n", "VAR_7 = VAR_33 + VAR_7.split('.')[-1]\n", "VAR_5 = self._get_base_query(VAR_5=query, VAR_6=filters, VAR_7=order_column,\n VAR_8=order_direction)\n", "VAR_5 = VAR_5.join(VAR_37)\n", "VAR_24 = VAR_23.scalar()\n", "VAR_33 = VAR_33 + VAR_37.__tablename__ + '.'\n", "if VAR_9:\n", "VAR_5 = VAR_5.offset(VAR_9 * VAR_10)\n", "if VAR_10:\n", "VAR_5 = VAR_5.limit(VAR_10)\n", "return VAR_24, VAR_5.all()\n" ]
[ "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 join_relation in order_column.split('.')[:-1]:\n", "query_count = self._get_base_query(query=query_count, filters=filters)\n", "model_relation = self.get_related_model(join_relation)\n", "order_column = tmp_order_column + order_column.split('.')[-1]\n", "query = self._get_base_query(query=query, filters=filters, order_column=\n order_column, order_direction=order_direction)\n", "query = query.join(model_relation)\n", "count = query_count.scalar()\n", "tmp_order_column = tmp_order_column + model_relation.__tablename__ + '.'\n", "if page:\n", "query = query.offset(page * page_size)\n", "if page_size:\n", "query = query.limit(page_size)\n", "return count, query.all()\n" ]
[ 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", "VAR_5 = len(conf.eString)\n", "VAR_3 = re.findall(conf.eRegexp, VAR_0, re.I | re.M)\n", "if conf.string:\n", "VAR_6 = VAR_0[:VAR_4]\n", "if VAR_3:\n", "if conf.string in VAR_0:\n", "if conf.regexp:\n", "VAR_6 += VAR_0[VAR_4 + VAR_5:]\n", "for regExpResult in VAR_3:\n", "return True\n", "return False\n", "if re.search(conf.regexp, VAR_0, re.I | re.M):\n", "conf.seqMatcher.set_seq2(VAR_0)\n", "VAR_0 = VAR_6\n", "VAR_4 = VAR_0.index(regExpResult)\n", "return True\n", "return False\n", "if VAR_2:\n", "VAR_5 = len(regExpResult)\n", "return round(conf.seqMatcher.ratio(), 5)\n", "if round(conf.seqMatcher.ratio(), 5) >= MATCH_RATIO:\n", "VAR_7 = VAR_0[:VAR_4]\n", "return True\n", "return False\n", "VAR_7 += VAR_0[VAR_4 + VAR_5:]\n", "VAR_0 = VAR_7\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. <[email protected]>\n and Daniele Bellucci <[email protected]>\n\nsqlmap is free software; you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free\nSoftware Foundation version 2 of the License.\n\nsqlmap is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See the GNU General Public License for more\ndetails.\n\nYou should have received a copy of the GNU General Public License along\nwith sqlmap; if not, write to the Free Software Foundation, Inc., 51\nFranklin St, Fifth Floor, Boston, MA 02110-1301 USA\n\"\"\"\n", "import re\n", "from lib.core.data import conf\n", "from lib.core.settings import MATCH_RATIO\n", "def comparison(page, headers=None, getSeqMatcher=False):...\n", "regExpResults = None\n", "if conf.eString and conf.eString in page:\n", "index = page.index(conf.eString)\n", "if conf.eRegexp:\n", "length = len(conf.eString)\n", "regExpResults = re.findall(conf.eRegexp, page, re.I | re.M)\n", "if conf.string:\n", "pageWithoutString = page[:index]\n", "if regExpResults:\n", "if conf.string in page:\n", "if conf.regexp:\n", "pageWithoutString += page[index + length:]\n", "for regExpResult in regExpResults:\n", "return True\n", "return False\n", "if re.search(conf.regexp, page, re.I | re.M):\n", "conf.seqMatcher.set_seq2(page)\n", "page = pageWithoutString\n", "index = page.index(regExpResult)\n", "return True\n", "return False\n", "if getSeqMatcher:\n", "length = len(regExpResult)\n", "return round(conf.seqMatcher.ratio(), 5)\n", "if round(conf.seqMatcher.ratio(), 5) >= MATCH_RATIO:\n", "pageWithoutRegExp = page[:index]\n", "return True\n", "return False\n", "pageWithoutRegExp += page[index + length:]\n", "page = pageWithoutRegExp\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, 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'", "Assign'", "Return'", "Return'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Return'", "Return'", "AugAssign'", "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/xsrf_token', {'data': {},\n 'headers': {'X-XSRF-Token-Request': '1'}}, {'xsrf_token': 'token'}), (\n 'https://localhost:1/swarming/api/v1/bot/poll', {'data': self.\n attributes, 'headers': {'X-XSRF-Token': 'token'}}, {'cmd': 'sleep',\n 'duration': 1.24})])\n", "self.assertFalse(bot_main.poll_server(self.bot, VAR_18))\n", "self.assertEqual([1.24], VAR_17)\n" ]
[ "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/self/xsrf_token', {'data': {},\n 'headers': {'X-XSRF-Token-Request': '1'}}, {'xsrf_token': 'token'}), (\n 'https://localhost:1/swarming/api/v1/bot/poll', {'data': self.\n attributes, 'headers': {'X-XSRF-Token': 'token'}}, {'cmd': 'sleep',\n 'duration': 1.24})])\n", "self.assertFalse(bot_main.poll_server(self.bot, bit))\n", "self.assertEqual([1.24], slept)\n" ]
[ 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_15.environ.name\n", "VAR_20 = VAR_5[VAR_6]\n", "if not VAR_20:\n", "VAR_1 = {}\n", "VAR_2.setdefault((VAR_11, VAR_12), [])\n", "return VAR_20\n", "for VAR_15 in VAR_0:\n", "VAR_3.setdefault((VAR_11, VAR_12, VAR_13), None)\n", "VAR_1[VAR_15] = VAR_15.deps\n", "return VAR_1\n", "VAR_2[VAR_11, VAR_12].append(VAR_15)\n", "VAR_11 = VAR_15.check.name\n", "VAR_3[VAR_11, VAR_12, VAR_13] = VAR_15\n", "VAR_12 = VAR_15.partition.fullname\n", "VAR_13 = VAR_15.environ.name\n", "for dep in VAR_15.check.user_deps():\n", "VAR_21, VAR_22, VAR_23 = dep\n", "if VAR_22 == rfm.DEPEND_FULLY:\n", "VAR_15.deps.extend(FUNC_3(VAR_15, VAR_2, VAR_21, VAR_12))\n", "if VAR_22 == rfm.DEPEND_BY_ENV:\n", "VAR_15.deps.append(FUNC_3(VAR_15, VAR_3, VAR_21, VAR_12, VAR_13))\n", "if VAR_22 == rfm.DEPEND_EXACT:\n", "for env, tenvs in VAR_23.items():\n", "if env != VAR_13:\n", "for te in tenvs:\n", "VAR_15.deps.append(FUNC_3(VAR_15, VAR_3, VAR_21, VAR_12, te))\n" ]
[ "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", "ename = c.environ.name\n", "ret = from_map[args]\n", "if not ret:\n", "graph = {}\n", "cases_by_part.setdefault((cname, pname), [])\n", "return ret\n", "for c in cases:\n", "cases_revmap.setdefault((cname, pname, ename), None)\n", "graph[c] = c.deps\n", "return graph\n", "cases_by_part[cname, pname].append(c)\n", "cname = c.check.name\n", "cases_revmap[cname, pname, ename] = c\n", "pname = c.partition.fullname\n", "ename = c.environ.name\n", "for dep in c.check.user_deps():\n", "tname, how, subdeps = dep\n", "if how == rfm.DEPEND_FULLY:\n", "c.deps.extend(resolve_dep(c, cases_by_part, tname, pname))\n", "if how == rfm.DEPEND_BY_ENV:\n", "c.deps.append(resolve_dep(c, cases_revmap, tname, pname, ename))\n", "if how == rfm.DEPEND_EXACT:\n", "for env, tenvs in subdeps.items():\n", "if env != ename:\n", "for te in tenvs:\n", "c.deps.append(resolve_dep(c, cases_revmap, tname, pname, te))\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "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", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "For", "Condition", "For", "Expr'" ]
[ "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_image(\n", "VAR_32.append(VAR_14)\n" ]
[ "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.is_fk(tmp_prop) and not self.is_image(\n", "ret_lst.append(col_name)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Assign'", "Expr'", "Condition", "Expr'" ]