lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@app.route('/manage/articles', methods=['GET', 'POST'])...\n", "if current_user.is_authenticated:\n", "VAR_8 = ArticleCreateForm()\n", "return redirect('/index')\n", "if VAR_8.validate_on_submit():\n", "VAR_10 = Article(VAR_9=createform.body.data, url=createform.url.data,\n imageurl=createform.imageur...
[ "@app.route('/manage/articles', methods=['GET', 'POST'])...\n", "if current_user.is_authenticated:\n", "createform = ArticleCreateForm()\n", "return redirect('/index')\n", "if createform.validate_on_submit():\n", "article = Article(body=createform.body.data, url=createform.url.data,\n imageurl=createfo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Expr'", "Return'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_0(VAR_0, VAR_1):...\n", "VAR_1.execute('string'.format(VAR_0=playlist_id))\n", "VAR_8 = VAR_1.fetchall()\n", "return VAR_8\n" ]
[ "def retrieve_videos_from_playlist(playlist_id, db):...\n", "db.execute(\n 'SELECT id, title, thumbnail, position from video WHERE playlist_id={playlist_id} ORDER BY position ASC;'\n .format(playlist_id=playlist_id))\n", "rows = db.fetchall()\n", "return rows\n" ]
[ 0, 4, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'raven_dsn')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'raven_dsn')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_7(VAR_3):...\n", "if os.path.exists(VAR_3):\n", "if os.path.isdir(VAR_3):\n", "os.remove(VAR_3)\n", "os.removedirs(VAR_3)\n" ]
[ "def remove(file):...\n", "if os.path.exists(file):\n", "if os.path.isdir(file):\n", "os.remove(file)\n", "os.removedirs(file)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_2(self):...\n", "return \"\"\"Task: %s (ID %d)\nFile: %s\n\"\"\" % (self.task[1], self.task[0], repr\n (self.filenames)) + GenericRequest.specific_info(self)\n" ]
[ "def specific_info(self):...\n", "return \"\"\"Task: %s (ID %d)\nFile: %s\n\"\"\" % (self.task[1], self.task[0], repr\n (self.filenames)) + GenericRequest.specific_info(self)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_22(self, *VAR_69, **VAR_70):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.input = VAR_69, VAR_70\n", "return VAR_101\n" ]
[ "def input(self, *paths, **kwpaths):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.input = paths, kwpaths\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_32(self):...\n", "VAR_50 = {}\n", "for VAR_11, VAR_18 in self.userqueues.items():\n", "VAR_54 = VAR_18.qsize()\n", "f.write(pickle.dumps(VAR_50, pickle.HIGHEST_PROTOCOL))\n", "VAR_55 = []\n", "self.log.info('Saved users')\n", "for i in range(VAR_54):\n", "VAR_55.append(VAR_18.get(False))\n...
[ "def save_users(self):...\n", "users = {}\n", "for d, uq in self.userqueues.items():\n", "uqsize = uq.qsize()\n", "f.write(pickle.dumps(users, pickle.HIGHEST_PROTOCOL))\n", "uds = []\n", "self.log.info('Saved users')\n", "for i in range(uqsize):\n", "uds.append(uq.get(False))\n", "users[d] = uds\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Expr'", "Assign'", "Expr'", "For", "Expr'", "Assign'" ]
[ "def FUNC_5(VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_45 = VAR_46 = None\n", "def FUNC_32(VAR_47):...\n", "VAR_78 = datetime.datetime\n", "if VAR_47 == 'NOW':\n", "return VAR_78.now()\n", "return VAR_78.strptime(VAR_47, '%Y%m%d %H%M%S')\n" ]
[ "def get_value_by_type(val, v_type):...\n", "\"\"\"docstring\"\"\"\n", "value = error = None\n", "def get_time(time):...\n", "date_time = datetime.datetime\n", "if time == 'NOW':\n", "return date_time.now()\n", "return date_time.strptime(time, '%Y%m%d %H%M%S')\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_4(self, VAR_5):...\n", "VAR_10 = self.guilds[0].roles\n", "return [x for x in VAR_10 if x.name == VAR_5][0]\n" ]
[ "def get_matching_role(self, role_name):...\n", "all_roles = self.guilds[0].roles\n", "return [x for x in all_roles if x.name == role_name][0]\n" ]
[ 0, 0, 2 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@VAR_0.route('/<page_name>/save', methods=['POST'])...\n", "VAR_7 = request.form.get('content')\n", "VAR_3 = VAR_1.query('string' % VAR_2)\n", "VAR_8 = VAR_3.namedresult()\n", "if len(VAR_8) < 1:\n", "VAR_1.insert('page', {'page_name': VAR_2})\n", "VAR_3 = VAR_1.query(\"select id from page where page_n...
[ "@app.route('/<page_name>/save', methods=['POST'])...\n", "content = request.form.get('content')\n", "query = db.query(\n \"select page_content.content, page.id as page_id, page_content.id as content_id from page, page_content where page.id = page_content.page_id and page.page_name = '%s' order by page_conte...
[ 0, 0, 0, 0, 0, 0, 4, 0, 0, 4 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(self, VAR_11, VAR_7):...\n", "pq.ops.R(0) | self.reg[0]\n", "pq.ops.All(pq.ops.Measure) | self.reg\n", "self.eng.flush()\n", "if VAR_11 == 'PauliZ':\n", "VAR_21 = self.eng.backend.get_probabilities([self.reg[VAR_7]])\n", "if VAR_11 == 'AllPauliZ':\n", "if '1' in VAR_21:\n", "VAR_21 = sel...
[ "def expectation(self, observable, wires):...\n", "pq.ops.R(0) | self.reg[0]\n", "pq.ops.All(pq.ops.Measure) | self.reg\n", "self.eng.flush()\n", "if observable == 'PauliZ':\n", "probabilities = self.eng.backend.get_probabilities([self.reg[wires]])\n", "if observable == 'AllPauliZ':\n", "if '1' in pro...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_24(self):...\n", "VAR_4 = 'hubba-bubba'\n", "VAR_3 = '/afterlogin/'\n", "VAR_10 = self.login(VAR_4, VAR_3)\n", "VAR_22 = 'csrf token'\n", "VAR_32['_csrft_'] = VAR_22\n", "VAR_33 = self.app.dispatch_request()\n", "self.assertEqual(VAR_33.status, '200 OK')\n", "self.assertIn(\n 'https://i...
[ "def test_logout_loggedin(self):...\n", "eppn = 'hubba-bubba'\n", "came_from = '/afterlogin/'\n", "cookie = self.login(eppn, came_from)\n", "csrft = 'csrf token'\n", "session['_csrft_'] = csrft\n", "response2 = self.app.dispatch_request()\n", "self.assertEqual(response2.status, '200 OK')\n", "self.a...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_6(self, VAR_33):...\n", "if not VAR_33:\n", "return\n", "VAR_33 = int(VAR_33)\n", "VAR_101.errors.add(errors.BAD_NUMBER)\n", "if self.min is not None and VAR_33 < self.min:\n", "VAR_33 = self.min\n", "if self.max is not None and VAR_33 > self.max:\n", "return VAR_33\n", "VAR_33 = self.ma...
[ "def run(self, val):...\n", "if not val:\n", "return\n", "val = int(val)\n", "c.errors.add(errors.BAD_NUMBER)\n", "if self.min is not None and val < self.min:\n", "val = self.min\n", "if self.max is not None and val > self.max:\n", "return val\n", "val = self.max\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Expr'", "Condition", "Assign'", "Condition", "Return'", "Assign'" ]
[ "def FUNC_3(self):...\n", "VAR_3 = ('SELECT jdk_entries.title, jdk_entries.body ' +\n 'FROM jdk_entries ' + 'WHERE jdk_entries.id = ' + self.entry_id + ';')\n", "self.title, self.body = FUNC_0(VAR_3, True)[0]\n", "return None\n" ]
[ "def populate_entry_data(self):...\n", "sql = ('SELECT jdk_entries.title, jdk_entries.body ' + 'FROM jdk_entries ' +\n 'WHERE jdk_entries.id = ' + self.entry_id + ';')\n", "self.title, self.body = db_execute(sql, True)[0]\n", "return None\n" ]
[ 0, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_13(self, VAR_11, VAR_10, VAR_12=False):...\n", "VAR_33 = []\n", "for result in re.findall(VAR_11, VAR_10, re.S):\n", "for line in result.splitlines():\n", "return VAR_33\n", "if not VAR_12:\n", "VAR_70 = line.split(',')\n", "VAR_33.append(line.split()[0])\n", "VAR_33.extend(p.strip() for p...
[ "def _regex_sos_help(self, regex, sosinfo, is_list=False):...\n", "res = []\n", "for result in re.findall(regex, sosinfo, re.S):\n", "for line in result.splitlines():\n", "return res\n", "if not is_list:\n", "r = line.split(',')\n", "res.append(line.split()[0])\n", "res.extend(p.strip() for p in r i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "For", "Return'", "Condition", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_4(VAR_0):...\n", "VAR_8 = {'disabled': 0, 'is_stock_item': 1}\n", "if VAR_0.get('item_group'):\n", "VAR_8.update({'item_group': VAR_0['item_group']})\n", "if VAR_0.get('item'):\n", "VAR_8.update({'name': VAR_0['item']})\n", "VAR_3 = frappe.get_all('Item', fields=['name', 'item_group', 'item_na...
[ "def get_items(filters):...\n", "filters_dict = {'disabled': 0, 'is_stock_item': 1}\n", "if filters.get('item_group'):\n", "filters_dict.update({'item_group': filters['item_group']})\n", "if filters.get('item'):\n", "filters_dict.update({'name': filters['item']})\n", "items = frappe.get_all('Item', fiel...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_13():...\n", "VAR_6.info('stats', VAR_52='24d92d16-770e-4088-b769-4020e127a7ff', **self.stats\n )\n" ]
[ "def logStats():...\n", "logger.info('stats', uuid='24d92d16-770e-4088-b769-4020e127a7ff', **self.stats)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_2(self):...\n", "" ]
[ "def tearDown(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_28(self, VAR_23):...\n", "return self.mtime > VAR_23\n" ]
[ "def is_newer(self, time):...\n", "return self.mtime > time\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@app.route('/api/server/connect', methods=['PUT'])...\n", "controller.indi_server.connect()\n", "VAR_17 = not timeout(5)(controller.indi_server.is_connected)()\n", "return notify('indi_server', 'indi_server_connect', controller.indi_server.\n to_map(), VAR_17)\n" ]
[ "@app.route('/api/server/connect', methods=['PUT'])...\n", "controller.indi_server.connect()\n", "is_error = not timeout(5)(controller.indi_server.is_connected)()\n", "return notify('indi_server', 'indi_server_connect', controller.indi_server.\n to_map(), is_error)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Return'" ]
[ "from __future__ import unicode_literals\n", "import frappe, unittest\n", "from frappe.model.db_query import DatabaseQuery\n", "from frappe.desk.reportview import get_filters_cond\n", "def FUNC_1(self):...\n", "self.assertTrue({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n limit_page_length...
[ "from __future__ import unicode_literals\n", "import frappe, unittest\n", "from frappe.model.db_query import DatabaseQuery\n", "from frappe.desk.reportview import get_filters_cond\n", "def test_basic(self):...\n", "self.assertTrue({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n limit_page_le...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "Expr'", "For", "Expr'", "For", "Expr'", ...
[ "def FUNC_21(VAR_55):...\n", "@wraps(VAR_55)...\n", "VAR_70['timer'] = CLASS_2(VAR_25)\n", "return VAR_55(*VAR_69, **kwargs)\n" ]
[ "def decorator(func):...\n", "@wraps(func)...\n", "kwargs['timer'] = Timer(name)\n", "return func(*args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_7(self, VAR_2, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_16 = []\n", "if os.path.exists(VAR_2):\n", "for pyfile in sorted(os.listdir(VAR_2)):\n", "return VAR_16\n", "if not pyfile.endswith('.py'):\n", "if '__' in pyfile:\n", "VAR_27, VAR_28 = os.path.splitext(pyfile)\n", "VAR_1 = 's...
[ "def _find_modules_in_path(self, path, modulename):...\n", "\"\"\"docstring\"\"\"\n", "modules = []\n", "if os.path.exists(path):\n", "for pyfile in sorted(os.listdir(path)):\n", "return modules\n", "if not pyfile.endswith('.py'):\n", "if '__' in pyfile:\n", "fname, ext = os.path.splitext(pyfile)\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "For", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(self, VAR_10=None, VAR_11=None, VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_10 is None:\n", "VAR_10 = str(len(self._rules) + 1)\n", "if self.is_rule(VAR_10):\n", "VAR_13 = Rule(VAR_10, self, VAR_11=lineno, VAR_1=snakefile)\n", "self._rules[VAR_13.name] = VAR_13\n", "self.rule_co...
[ "def add_rule(self, name=None, lineno=None, snakefile=None):...\n", "\"\"\"docstring\"\"\"\n", "if name is None:\n", "name = str(len(self._rules) + 1)\n", "if self.is_rule(name):\n", "rule = Rule(name, self, lineno=lineno, snakefile=snakefile)\n", "self._rules[rule.name] = rule\n", "self.rule_count +=...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "AugAssign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_0(self):...\n", "if self.check_xsrf_cookie() == False:\n", "return self.redirect('ftypeerror')\n" ]
[ "def check_xsrf(self):...\n", "if self.check_xsrf_cookie() == False:\n", "return self.redirect('ftypeerror')\n" ]
[ 0, 0, 5 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "from __future__ import unicode_literals\n", "import frappe, json\n", "from frappe.utils import cstr, unique\n", "from frappe import _\n", "from six import string_types\n", "def FUNC_0(VAR_0):...\n", "VAR_12 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n", "def FUNC_6():...\n"...
[ "from __future__ import unicode_literals\n", "import frappe, json\n", "from frappe.utils import cstr, unique\n", "from frappe import _\n", "from six import string_types\n", "def sanitize_searchfield(searchfield):...\n", "blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n '...
[ 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "FunctionDef'", "Expr'", "Condition", "Condition", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "For", "Assign'", "Expr'", "For", "Condition", "Expr'", "Condition", ...
[ "def FUNC_22(self):...\n", "VAR_14 = self.new_mocked_client(client.NSX3Client)\n", "VAR_14.update('ports/1', {'name': 'a-new-name'})\n", "FUNC_2('put', VAR_14, 'https://1.2.3.4/api/v1/ports/1', VAR_8=jsonutils.\n dumps({'name': 'a-new-name'}))\n" ]
[ "def test_update_resource(self):...\n", "api = self.new_mocked_client(client.NSX3Client)\n", "api.update('ports/1', {'name': 'a-new-name'})\n", "assert_json_call('put', api, 'https://1.2.3.4/api/v1/ports/1', data=\n jsonutils.dumps({'name': 'a-new-name'}))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_26(VAR_51, VAR_52):...\n", "for sub_ in VAR_51.sub_items:\n", "FUNC_26(sub_, VAR_52)\n", "VAR_51.owner = VAR_52\n", "if VAR_51.is_dir:\n", "self._update_in_db(VAR_51)\n", "return\n" ]
[ "def _chown_recursive(item_, owner_):...\n", "for sub_ in item_.sub_items:\n", "_chown_recursive(sub_, owner_)\n", "item_.owner = owner_\n", "if item_.is_dir:\n", "self._update_in_db(item_)\n", "return\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Assign'", "Condition", "Expr'", "Return'" ]
[ "@VAR_0.route('/clear')...\n", "" ]
[ "@app.route('/clear')...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_6(VAR_6):...\n", "assert VAR_6 == VAR_3\n", "return VAR_0\n" ]
[ "def _os_walk(path):...\n", "assert path == mock_path\n", "return MOCK_PATHS\n" ]
[ 0, 0, 1 ]
[ "FunctionDef'", "Assert'", "Return'" ]
[ "def FUNC_1(VAR_2: Profile, VAR_3: str, VAR_4: str, VAR_5: str, VAR_6):...\n", "m: Media = Media()\n", "upload_base_path: str = 'uploads/' + str(date.today().year)\n", "VAR_7 = upload_base_path + '/HIGHRES_' + ntpath.basename(VAR_6.name.replace\n (' ', '_'))\n", "VAR_8 = upload_base_path + '/LOWRES_' + n...
[ "def handle_file(u: Profile, headline: str, category: str, text: str, file):...\n", "m: Media = Media()\n", "upload_base_path: str = 'uploads/' + str(date.today().year)\n", "high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.\n name.replace(' ', '_'))\n", "low_res_file_name = uplo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "AnnAssign'", "AnnAssign'", "Assign'", "Assign'", "Condition", "Expr'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "AugAssign'", "AugAssign'", "AugAssign'", "AugAssign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "A...
[ "def FUNC_3(VAR_4):...\n", "VAR_14 = VAR_1.confs\n", "VAR_15 = {'email': VAR_9, 'hash': hashlib.sha1(VAR_9 + VAR_3).hexdigest()}\n", "VAR_14.insert(VAR_15)\n", "send_mail('[FreeMail] Email Confirmation', \n 'Confirm your account by clicking on the following link: ' +\n '<a href=\"localhost:5000/confir...
[ "def sendConf(request):...\n", "confs = db.confs\n", "new_conf = {'email': email, 'hash': hashlib.sha1(email + SALT).hexdigest()}\n", "confs.insert(new_conf)\n", "send_mail('[FreeMail] Email Confirmation', \n 'Confirm your account by clicking on the following link: ' +\n '<a href=\"localhost:5000/conf...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "@staticmethod...\n", "if VAR_5 is None or VAR_8 is None:\n", "return dict()\n", "VAR_11 = CLASS_1.get_fields(VAR_5)\n", "return dict(zip(VAR_11, list(VAR_8)))\n" ]
[ "@staticmethod...\n", "if cursor is None or query_set is None:\n", "return dict()\n", "fields = DBManager.get_fields(cursor)\n", "return dict(zip(fields, list(query_set)))\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_3):...\n", "VAR_25 = {'COMPILATION_ERROR': 0, 'OK': 0, 'TIME_LIMIT_EXCEEDED': 0,\n 'WRONG_ANSWER': 0, 'RUNTIME_ERROR': 0, 'MEMORY_LIMIT_EXCEEDED': 0}\n", "VAR_26 = ['red', 'green', 'tan', 'blue', 'purple', 'orange']\n", "VAR_8 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) +\n...
[ "def create_text_stats(username):...\n", "verdict = {'COMPILATION_ERROR': 0, 'OK': 0, 'TIME_LIMIT_EXCEEDED': 0,\n 'WRONG_ANSWER': 0, 'RUNTIME_ERROR': 0, 'MEMORY_LIMIT_EXCEEDED': 0}\n", "colors = ['red', 'green', 'tan', 'blue', 'purple', 'orange']\n", "conn = sqlite3.connect(os.path.abspath(os.path.dirname(...
[ 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "For", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Condition", "Expr'", "For",...
[ "def FUNC_1(*, VAR_1=(1, 1), VAR_2=(5000, 5000), VAR_3=0):...\n", "VAR_7 = deque([VAR_1])\n", "VAR_8 = {VAR_1: 0}\n", "while VAR_7:\n", "VAR_0 = VAR_7.popleft()\n", "return len(list(filter(lambda c: c <= VAR_3, VAR_8.values())))\n", "for delta in ((-1, 0), (1, 0), (0, -1), (0, 1)):\n", "VAR_9 = tuple(...
[ "def search(*, start=(1, 1), target=(5000, 5000), count=0):...\n", "q = deque([start])\n", "costs = {start: 0}\n", "while q:\n", "location = q.popleft()\n", "return len(list(filter(lambda c: c <= count, costs.values())))\n", "for delta in ((-1, 0), (1, 0), (0, -1), (0, 1)):\n", "neighbor = tuple(map(o...
[ 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "For", "Assign'", "Assign'", "Condition", "Condition", "Return'", "Condition", "Assign'", "Expr'" ]
[ "@tornado.gen.coroutine...\n", "VAR_17 = 'string'\n", "VAR_18 = FUNC_12(VAR_10, 'date'), '%d.%m.%Y', FUNC_12(VAR_10,\n 'temp_average_air'), FUNC_12(VAR_10, 'temp_average_water'), FUNC_12(VAR_10,\n 'expected_temp_air_day'), FUNC_12(VAR_10, 'expected_temp_air_night'\n ), FUNC_12(VAR_10, 'expected_temp_ai...
[ "@tornado.gen.coroutine...\n", "sql = (\n 'INSERT INTO reports VALUES (NULL, STR_TO_DATE(%s, %s), %s, %s, %s, %s, %s, STR_TO_DATE(%s, %s), %s, %s, %s, %s, %s, %s, %s)'\n )\n", "params = get_safe_val(src, 'date'), '%d.%m.%Y', get_safe_val(src,\n 'temp_average_air'), get_safe_val(src, 'temp_average_water...
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "return Navigation.goToOrientation(self, self.transformAngle(VAR_10, 'map',\n 'odom'))\n" ]
[ "def goToOrientation(self, angle):...\n", "\"\"\"docstring\"\"\"\n", "return Navigation.goToOrientation(self, self.transformAngle(angle, 'map',\n 'odom'))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "super().__init__(*VAR_6, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_3(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[['DocType', 'name', 'like', 'J%']]))\n" ]
[ "def test_filters_1(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[['DocType', 'name', 'like', 'J%']]))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_8(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_5 = {'id': 'fake_uuid'}\n", "VAR_1 = {'name': self.volume_name}\n", "VAR_6 = self.configuration.volume_name_template % VAR_5['id']\n", "self.driver._eql_execute('volume', 'select', VAR_6, 'clone', ...
[ "def test_create_cloned_volume(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "src_vref = {'id': 'fake_uuid'}\n", "volume = {'name': self.volume_name}\n", "src_volume_name = self.configuration.volume_name_template % src_vref['id']\n", "self.driver._eql_execute(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_13(self, *VAR_16, **VAR_10):...\n", "if not self.is_group_user(VAR_8):\n", "return VAR_7(self, *VAR_16, **kwargs)\n" ]
[ "def wrapper(self, *args, **kwargs):...\n", "if not self.is_group_user(group):\n", "return method(self, *args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_15(self, VAR_27: int):...\n", "\"\"\"docstring\"\"\"\n", "VAR_35 = License.get_by_id(VAR_27)\n", "self.accepted_licenses.append(VAR_35)\n", "db.session.commit()\n" ]
[ "def accept_license_terms(self, license_id: int):...\n", "\"\"\"docstring\"\"\"\n", "image_license = License.get_by_id(license_id)\n", "self.accepted_licenses.append(image_license)\n", "db.session.commit()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'" ]
[ "from paramiko import AutoAddPolicy, SSHClient\n", "from scp import SCPClient\n", "from serial import Serial\n", "import sys\n", "from termcolor import colored\n", "from time import sleep\n", "from error import DrSEUsError\n", "from sql import sql\n", "VAR_0 = [('drseus_sighandler: SIGSEGV', 'Signal...
[ "from paramiko import AutoAddPolicy, SSHClient\n", "from scp import SCPClient\n", "from serial import Serial\n", "import sys\n", "from termcolor import colored\n", "from time import sleep\n", "from error import DrSEUsError\n", "from sql import sql\n", "error_messages = [('drseus_sighandler: SIGSEGV'...
[ 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'",...
[ "def FUNC_23(self, VAR_2, VAR_3, VAR_8, *VAR_5):...\n", "if isinstance(VAR_8, Circuit):\n", "VAR_12 = {'circuit_id': VAR_8.circuit_id, 'bytes_up': VAR_8.bytes_up,\n 'bytes_down': VAR_8.bytes_down, 'uptime': time.time() - VAR_8.creation_time\n }\n", "self.write_data({'type': 'circuit_removed', 'event': V...
[ "def on_circuit_removed(self, subject, changetype, circuit, *args):...\n", "if isinstance(circuit, Circuit):\n", "event = {'circuit_id': circuit.circuit_id, 'bytes_up': circuit.bytes_up,\n 'bytes_down': circuit.bytes_down, 'uptime': time.time() - circuit.\n creation_time}\n", "self.write_data({'type': '...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_2(self):...\n", "VAR_1 = 'INVALID'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bla',\n VAR_1), '/home/us r/a-file with spaces.bla')\n", "self.assertEqual(escape_path_arg...
[ "def test_escape_path_argument_unsupported(self):...\n", "_type = 'INVALID'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', _type),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bla',\n _type), '/home/us r/a-file with spaces.bla')\n", "s...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __getattr__(self, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_12(*VAR_20):...\n", "return self._rpc(VAR_21, *VAR_20)\n" ]
[ "def __getattr__(self, name):...\n", "\"\"\"docstring\"\"\"\n", "def rpc_call(*args):...\n", "return self._rpc(name, *args)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Return'" ]
[ "def FUNC_25(self, VAR_26, VAR_27):...\n", "VAR_47 = []\n", "for VAR_24 in self.opened_databases:\n", "if VAR_24.database_manager.changes is True:\n", "if VAR_47.__len__() > 0:\n", "VAR_47.append(VAR_24)\n", "VAR_28 = Gtk.Builder()\n", "VAR_28.add_from_resource('/run/terminal/KeepassGtk/quit_dialog.ui...
[ "def on_application_quit(self, window, event):...\n", "unsaved_databases_list = []\n", "for db in self.opened_databases:\n", "if db.database_manager.changes is True:\n", "if unsaved_databases_list.__len__() > 0:\n", "unsaved_databases_list.append(db)\n", "builder = Gtk.Builder()\n", "builder.add_from_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "For", "Assign'", "Expr'", "Assign'", "Return'", "Expr'", "Expr'", "Expr'", "Expr'", "...
[ "def FUNC_6(self):...\n", "self.runall(self.checks, skip_system_check=True)\n", "VAR_15 = self.runner.stats\n", "self.assertEqual(8, VAR_15.num_cases())\n", "self.assertEqual(4, len(VAR_15.failures()))\n", "self.assertEqual(2, self._num_failures_stage('setup'))\n", "self.assertEqual(1, self._num_failure...
[ "def test_runall_skip_system_check(self):...\n", "self.runall(self.checks, skip_system_check=True)\n", "stats = self.runner.stats\n", "self.assertEqual(8, stats.num_cases())\n", "self.assertEqual(4, len(stats.failures()))\n", "self.assertEqual(2, self._num_failures_stage('setup'))\n", "self.assertEqual(...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@integration_synonym_api...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'JM Van Damme inc', VAR_7='1')\n", "FUNC_3(VAR_2, 'SOME RANDOM NAME', VAR_7='2')\n", "FUNC_5(VAR_4, VAR_5, VAR_11=query, VAR_10=[{'name': '----*'}])\n" ]
[ "@integration_synonym_api...\n", "clean_database(solr)\n", "seed_database_with(solr, 'JM Van Damme inc', id='1')\n", "seed_database_with(solr, 'SOME RANDOM NAME', id='2')\n", "verify_results(client, jwt, query=query, expected=[{'name': '----*'}])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_10(self, VAR_30):...\n", "VAR_38 = self.to_dict()\n", "for comp in ['title', 'size', 'tags', 'torrent_date', 'tracker_info']:\n", "if comp not in VAR_30 or str(VAR_38[comp]) == str(VAR_30[comp]):\n", "return False\n", "return True\n" ]
[ "def metadata_conflicting(self, b):...\n", "a = self.to_dict()\n", "for comp in ['title', 'size', 'tags', 'torrent_date', 'tracker_info']:\n", "if comp not in b or str(a[comp]) == str(b[comp]):\n", "return False\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Return'" ]
[ "def FUNC_0(self, VAR_1=True):...\n", "self.is_api = VAR_1\n", "self.assets = Environment(os.path.join(os.path.dirname(__file__),\n '../static'), '/static')\n", "VAR_11 = Bundle('css/bootstrap.min.css', 'css/material.min.css', Bundle(\n 'css/schoolcms.css', 'css/dropdown.css', filters='cssmin'),\n 'o...
[ "def initialize(self, is_api=True):...\n", "self.is_api = is_api\n", "self.assets = Environment(os.path.join(os.path.dirname(__file__),\n '../static'), '/static')\n", "css_all = Bundle('css/bootstrap.min.css', 'css/material.min.css', Bundle(\n 'css/schoolcms.css', 'css/dropdown.css', filters='cssmin'),\...
[ 0, 0, 5, 5, 5, 5, 5 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@staticmethod...\n", "return ungettext_lazy(u'Delete Key Pair', u'Delete Key Pairs', VAR_2)\n" ]
[ "@staticmethod...\n", "return ungettext_lazy(u'Delete Key Pair', u'Delete Key Pairs', count)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_0():...\n", "return st.ScenarioTestRunner.main(CLASS_0, test_case_list=[\n GoogleKatoIntegrationTest])\n" ]
[ "def main():...\n", "return st.ScenarioTestRunner.main(GoogleKatoTestScenario, test_case_list=[\n GoogleKatoIntegrationTest])\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "return gate.new_agent(VAR_1)\n" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "return gate.new_agent(bindings)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "logging.debug('Getting cli arguments')\n", "VAR_0 = argparse.ArgumentParser(description=\n 'A benchmark for genomics routines in Python.')\n", "VAR_1 = VAR_0.add_subparsers(title='commands', dest='command')\n", "VAR_1.required = True\n", "VAR_2 = VAR_...
[ "def get_cli_arguments():...\n", "\"\"\"docstring\"\"\"\n", "logging.debug('Getting cli arguments')\n", "parser = argparse.ArgumentParser(description=\n 'A benchmark for genomics routines in Python.')\n", "subparser = parser.add_subparsers(title='commands', dest='command')\n", "subparser.required = Tru...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_21(VAR_12, VAR_14, VAR_15):...\n", "VAR_31 = getattr(VAR_1, VAR_15, None)\n", "if VAR_31 is not None:\n", "VAR_12 += \"{}='{}' \".format(VAR_14, VAR_31)\n", "return VAR_12\n" ]
[ "def _addCredential(credentials, env_key, data_key):...\n", "value = getattr(data, data_key, None)\n", "if value is not None:\n", "credentials += \"{}='{}' \".format(env_key, value)\n", "return credentials\n" ]
[ 0, 0, 0, 2, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "AugAssign'", "Return'" ]
[ "from flask import render_template, request, redirect, url_for\n", "from flask_login import login_user, login_required, logout_user, current_user\n", "from application import app, db\n", "from application.help import getArticlesWithCondition\n", "from application.articles.models import Article\n", "from a...
[ "from flask import render_template, request, redirect, url_for\n", "from flask_login import login_user, login_required, logout_user, current_user\n", "from application import app, db\n", "from application.help import getArticlesWithCondition\n", "from application.articles.models import Article\n", "from a...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_12(self, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = self.session.query(self.resource_type).get(VAR_9)\n", "if VAR_19 is None:\n", "return self._specific_fields(VAR_19)\n" ]
[ "def detail(self, model_id):...\n", "\"\"\"docstring\"\"\"\n", "model = self.session.query(self.resource_type).get(model_id)\n", "if model is None:\n", "return self._specific_fields(model)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'" ]
[ "def FUNC_9(VAR_0, VAR_5, VAR_8, VAR_9):...\n", "" ]
[ "def find_replace(table_name, attr, find, replace):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = psycopg2.connect(database=DBNAME)\n", "VAR_4 = VAR_3.cursor()\n", "VAR_4.execute(VAR_1)\n", "VAR_5 = VAR_4.fetchall()\n", "VAR_3.close()\n", "return VAR_5\n" ]
[ "def execute_query(cmd):...\n", "\"\"\"docstring\"\"\"\n", "conn = psycopg2.connect(database=DBNAME)\n", "cursor = conn.cursor()\n", "cursor.execute(cmd)\n", "result = cursor.fetchall()\n", "conn.close()\n", "return result\n" ]
[ 0, 0, 0, 0, 4, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_2(VAR_2, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "for VAR_61, value in VAR_3.items():\n", "if isinstance(VAR_2, collections.Mapping):\n", "return VAR_2\n", "if isinstance(value, collections.Mapping):\n", "VAR_2 = {VAR_61: VAR_3[VAR_61]}\n", "VAR_2[VAR_61] = FUNC_2(VAR_2.get(VAR_61, {}), va...
[ "def update_dict(base, head):...\n", "\"\"\"docstring\"\"\"\n", "for key, value in head.items():\n", "if isinstance(base, collections.Mapping):\n", "return base\n", "if isinstance(value, collections.Mapping):\n", "base = {key: head[key]}\n", "base[key] = update_dict(base.get(key, {}), value)\n", "ba...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Condition", "Return'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "@auth.require(auth.is_admin)...\n", "VAR_4 = {'machines': [], 'next_page_token': None}\n", "if VAR_1:\n", "VAR_5 = models.CatalogMachineEntry.get_by_id(VAR_1)\n", "VAR_6 = models.CatalogMachineEntry.query().order(models.CatalogMachineEntry\n .dimensions.hostname)\n", "if not VAR_5:\n", "VAR_7 = self...
[ "@auth.require(auth.is_admin)...\n", "params = {'machines': [], 'next_page_token': None}\n", "if machine_id:\n", "machine = models.CatalogMachineEntry.get_by_id(machine_id)\n", "query = models.CatalogMachineEntry.query().order(models.CatalogMachineEntry\n .dimensions.hostname)\n", "if not machine:\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_6['url'] = VAR_7.url\n", "VAR_6['credentials'] = json.dumps(VAR_7.credentials)\n", "VAR_6['scopes'] = '\\n'.join(VAR_7.scopes)\n", "VAR_6['headers'] = json.dumps(VAR_7.headers)\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "params['url'] = data.url\n", "params['credentials'] = json.dumps(data.credentials)\n", "params['scopes'] = '\\n'.join(data.scopes)\n", "params['headers'] = json.dumps(data.headers)\n" ]
[ 0, 0, 5, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_6(self):...\n", "VAR_14 = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n", "VAR_14.list()\n", "FUNC_1('get', VAR_14, 'https://1.2.3.4/api/v1/ports')\n" ]
[ "def test_client_list(self):...\n", "api = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n", "api.list()\n", "assert_call('get', api, 'https://1.2.3.4/api/v1/ports')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_7(VAR_4):...\n", "VAR_4['from'] = US\n", "sendgrid[send - VAR_9](VAR_4)\n", "return HttpResponse('All Good')\n" ]
[ "def recieveEmailINTHEASS(request):...\n", "request['from'] = US\n", "sendgrid[send - email](request)\n", "return HttpResponse('All Good')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_23 = {}\n", "for VAR_48 in VAR_10.keys():\n", "if VAR_48 not in VAR_9:\n", "if GLSetting.loglevel == 'DEBUG':\n", "log.err('key %s not in %s' % (VAR_48, VAR_9))\n", "VAR_23[VAR_48] = VAR_9[VAR_48]\n", "for double_k in VAR_9.keys():\n", "VAR_9 =...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "valid_jmessage = {}\n", "for key in message_template.keys():\n", "if key not in jmessage:\n", "if GLSetting.loglevel == 'DEBUG':\n", "log.err('key %s not in %s' % (key, jmessage))\n", "valid_jmessage[key] = jmessage[key]\n", "for double_k in jmessage...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "For", "Condition", "Condition", "Expr'", "Assign'", "For", "Assign'", "Condition", "For", "Expr'", "Condition", "For", "Condition", "Return'" ]
[ "import sqlobject\n", "import vdm.sqlobject.base as vdmbase\n", "import vdm.base as vdmbase\n", "VAR_16 = 'name'\n", "from vdm.sqlobject.base import State\n", "from vdm.base import State\n", "VAR_0 = sqlobject.UnicodeCol(alternateID=True)\n", "VAR_1 = sqlobject.MultipleJoin('Package')\n", "VAR_2 = s...
[ "import sqlobject\n", "import vdm.sqlobject.base as vdmbase\n", "import vdm.base as vdmbase\n", "_defaultOrder = 'name'\n", "from vdm.sqlobject.base import State\n", "from vdm.base import State\n", "name = sqlobject.UnicodeCol(alternateID=True)\n", "packages = sqlobject.MultipleJoin('Package')\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, 4, 4, 4 ]
[ "Import'", "Import'", "Import'", "Assign'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Exp...
[ "def FUNC_1(VAR_4, VAR_5, VAR_6, VAR_7, VAR_8=None, VAR_9=None):...\n", "VAR_16 = FUNC_11(collect_config.collect_config(VAR_4, VAR_9), VAR_8)\n", "VAR_31 = FUNC_4(FUNC_9(VAR_5), VAR_16)\n", "if not VAR_7:\n", "for VAR_13, VAR_14 in VAR_31.items():\n", "FUNC_3(os.path.join(VAR_6, FUNC_10('/', VAR_13)), VAR...
[ "def install_config(config_path, template_root, output_path, validate,...\n", "config = strip_hash(collect_config.collect_config(config_path,\n fallback_metadata), subhash)\n", "tree = build_tree(template_paths(template_root), config)\n", "if not validate:\n", "for path, contents in tree.items():\n", "...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "For", "Expr'" ]
[ "def __init__(self, VAR_23, VAR_24, VAR_25, VAR_26, VAR_27=0, *VAR_8, **VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "import numpy as np\n", "self.subdomains_fn = VAR_23\n", "self.rasterio_raster = VAR_24\n", "self.id_field = VAR_25\n", "self.name_field = VAR_26\n", "self.background_value = VAR_27\n", ...
[ "def __init__(self, subdomains_fn, rasterio_raster, id_field, name_field,...\n", "\"\"\"docstring\"\"\"\n", "import numpy as np\n", "self.subdomains_fn = subdomains_fn\n", "self.rasterio_raster = rasterio_raster\n", "self.id_field = id_field\n", "self.name_field = name_field\n", "self.background_value...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_3(self, VAR_6, VAR_7):...\n", "self.model.reset()\n", "self.load_torrents(1, 50)\n" ]
[ "def _on_view_sort(self, column, ascending):...\n", "self.model.reset()\n", "self.load_torrents(1, 50)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_24(self, VAR_39):...\n", "for r in VAR_39:\n", "if not r.name:\n", "r._comment_count = 0\n", "if '_comments' in r:\n", "r._comment_count = len(json.loads(r._comments or '[]'))\n" ]
[ "def add_comment_count(self, result):...\n", "for r in result:\n", "if not r.name:\n", "r._comment_count = 0\n", "if '_comments' in r:\n", "r._comment_count = len(json.loads(r._comments or '[]'))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Assign'", "Condition", "Assign'" ]
[ "def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n", "CLASS_3.__init__(self, VAR_18, errors.BAD_PASSWORD, *VAR_15, **kw)\n" ]
[ "def __init__(self, item, *a, **kw):...\n", "VRequired.__init__(self, item, errors.BAD_PASSWORD, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1(VAR_0, VAR_1):...\n", "VAR_5 = VAR_1.keys()\n", "VAR_6 = VAR_1.values()\n", "VAR_7 = [(VAR_5[i] + '=' + VAR_6[i]) for i in range(len(VAR_5))]\n", "VAR_8 = '&'.join(VAR_7)\n", "VAR_4 = 'curl -d ' + '\"' + VAR_8 + '\" ' + '-X POST ' + start_url + VAR_0\n", "return VAR_4\n" ]
[ "def createPostScript(endpoint, params):...\n", "keys = params.keys()\n", "values = params.values()\n", "pair = [(keys[i] + '=' + values[i]) for i in range(len(keys))]\n", "evil_param = '&'.join(pair)\n", "script = ('curl -d ' + '\"' + evil_param + '\" ' + '-X POST ' + start_url +\n endpoint)\n", "re...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_29():...\n", "self.assertIn('reauthn-for-chpass', VAR_32)\n", "VAR_29 = VAR_32['reauthn-for-chpass']\n", "VAR_30 = int(time.time())\n", "self.assertTrue(VAR_30 - VAR_29 < 5)\n" ]
[ "def _check():...\n", "self.assertIn('reauthn-for-chpass', session)\n", "then = session['reauthn-for-chpass']\n", "now = int(time.time())\n", "self.assertTrue(now - then < 5)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_1:\n", "if not VAR_8:\n", "VAR_8 = CLASS_0.get_report(VAR_1)['signatures']\n", "VAR_9 = collections.OrderedDict()\n", "for signature in VAR_8:\n", "VAR_25 = signature['severity']\n", "return VAR_9\n", "if VAR_25 > 3:\n", "VAR_25 = 3\n"...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if not task_id:\n", "if not signatures:\n", "signatures = AnalysisController.get_report(task_id)['signatures']\n", "data = collections.OrderedDict()\n", "for signature in signatures:\n", "severity = signature['severity']\n", "return data\n", "if se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Condition", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "__revision__ = '$Rev$'\n", "__date__ = '$Date$'\n", "__author__ = '$Author$'\n", "from django.db import connection, models, transaction\n", "def FUNC_0(self, **VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = ['UPDATE', connection.ops.quote_name(self._meta.db_table), 'SET']\...
[ "\"\"\"\nUpdate only selected fields of a model.\n\nThe problem with model.save() is that it also overwrites all other\nfields with possibly stale data.\n\"\"\"\n", "__revision__ = '$Rev$'\n", "__date__ = '$Date$'\n", "__author__ = '$Author$'\n", "from django.db import connection, models, transaction\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 4, 4, 4, 0, 4, 4, 4, 0, 4, 4 ]
[ "Expr'", "Assign'", "Assign'", "Assign'", "ImportFrom'", "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Assi...
[ "def FUNC_14(self, VAR_13):...\n", "\"\"\"docstring\"\"\"\n", "if self.host.containerized:\n", "VAR_13 = VAR_13 % {'image': self.config['image'] or self.host.container_image}\n", "self.host.prefix = VAR_13\n" ]
[ "def _set_sos_prefix(self, prefix):...\n", "\"\"\"docstring\"\"\"\n", "if self.host.containerized:\n", "prefix = prefix % {'image': self.config['image'] or self.host.container_image}\n", "self.host.prefix = prefix\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_7(self, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "self.insecure_mode = ' --insecure'\n", "print('*** Using insecure code paths.')\n" ]
[ "def do_insecure_on(self, line):...\n", "\"\"\"docstring\"\"\"\n", "self.insecure_mode = ' --insecure'\n", "print('*** Using insecure code paths.')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_11(self):...\n", "VAR_3 = 5\n", "for i in range(VAR_3):\n", "VAR_11 = urllib.urlencode({url_helper.swarm_constants.COUNT_KEY: i})\n", "self._mox.ReplayAll()\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), VAR_11, timeout=mox.IgnoreArg()\n ).AndRaise(urllib2.URLError('url'))\n", "self.asser...
[ "def testEnsureCountKeyIncludedInOpen(self):...\n", "attempts = 5\n", "for i in range(attempts):\n", "encoded_data = urllib.urlencode({url_helper.swarm_constants.COUNT_KEY: i})\n", "self._mox.ReplayAll()\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), encoded_data, timeout=mox.\n IgnoreArg()).AndRaise...
[ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_15(VAR_7, VAR_8, VAR_12):...\n", "if hasattr(VAR_12, 'contribute_to_class'):\n", "VAR_12.contribute_to_class(VAR_7, VAR_8)\n", "setattr(VAR_7, VAR_8, VAR_12)\n" ]
[ "def add_to_class(cls, name, value):...\n", "if hasattr(value, 'contribute_to_class'):\n", "value.contribute_to_class(cls, name)\n", "setattr(cls, name, value)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'" ]
[ "async def FUNC_17(self, VAR_30, VAR_31, VAR_32=None, VAR_33=False, VAR_34=...\n", "\"\"\"docstring\"\"\"\n", "VAR_35 = VAR_35 or self.page_size\n", "def FUNC_19():...\n", "VAR_28 = getattr(VAR_1, VAR_30, None)\n", "if not VAR_28:\n", "VAR_64 = self.inspect()[VAR_30]\n", "VAR_55 = self.sql_time_limit_...
[ "async def execute(self, db_name, sql, params=None, truncate=False,...\n", "\"\"\"docstring\"\"\"\n", "page_size = page_size or self.page_size\n", "def sql_operation_in_thread():...\n", "conn = getattr(connections, db_name, None)\n", "if not conn:\n", "info = self.inspect()[db_name]\n", "time_limit_ms...
[ 0, 0, 0, 0, 0, 0, 0, 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", "Docstring", "Assign'", "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Expr'", "Expr'", "Return'", "Return'", "Expr'", "Assign'", "Condi...
[ "def FUNC_11(VAR_1, *VAR_8, **VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "if current_user.is_authenticated():\n", "return redirect('/')\n", "VAR_21 = FUNC_5(VAR_1)\n", "if not VAR_21:\n", "return redirect('/')\n", "if not VAR_16.get(VAR_17(VAR_1.name) + '_autoregister', False):\n", "return redirect(u...
[ "def signup_handler(remote, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "if current_user.is_authenticated():\n", "return redirect('/')\n", "oauth_token = token_getter(remote)\n", "if not oauth_token:\n", "return redirect('/')\n", "if not session.get(token_session_key(remote.name) + '_autoregis...
[ 0, 0, 0, 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", "Condition", "Return'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Expr'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Condition", "Expr'", ...
[ "@VAR_0.simple_tag...\n", "return [FUNC_19(VAR_11) for VAR_11 in VAR_12.split()]\n" ]
[ "@register.simple_tag...\n", "return [get_format_info(format) for format in formats.split()]\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "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'" ]
[ "def FUNC_0(self, **VAR_1):...\n", "VAR_3 = super().get_context_data(**kwargs)\n", "VAR_3['search_form'] = SearchForm()\n", "return VAR_3\n" ]
[ "def get_context_data(self, **kwargs):...\n", "context = super().get_context_data(**kwargs)\n", "context['search_form'] = SearchForm()\n", "return context\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@api.route('/items/<int:item_id>', methods=['GET'])...\n", "VAR_1 = (\n 'SELECT id, name_enus FROM tblDBCItem WHERE id = {} AND auctionable = true;'\n .format(VAR_0))\n", "VAR_2 = mysql.connection.cursor()\n", "VAR_2.execute(VAR_1)\n", "VAR_3 = VAR_2.fetchone()\n", "if VAR_3:\n", "VAR_6 = {}\n", ...
[ "@api.route('/items/<int:item_id>', methods=['GET'])...\n", "sql = (\n 'SELECT id, name_enus FROM tblDBCItem WHERE id = {} AND auctionable = true;'\n .format(item_id))\n", "cursor = mysql.connection.cursor()\n", "cursor.execute(sql)\n", "data = cursor.fetchone()\n", "if data:\n", "item = {}\n", ...
[ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Return'", "For", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_27):...\n", "if VAR_27:\n", "VAR_27 = int(VAR_27, 36)\n", "return Comment._byID(VAR_27, True)\n" ]
[ "def run(self, cid):...\n", "if cid:\n", "cid = int(cid, 36)\n", "return Comment._byID(cid, True)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "@app.route('/achievements')...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = request.args.get('language', 'en')\n", "VAR_6 = request.args.get('region', 'US')\n", "VAR_11 = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "VAR_11.execute(VAR_0 + ' ORDER BY `order` ASC', {'language': VAR_5,\n 'region':...
[ "@app.route('/achievements')...\n", "\"\"\"docstring\"\"\"\n", "language = request.args.get('language', 'en')\n", "region = request.args.get('region', 'US')\n", "cursor = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "cursor.execute(SELECT_ACHIEVEMENTS_QUERY + ' ORDER BY `order` ASC', {\n 'la...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_6(self, VAR_33):...\n", "if self.options and VAR_33 not in self.options:\n", "VAR_101.errors.add(errors.INVALID_OPTION)\n", "return VAR_33\n", "return self.default\n" ]
[ "def run(self, val):...\n", "if self.options and val not in self.options:\n", "c.errors.add(errors.INVALID_OPTION)\n", "return val\n", "return self.default\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'", "Return'" ]
[ "async def FUNC_1(self, VAR_2: str) ->None:...\n", "VAR_7 = await as_future(session.query(database.Paste).filter(database.Paste\n .paste_id == VAR_2).first)\n", "if not VAR_7:\n", "self.set_status(404)\n", "self.write({'paste_id': VAR_7.paste_id, 'raw': VAR_7.raw, 'fmt': VAR_7.fmt,\n 'lexer': VAR_7.le...
[ "async def get(self, paste_id: str) ->None:...\n", "paste = await as_future(session.query(database.Paste).filter(database.Paste\n .paste_id == paste_id).first)\n", "if not paste:\n", "self.set_status(404)\n", "self.write({'paste_id': paste.paste_id, 'raw': paste.raw, 'fmt': paste.fmt,\n 'lexer': paste...
[ 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_11(self, VAR_18, VAR_19=False):...\n", "VAR_15 = {'page_title': 'OAuth2 web client ID', 'web_client_id': VAR_18 or\n '', 'saved': VAR_19}\n", "self.reply('auth/admin/bootstrap_oauth.html', VAR_15)\n" ]
[ "def show_page(self, web_client_id, saved=False):...\n", "env = {'page_title': 'OAuth2 web client ID', 'web_client_id': web_client_id or\n '', 'saved': saved}\n", "self.reply('auth/admin/bootstrap_oauth.html', env)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "if not isinstance(VAR_1, int):\n", "VAR_9 = {}\n", "VAR_10 = VAR_0.view_task(VAR_1, details=True)\n", "if VAR_10:\n", "VAR_19 = VAR_10.to_dict()\n", "return Exception('Task not found')\n", "VAR_19['guest'] = {}\n", "if VAR_10.guest:\n", "VAR_19['guest'] = VAR_10.guest.to_dic...
[ "@staticmethod...\n", "if not isinstance(task_id, int):\n", "data = {}\n", "task = db.view_task(task_id, details=True)\n", "if task:\n", "entry = task.to_dict()\n", "return Exception('Task not found')\n", "entry['guest'] = {}\n", "if task.guest:\n", "entry['guest'] = task.guest.to_dict()\n", "en...
[ 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_20(self, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = VAR_21.rstrip('/')\n", "VAR_60 = os.path.basename(VAR_21)\n", "VAR_61 = os.path.dirname(VAR_21)\n", "VAR_58 = self.getfile(VAR_21, VAR_23=False)\n", "if VAR_58 == False:\n", "if VAR_58[VAR_2] != VAR_12:\n", "if len(self.get_path...
[ "def rmdir(self, path):...\n", "\"\"\"docstring\"\"\"\n", "path = path.rstrip('/')\n", "name = os.path.basename(path)\n", "parent = os.path.dirname(path)\n", "dir = self.getfile(path, follow_symlinks=False)\n", "if dir == False:\n", "if dir[A_TYPE] != T_DIR:\n", "if len(self.get_path(path)) > 0:\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Assign'", "For", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_17(self, VAR_19, VAR_18, VAR_20):...\n", "VAR_13 = set()\n", "for VAR_17 in VAR_20:\n", "VAR_21 = fs.split_path(VAR_17.path)\n", "return VAR_13\n", "VAR_23 = len(VAR_21)\n", "if self._lensplitpath > VAR_23:\n", "VAR_13.add(self._splitpath[VAR_23])\n" ]
[ "def get_parameters(self, key, levelctx, pathctxlist):...\n", "ret = set()\n", "for pathctx in pathctxlist:\n", "testpath = fs.split_path(pathctx.path)\n", "return ret\n", "lenpath = len(testpath)\n", "if self._lensplitpath > lenpath:\n", "ret.add(self._splitpath[lenpath])\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_30(self):...\n", "self.compilation_ko('require [\"toto\",];')\n" ]
[ "def test_misplaced_comma_in_string_list(self):...\n", "self.compilation_ko('require [\"toto\",];')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_16(VAR_12):...\n", "VAR_16 = JarDependency('missing spec', ' //:{}'.format(VAR_12))\n", "VAR_4.register_jvm_tool(VAR_8, VAR_4._key_for_tool_version(VAR_12, 'custom'\n ), VAR_15=[dummy_jardep])\n" ]
[ "def register_custom_tool(key):...\n", "dummy_jardep = JarDependency('missing spec', ' //:{}'.format(key))\n", "cls.register_jvm_tool(register, cls._key_for_tool_version(key, 'custom'),\n classpath=[dummy_jardep])\n" ]
[ 0, 0, 7 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_10(self, VAR_2, *VAR_3, **VAR_4):...\n", "VAR_0.debug(f'{self.__class__.__name__} access check')\n", "if (self.access_granted or self.access_form_valid\n", "return self._redirect_from_passphrase(VAR_2)\n", "if self.access_granted or self.access_form_valid:\n", "return super().dispatch(VAR_2, *VA...
[ "def dispatch(self, request, *args, **kwargs):...\n", "logger.debug(f'{self.__class__.__name__} access check')\n", "if (self.access_granted or self.access_form_valid\n", "return self._redirect_from_passphrase(request)\n", "if self.access_granted or self.access_form_valid:\n", "return super().dispatch(requ...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "For", "Return'", "For", "Return'", "Return'" ]
[ "def FUNC_9(VAR_19):...\n", "VAR_33 = []\n", "for cur_root, _subdirs, files in os.walk(VAR_19):\n", "for f in files:\n", "return VAR_33\n", "VAR_46 = os.path.join(cur_root, f), os.path.join(FUNC_10(VAR_19, cur_root), f)\n", "VAR_33.append(VAR_46)\n" ]
[ "def template_paths(root):...\n", "res = []\n", "for cur_root, _subdirs, files in os.walk(root):\n", "for f in files:\n", "return res\n", "inout = os.path.join(cur_root, f), os.path.join(strip_prefix(root, cur_root), f\n )\n", "res.append(inout)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "For", "Return'", "Assign'", "Expr'" ]
[ "@VAR_0.inclusion_tag('diploma/_diploma_button.html', takes_context=True)...\n", "VAR_3 = _prepare_context(VAR_1, VAR_2)\n", "VAR_4 = CourseDiplomaDesign.objects.filter(course=points.instance).first()\n", "VAR_5 = None\n", "if VAR_4 and VAR_3.user.is_authenticated():\n", "VAR_5 = reverse('diploma-create',...
[ "@register.inclusion_tag('diploma/_diploma_button.html', takes_context=True)...\n", "points = _prepare_context(context, student)\n", "design = CourseDiplomaDesign.objects.filter(course=points.instance).first()\n", "url = None\n", "if design and points.user.is_authenticated():\n", "url = reverse('diploma-c...
[ 0, 0, 0, 0, 4, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_8(self):...\n", "FUNC_1(self.name.upper() + ' SCRIPT')\n", "self.check_verifications_done_before_modifying_system()\n", "self.check_set_usage()\n", "self.check_helper_usage_dependencies()\n", "self.check_deprecated_practices()\n" ]
[ "def analyze(self):...\n", "print_header(self.name.upper() + ' SCRIPT')\n", "self.check_verifications_done_before_modifying_system()\n", "self.check_set_usage()\n", "self.check_helper_usage_dependencies()\n", "self.check_deprecated_practices()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]