lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@VAR_15...\n", "log.msg('Error while rendering http %s', system='httprest')\n", "log.err(VAR_16, system='httprest')\n" ]
[ "@deferred...\n", "log.msg('Error while rendering http %s', system='httprest')\n", "log.err(error, system='httprest')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'" ]
[ "def FUNC_6(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = FUNC_0(VAR_2)\n", "VAR_7 = FUNC_1(VAR_2)\n", "VAR_9 = [VAR_2, VAR_6, VAR_7]\n", "VAR_1.execute('INSERT INTO files VALUES (NULL, %s, %s, %s, 0, 0);', VAR_9)\n", "VAR_0.commit()\n", "return\n" ]
[ "def db_insert_new_file(path):...\n", "\"\"\"docstring\"\"\"\n", "file_size = get_file_size(path)\n", "file_age = get_file_age(path)\n", "params = [path, file_size, file_age]\n", "cur.execute('INSERT INTO files VALUES (NULL, %s, %s, %s, 0, 0);', params)\n", "db.commit()\n", "return\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_3(VAR_0):...\n", "VAR_2 = []\n", "VAR_5 = {}\n", "VAR_6 = 's.transaction_date' if VAR_0['based_on'\n ] == 'Sales Order' else 's.posting_date'\n", "VAR_7 = frappe.db.sql('string'.format(VAR_6=date_field, doctype=filters[\n 'based_on']), as_dict=1)\n", "for d in VAR_7:\n", "VAR_5.setdefaul...
[ "def get_sales_details(filters):...\n", "data = []\n", "item_details_map = {}\n", "date_field = 's.transaction_date' if filters['based_on'\n ] == 'Sales Order' else 's.posting_date'\n", "sales_data = frappe.db.sql(\n \"\"\"\n\t\tselect s.territory, s.customer, si.item_group, si.item_name, si.qty, {dat...
[ 0, 0, 0, 0, 4, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Return'" ]
[ "def __init__(self, VAR_3=None):...\n", "\"\"\"docstring\"\"\"\n", "self.ime_property_cache = {}\n", "if VAR_3.find('typing-booster:') > 0:\n", "VAR_3 = VAR_3.replace('typing-booster:', '')\n", "if os.path.exists(VAR_3) and os.path.isfile(VAR_3):\n", "VAR_23 = re.compile('^#')\n", "sys.stderr.write('E...
[ "def __init__(self, configfile_path=None):...\n", "\"\"\"docstring\"\"\"\n", "self.ime_property_cache = {}\n", "if configfile_path.find('typing-booster:') > 0:\n", "configfile_path = configfile_path.replace('typing-booster:', '')\n", "if os.path.exists(configfile_path) and os.path.isfile(configfile_path):...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "For", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_2(VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(VAR_9, str):\n", "return VAR_9\n", "if isinstance(VAR_9, unicode):\n", "return VAR_9.encode('utf-8')\n", "return str(VAR_9)\n" ]
[ "def _ConvertToAscii(value):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(value, str):\n", "return value\n", "if isinstance(value, unicode):\n", "return value.encode('utf-8')\n", "return str(value)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def __call__(self, *VAR_5, **VAR_6):...\n", "return CLASS_6(self.key_name, *VAR_5, **kwargs)\n" ]
[ "def __call__(self, *args, **kwargs):...\n", "return JsonKeyTransform(self.key_name, *args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@integration_synonym_api...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'PNEU', VAR_7='1')\n", "FUNC_5(VAR_4, VAR_5, VAR_11='NEU', VAR_10=[{'name': '----NEU'}, {'name':\n 'PNEU'}])\n" ]
[ "@integration_synonym_api...\n", "clean_database(solr)\n", "seed_database_with(solr, 'PNEU', id='1')\n", "verify_results(client, jwt, query='NEU', expected=[{'name': '----NEU'}, {\n 'name': 'PNEU'}])\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_29(VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "VAR_42 = str(VAR_42)\n", "if len(VAR_42) < 4:\n", "VAR_42 += '__'\n", "VAR_54 = VAR_42[0:3]\n", "VAR_55 = VAR_42[3].replace('_', '')\n", "VAR_56 = VAR_42[4].replace('_', '')\n", "return VAR_54, VAR_55, VAR_56\n" ]
[ "def _parse_marc_code(field):...\n", "\"\"\"docstring\"\"\"\n", "field = str(field)\n", "if len(field) < 4:\n", "field += '__'\n", "tag = field[0:3]\n", "ind1 = field[3].replace('_', '')\n", "ind2 = field[4].replace('_', '')\n", "return tag, ind1, ind2\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(self, VAR_0):...\n", "return VAR_0.id\n" ]
[ "def to_representation(self, obj):...\n", "return obj.id\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0():...\n", "VAR_32 = hashlib.sha1()\n", "VAR_32.update(uuid.uuid4().bytes)\n", "VAR_33 = VAR_32.digest()\n", "assert len(VAR_33) == ray_constants.ID_SIZE\n", "return VAR_33\n" ]
[ "def _random_string():...\n", "id_hash = hashlib.sha1()\n", "id_hash.update(uuid.uuid4().bytes)\n", "id_bytes = id_hash.digest()\n", "assert len(id_bytes) == ray_constants.ID_SIZE\n", "return id_bytes\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assert'", "Return'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "self.subscribe(ray.gcs_utils.XRAY_HEARTBEAT_BATCH_CHANNEL)\n", "self.subscribe(ray.gcs_utils.XRAY_DRIVER_CHANNEL)\n", "while True:\n", "self.update_local_scheduler_map()\n", "if self.autoscaler:\n", "self.autoscaler.update()\n", "self._maybe_flus...
[ "def run(self):...\n", "\"\"\"docstring\"\"\"\n", "self.subscribe(ray.gcs_utils.XRAY_HEARTBEAT_BATCH_CHANNEL)\n", "self.subscribe(ray.gcs_utils.XRAY_DRIVER_CHANNEL)\n", "while True:\n", "self.update_local_scheduler_map()\n", "if self.autoscaler:\n", "self.autoscaler.update()\n", "self._maybe_flush_g...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __iter__(self):...\n", "\"\"\"docstring\"\"\"\n", "return iter(self.parts)\n" ]
[ "def __iter__(self):...\n", "\"\"\"docstring\"\"\"\n", "return iter(self.parts)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_10(self, VAR_11, VAR_3):...\n", "VAR_21 = set()\n", "VAR_18 = VAR_11['rules']\n", "for VAR_37 in VAR_18:\n", "VAR_8 = VAR_3['rules'][VAR_37]\n", "return VAR_21\n", "VAR_21 |= FUNC_3(VAR_8, VAR_3)\n" ]
[ "def get_parameters(self, levelfields, doc):...\n", "parameters = set()\n", "rulenames = levelfields['rules']\n", "for rulename in rulenames:\n", "rule = doc['rules'][rulename]\n", "return parameters\n", "parameters |= get_rule_parameters(rule, doc)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Assign'", "Return'", "AugAssign'" ]
[ "def FUNC_18():...\n", "VAR_56 = constants.AUSTIN_URLS\n", "VAR_57 = constants.SMASHBREWS_RULS\n", "VAR_61 = constants.COLORADO_SINGLES_URLS\n", "VAR_59 = constants.COLORADO_DOUBLES_URLS\n", "VAR_60 = constants.SMS_URLS\n", "VAR_20 = [['sms', VAR_60], ['smashbrews', VAR_57], ['austin', VAR_56], [\n '...
[ "def get_list_of_named_scenes():...\n", "austin = constants.AUSTIN_URLS\n", "smashbrews = constants.SMASHBREWS_RULS\n", "colorado_singles = constants.COLORADO_SINGLES_URLS\n", "colorado_doubles = constants.COLORADO_DOUBLES_URLS\n", "sms = constants.SMS_URLS\n", "base_urls = [['sms', sms], ['smashbrews',...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_6(VAR_3):...\n", "VAR_3.add_route('notes', '/notes', factory=NotesFactory)\n", "VAR_3.add_route('new-note', '/notes/new')\n", "VAR_3.add_route('note', pattern='/notes/{note}', traverse='/{note}',\n factory=NotesFactory)\n", "VAR_3.add_route('note-action', '/api/notes')\n" ]
[ "def includeme(config):...\n", "config.add_route('notes', '/notes', factory=NotesFactory)\n", "config.add_route('new-note', '/notes/new')\n", "config.add_route('note', pattern='/notes/{note}', traverse='/{note}',\n factory=NotesFactory)\n", "config.add_route('note-action', '/api/notes')\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_16(self):...\n", "return reverse('data_group_edit', VAR_4={'pk': self.pk})\n" ]
[ "def get_absolute_url(self):...\n", "return reverse('data_group_edit', kwargs={'pk': self.pk})\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = bs4.BeautifulSoup(VAR_0, 'html.parser')\n", "VAR_4 = VAR_3.select('[name={}]'.format(VAR_1))\n", "if not VAR_4:\n", "print(\"Token '{}' not found in html text.\".format(VAR_1))\n", "return VAR_4[0]['value']\n", "return ''\n" ]
[ "def get_token(html, token_name):...\n", "\"\"\"docstring\"\"\"\n", "soup = bs4.BeautifulSoup(html, 'html.parser')\n", "res = soup.select('[name={}]'.format(token_name))\n", "if not res:\n", "print(\"Token '{}' not found in html text.\".format(token_name))\n", "return res[0]['value']\n", "return ''\n"...
[ 0, 0, 0, 5, 0, 5, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "Return'", "Return'" ]
[ "def FUNC_5(self):...\n", "VAR_0 = {}\n", "assert complex_column_expr(tuplify(['count', []]), VAR_0.copy()) == 'count()'\n", "assert complex_column_expr(tuplify(['notEmpty', ['foo']]), VAR_0.copy()\n ) == 'notEmpty(foo)'\n", "assert complex_column_expr(tuplify(['notEmpty', ['arrayElement', ['foo', 1]\n ...
[ "def test_complex_conditions_expr(self):...\n", "body = {}\n", "assert complex_column_expr(tuplify(['count', []]), body.copy()) == 'count()'\n", "assert complex_column_expr(tuplify(['notEmpty', ['foo']]), body.copy()\n ) == 'notEmpty(foo)'\n", "assert complex_column_expr(tuplify(['notEmpty', ['arrayEleme...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'" ]
[ "def FUNC_14(self):...\n", "VAR_4 = 'hubba-fooo'\n", "VAR_13 = self.app.config['TOKEN_LOGIN_SHARED_KEY']\n", "VAR_14 = '{:x}'.format(int(time.time()))\n", "VAR_15 = os.urandom(16).encode('hex')\n", "VAR_16 = sha256('{0}|{1}|{2}|{3}'.format(VAR_13, VAR_4, VAR_15, VAR_14)\n ).hexdigest()\n", "VAR_17 = ...
[ "def test_token_login_new_user(self):...\n", "eppn = 'hubba-fooo'\n", "shared_key = self.app.config['TOKEN_LOGIN_SHARED_KEY']\n", "timestamp = '{:x}'.format(int(time.time()))\n", "nonce = os.urandom(16).encode('hex')\n", "token = sha256('{0}|{1}|{2}|{3}'.format(shared_key, eppn, nonce, timestamp)\n ).h...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_18(self):...\n", "VAR_23 = 'my!pwd0#', 'some0therlong$pwd', 'pwd'\n", "VAR_24 = {'name_pwd': 'name1', 'password': VAR_23[0], 'some_list': {\n 'name_password': 'name2', 'password': VAR_23[1]}, 'password': VAR_23[2]}\n", "VAR_25 = client.RESTClient(None)\n", "VAR_26 = jsonutils.dumps(VAR_24)\n", ...
[ "def test_mask_password(self):...\n", "pwds = 'my!pwd0#', 'some0therlong$pwd', 'pwd'\n", "body = {'name_pwd': 'name1', 'password': pwds[0], 'some_list': {\n 'name_password': 'name2', 'password': pwds[1]}, 'password': pwds[2]}\n", "cl = client.RESTClient(None)\n", "json_body = jsonutils.dumps(body)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Expr'" ]
[ "def FUNC_14(self, VAR_14):...\n", "" ]
[ "def is_boolean(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "async def FUNC_1(self, VAR_1: str='') ->None:...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = utility.list_languages()\n", "if not VAR_1:\n", "VAR_1 = 'text'\n", "if VAR_1 not in VAR_4:\n", "VAR_0.debug('CreatePaste.get: non-existent logger requested')\n", "await self.render('new.html', VAR_1=lexer, VAR_4...
[ "async def get(self, lexer: str='') ->None:...\n", "\"\"\"docstring\"\"\"\n", "lexers = utility.list_languages()\n", "if not lexer:\n", "lexer = 'text'\n", "if lexer not in lexers:\n", "log.debug('CreatePaste.get: non-existent logger requested')\n", "await self.render('new.html', lexer=lexer, lexers=l...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "@app.route('/api/sequences/<id>/start', methods=['POST'])...\n", "controller.sequences_runner.run(VAR_4)\n", "return controller.sequences.lookup(VAR_4).to_map()\n" ]
[ "@app.route('/api/sequences/<id>/start', methods=['POST'])...\n", "controller.sequences_runner.run(id)\n", "return controller.sequences.lookup(id).to_map()\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Return'" ]
[ "def FUNC_22(VAR_10, VAR_3, VAR_12=False):...\n", "if not VAR_12:\n", "VAR_12 = CFG('default_token_count')\n", "VAR_29 = [FUNC_21() for x in range(0, VAR_12)]\n", "for VAR_4 in VAR_29:\n", "VAR_32 = VAR_3\n", "return VAR_29\n", "VAR_35 = 'NONE'\n", "VAR_28 = VAR_4, VAR_32, VAR_35\n", "VAR_18 = 'IN...
[ "def genTokens(c, poll_name, count=False):...\n", "if not count:\n", "count = CFG('default_token_count')\n", "tokens = [genSingleToken() for x in range(0, count)]\n", "for token in tokens:\n", "name = poll_name\n", "return tokens\n", "options_selected = 'NONE'\n", "params = token, name, options_sele...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "\"\"\"\nModule contains classes for returning errata data from DB\n\"\"\"\n", "\"\"\"\n Class to hold Erratum attributes\n \"\"\"\n", "def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5, VAR_6, VAR_7):...\n", "setattr(self, 'name', VAR_1)\n", "setattr(self, 'id', VAR_0)\n", "VAR_17 = {}\n"...
[ "\"\"\"\nModule contains classes for returning errata data from DB\n\"\"\"\n", "\"\"\"\n Class to hold Erratum attributes\n \"\"\"\n", "def __init__(self, id, name, synopsis, severity, description, solution,...\n", "setattr(self, 'name', name)\n", "setattr(self, 'id', id)\n", "mydict = {}\n", "myd...
[ 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "FunctionDef'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", ...
[ "def FUNC_0(self):...\n", "return self.get_secure_cookie('user')\n" ]
[ "def get_current_user(self):...\n", "return self.get_secure_cookie('user')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_25(self):...\n", "return self._picture\n" ]
[ "def picture(self):...\n", "return self._picture\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(self, VAR_8):...\n", "VAR_14 = (\n \"UPDATE `testdb`.`report` SET `Is_Resolved` = '1' WHERE `report`.`Report_ID` = \"\n + VAR_8)\n", "self.cursor.execute(VAR_14)\n", "self.connection.commit()\n" ]
[ "def resolve_issue(self, reportID):...\n", "query = (\n \"UPDATE `testdb`.`report` SET `Is_Resolved` = '1' WHERE `report`.`Report_ID` = \"\n + reportID)\n", "self.cursor.execute(query)\n", "self.connection.commit()\n" ]
[ 0, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_3(self, VAR_15, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "VAR_20 = gcp.GceContractBuilder(self.gce_observer)\n", "VAR_22 = VAR_20.new_clause_builder('Instances Deleted', retryable_for_secs=\n 15, strict=True).list_resources('instances')\n", "for name in VAR_15:\n", "VAR_40 = jc.PathContains...
[ "def terminate_instances(self, names, zone):...\n", "\"\"\"docstring\"\"\"\n", "builder = gcp.GceContractBuilder(self.gce_observer)\n", "clause = builder.new_clause_builder('Instances Deleted', retryable_for_secs\n =15, strict=True).list_resources('instances')\n", "for name in names:\n", "name_matches_...
[ 0, 0, 0, 0, 0, 1, 0, 1, 0, 1 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Return'", "Expr'" ]
[ "def __init__(self, VAR_0, VAR_1, VAR_2):...\n", "super(CLASS_3, self).__init__(VAR_0, VAR_1, VAR_2, 'POST')\n" ]
[ "def __init__(self, connection, args, logger):...\n", "super(HttpPost, self).__init__(connection, args, logger, 'POST')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_8():...\n", "VAR_38 = FUNC_3(VAR_18, VAR_19)\n", "VAR_37 = CLASS_19 if VAR_20 else CLASS_20\n", "return VAR_37, VAR_38\n" ]
[ "def five():...\n", "HHFormSet = make_formset(parent, child)\n", "ParentForm = ExtractedHHDocForm if extracted else ExtractedHHDocEditForm\n", "return ParentForm, HHFormSet\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_45(self):...\n", "return [i.name for i in self.obj.__mapper__.columns if isinstance(i.type,\n ImageColumn)]\n" ]
[ "def get_image_column_list(self):...\n", "return [i.name for i in self.obj.__mapper__.columns if isinstance(i.type,\n ImageColumn)]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_4(VAR_5, VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5.execute(\n f\"\"\"string{VAR_7['title']}\",\n \"{VAR_7.get('description', '')}\"\n )\n \"\"\"\n )\n", "VAR_11 = VAR_5.lastrowid\n", "for tag in VAR_7.get('tags', []):\n", "VAR_5.execute(\n f\"\"\"string{tag.g...
[ "def create_issue(cursor, issue):...\n", "\"\"\"docstring\"\"\"\n", "cursor.execute(\n f\"\"\"\n INSERT INTO issue (\n title,\n description\n )\n VALUES (\n \"{issue['title']}\",\n \"{issue.get('description', '')}\"\n )\n \"\"\"\n ...
[ 0, 0, 4, 0, 0, 4, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_0(self):...\n", "VAR_1 = 'sh'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/usr/a-dir/', VAR_1),\n '/home/usr/a-dir/')\n", "self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bl...
[ "def test_escape_path_argument_sh(self):...\n", "_type = 'sh'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', _type),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/usr/a-dir/', _type),\n '/home/usr/a-dir/')\n", "self.assertEqual(escape_path_argument('/home/us r...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_10(VAR_7, VAR_10, VAR_11):...\n", "if VAR_7 not in VAR_10.keys():\n", "if VAR_11:\n", "print(VAR_10[VAR_7])\n", "print('The syscall number for {0} is: {1} (0x{1:X})'.format(VAR_7, VAR_10[\n VAR_7]))\n" ]
[ "def print_single_syscall(syscall_name, syscalls, quiet):...\n", "if syscall_name not in syscalls.keys():\n", "if quiet:\n", "print(syscalls[syscall_name])\n", "print('The syscall number for {0} is: {1} (0x{1:X})'.format(syscall_name,\n syscalls[syscall_name]))\n" ]
[ 0, 2, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_7(self):...\n", "VAR_1 = '/api/apps'\n", "VAR_2 = self.client.post(VAR_1)\n", "self.assertEqual(VAR_2.status_code, 201)\n", "VAR_3 = VAR_2.data['id']\n", "VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n", "VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d...
[ "def test_run_chaos(self):...\n", "url = '/api/apps'\n", "response = self.client.post(url)\n", "self.assertEqual(response.status_code, 201)\n", "app_id = response.data['id']\n", "url = '/api/apps/{app_id}/builds'.format(**locals())\n", "body = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': j...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "E...
[ "def FUNC_6(self, VAR_13):...\n", "if VAR_13:\n", "VAR_13 = VAR_100(VAR_13.split('[')[1].strip(']'))\n", "return 'en'\n", "if VAR_13 in g.all_languages:\n", "return VAR_13\n" ]
[ "def run(self, lang):...\n", "if lang:\n", "lang = str(lang.split('[')[1].strip(']'))\n", "return 'en'\n", "if lang in g.all_languages:\n", "return lang\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Condition", "Return'" ]
[ "import unittest\n", "import odin\n", "from odin import traversal\n", "VAR_7 = 'odin.traversal'\n", "VAR_2 = odin.StringField()\n", "VAR_7 = 'odin.traversal'\n", "VAR_2 = odin.StringField()\n", "VAR_3 = odin.ListOf(CLASS_0)\n", "VAR_7 = 'odin.traversal'\n", "VAR_2 = odin.StringField()\n", "VAR_4...
[ "import unittest\n", "import odin\n", "from odin import traversal\n", "namespace = 'odin.traversal'\n", "name = odin.StringField()\n", "namespace = 'odin.traversal'\n", "name = odin.StringField()\n", "level3s = odin.ListOf(Level3)\n", "namespace = 'odin.traversal'\n", "name = odin.StringField()\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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Expr'", "Assign'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "...
[ "def FUNC_1():...\n", "print(\"Starting script... press 'ctrl+c' in terminal to turn off\")\n", "while True:\n", "if pyperclip.paste() != VAR_1 and len(pyperclip.paste().split()) < 5:\n", "VAR_1 = pyperclip.paste()\n", "VAR_4 = False\n", "VAR_5 = requests.get('https://api-portal.dictionary.com/dcom/page...
[ "def main():...\n", "print(\"Starting script... press 'ctrl+c' in terminal to turn off\")\n", "while True:\n", "if pyperclip.paste() != word and len(pyperclip.paste().split()) < 5:\n", "word = pyperclip.paste()\n", "wordChc = False\n", "req = requests.get('https://api-portal.dictionary.com/dcom/pageData...
[ 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'"...
[ "def FUNC_5(VAR_7):...\n", "VAR_11 = f\"\"\"string{VAR_0} AS p INNER JOIN {VAR_1} AS pt ON\n p.product_type_id=pt.id WHERE p.id={VAR_7}\n \"\"\"\n", "VAR_12 = create_connection()\n", "VAR_12.close()\n", "VAR_13 = VAR_12.cursor()\n", "VAR_13.execute(VAR_11)\n", "return VAR_13.fetcho...
[ "def get_product(productId):...\n", "sql_query = f\"\"\"\n SELECT p.ean, p.name, p.description, pt.name AS type, p.company, p.price, p.rating, p.weight, p.quantity, p.image_url\n FROM {PRODUCTS_TABLE} AS p INNER JOIN {PRODUCTS_TYPES_TABLE} AS pt ON\n p.product_type_id=pt.id WHERE ...
[ 0, 4, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "@contextlib.contextmanager...\n", "VAR_3 = get_current_http_request()\n", "VAR_4 = get_current_http_response()\n", "if not hasattr(VAR_3, '_xsrf_token'):\n", "VAR_5 = get_cookie(name='_xsrf', VAR_3=request)\n", "if 'GET' != VAR_3.method.upper():\n", "VAR_3.is_new_xsrf_token = False\n", "VAR_5 = get_h...
[ "@contextlib.contextmanager...\n", "request = get_current_http_request()\n", "response = get_current_http_response()\n", "if not hasattr(request, '_xsrf_token'):\n", "token = get_cookie(name='_xsrf', request=request)\n", "if 'GET' != request.method.upper():\n", "request.is_new_xsrf_token = False\n", "...
[ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_18(self):...\n", "VAR_35 = []\n", "for VAR_22, VAR_27, VAR_24 in self._handlers:\n", "if not VAR_24:\n", "if VAR_35:\n", "VAR_35.append(VAR_27 or repr(VAR_22))\n" ]
[ "def _check_handlers(self):...\n", "unhandled = []\n", "for handle_msg, name, required in self._handlers:\n", "if not required:\n", "if unhandled:\n", "unhandled.append(name or repr(handle_msg))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Condition", "Expr'" ]
[ "import calendar\n", "from datetime import date as libdate\n", "import tornado\n", "import tornado.gen\n", "VAR_0 = ['T1', 'T2', 'gas_pressure', 'boilers_all', 'boilers_in_use',\n 'torchs_in_use', 'boilers_reserve', 'boilers_in_repair',\n 'net_pumps_in_work', 'net_pumps_reserve', 'net_pumps_in_repair'...
[ "import calendar\n", "from datetime import date as libdate\n", "import tornado\n", "import tornado.gen\n", "boiler_room_report_cols = ['T1', 'T2', 'gas_pressure', 'boilers_all',\n 'boilers_in_use', 'torchs_in_use', 'boilers_reserve',\n 'boilers_in_repair', 'net_pumps_in_work', 'net_pumps_reserve',\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 ]
[ "Import'", "ImportFrom'", "Import'", "Import'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", ...
[ "@tornado.web.asynchronous...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = tornado.concurrent.Future()\n", "VAR_12 = users.get_user_by_cookie(self.get_cookie('user_active_login',\n default=''))\n", "def FUNC_7(VAR_13, VAR_2, VAR_5, VAR_12):...\n", "VAR_26 = VAR_13.request.body\n", "VAR_13.request.body = N...
[ "@tornado.web.asynchronous...\n", "\"\"\"docstring\"\"\"\n", "future = tornado.concurrent.Future()\n", "working_user = users.get_user_by_cookie(self.get_cookie('user_active_login',\n default=''))\n", "def save_file_async(alter_ego, target_path, file_name, working_user):...\n", "upload_data = alter_ego....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_8(self, VAR_13):...\n", "VAR_3 = VAR_13.split()\n", "VAR_27 = self.yml\n", "for subkey in VAR_3:\n", "VAR_27 = VAR_27.get(subkey)\n", "return VAR_27\n", "if VAR_27 is None:\n" ]
[ "def subtree(self, yamlkeys_str):...\n", "yamlkeys = yamlkeys_str.split()\n", "yamlval = self.yml\n", "for subkey in yamlkeys:\n", "yamlval = yamlval.get(subkey)\n", "return yamlval\n", "if yamlval is None:\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition" ]
[ "def FUNC_15(self, VAR_21):...\n", "self.command('select ' + str(VAR_21), ['Core number', 'Core state',\n 'Debug entry cause', 'Current PC', 'Current CPSR'], 'Error selecting core')\n" ]
[ "def select_core(self, core):...\n", "self.command('select ' + str(core), ['Core number', 'Core state',\n 'Debug entry cause', 'Current PC', 'Current CPSR'], 'Error selecting core')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "async def FUNC_3():...\n", "VAR_12.channel.send('Command list:\\n' + '\\n' +\n '`help` - Shows this help text\\n' +\n '`whitelist` - Add user(s) to the whitelist')\n" ]
[ "async def help():...\n", "message.channel.send('Command list:\\n' + '\\n' +\n '`help` - Shows this help text\\n' +\n '`whitelist` - Add user(s) to the whitelist')\n" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Expr'" ]
[ "def FUNC_9(VAR_8, VAR_11, VAR_12=False, VAR_13=False, VAR_14=None, VAR_15=False...\n", "def FUNC_35(VAR_29):...\n", "VAR_40 = VAR_29.group('name')\n", "VAR_16 = VAR_11[VAR_40]\n", "if VAR_15:\n", "return re.sub(VAR_5, FUNC_35, VAR_8)\n", "if VAR_13 and VAR_16 == VAR_14:\n", "return '{{{}}}'.format(VA...
[ "def apply_wildcards(pattern, wildcards, fill_missing=False, fail_dynamic=...\n", "def format_match(match):...\n", "name = match.group('name')\n", "value = wildcards[name]\n", "if keep_dynamic:\n", "return re.sub(_wildcard_regex, format_match, pattern)\n", "if fail_dynamic and value == dynamic_fill:\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "async def FUNC_15(*VAR_8, **VAR_9):...\n", "if time.time() - VAR_10[1] > FUNC_3.timeout:\n", "VAR_10[0] = await VAR_1(*VAR_8, **kwargs)\n", "return VAR_10[0]\n", "VAR_10[1] = time.time()\n" ]
[ "async def ret(*args, **kwargs):...\n", "if time.time() - cache[1] > cache_page.timeout:\n", "cache[0] = await func(*args, **kwargs)\n", "return cache[0]\n", "cache[1] = time.time()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_14(self, VAR_10, *VAR_11):...\n", "if self._parts is None:\n", "VAR_2 = self.charset\n", "if not VAR_11:\n", "if self._path is not None:\n", "return getattr(self, '_' + VAR_10)\n", "setattr(self, '_' + VAR_10, VAR_11[0])\n", "VAR_7 = self._path\n", "VAR_7 = u'' if VAR_2 else b''\n", "if ...
[ "def _parse(self, name, *args):...\n", "if self._parts is None:\n", "charset = self.charset\n", "if not args:\n", "if self._path is not None:\n", "return getattr(self, '_' + name)\n", "setattr(self, '_' + name, args[0])\n", "path = self._path\n", "path = u'' if charset else b''\n", "if charset:\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 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", ...
[ "def FUNC_0(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = self.cleaned_data['title']\n", "if not VAR_0.match(VAR_11):\n", "VAR_12 = ChangeSet.objects.filter(old_title=title).count()\n", "if VAR_12 > 0:\n", "return VAR_11\n" ]
[ "def clean_title(self):...\n", "\"\"\"docstring\"\"\"\n", "title = self.cleaned_data['title']\n", "if not wikiword_pattern.match(title):\n", "cs = ChangeSet.objects.filter(old_title=title).count()\n", "if cs > 0:\n", "return title\n" ]
[ 0, 0, 0, 0, 6, 6, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Return'" ]
[ "def __init__(self, VAR_1):...\n", "self.server = VAR_1.get('etcd_server', '127.0.0.1')\n", "self.port = int(VAR_1.get('etcd_port', 4001))\n", "self.namespace = VAR_1.get('namespace', '/custodia')\n", "self.etcd = etcd.Client(self.server, self.port)\n", "FUNC_0('Error creating namespace %s: [%r]' % (self....
[ "def __init__(self, config):...\n", "self.server = config.get('etcd_server', '127.0.0.1')\n", "self.port = int(config.get('etcd_port', 4001))\n", "self.namespace = config.get('namespace', '/custodia')\n", "self.etcd = etcd.Client(self.server, self.port)\n", "log_error('Error creating namespace %s: [%r]' %...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_9(VAR_12):...\n", "\"\"\"docstring\"\"\"\n", "VAR_30 = []\n", "VAR_31 = []\n", "VAR_32 = CommerceConfiguration.current()\n", "VAR_33 = {'username': VAR_12.username}\n", "VAR_34 = VAR_32.is_cache_enabled\n", "VAR_35 = VAR_32.CACHE_KEY + '.' + str(VAR_12.id) if VAR_34 else None\n", "VAR_36 =...
[ "def get_user_orders(user):...\n", "\"\"\"docstring\"\"\"\n", "no_data = []\n", "user_orders = []\n", "commerce_configuration = CommerceConfiguration.current()\n", "user_query = {'username': user.username}\n", "use_cache = commerce_configuration.is_cache_enabled\n", "cache_key = commerce_configuration...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_0(VAR_0, VAR_1, VAR_2=None, VAR_3=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = posixpath.normpath(unquote(VAR_1))\n", "VAR_1 = VAR_1.lstrip('/')\n", "VAR_10 = ''\n", "for VAR_18 in VAR_1.split('/'):\n", "if not VAR_18:\n", "if VAR_10 and VAR_1 != VAR_10:\n", "VAR_17, VAR_18 = os.path...
[ "def serve(request, path, document_root=None, show_indexes=False):...\n", "\"\"\"docstring\"\"\"\n", "path = posixpath.normpath(unquote(path))\n", "path = path.lstrip('/')\n", "newpath = ''\n", "for part in path.split('/'):\n", "if not part:\n", "if newpath and path != newpath:\n", "drive, part = os...
[ 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 6, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", ...
[ "def FUNC_43(self, VAR_21=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_32 = list()\n", "VAR_21 = VAR_21 or self.get_columns_list()\n", "for VAR_14 in VAR_21:\n", "if not self.is_relation(VAR_14):\n", "return VAR_32\n", "if hasattr(self.obj, VAR_14):\n", "if not hasattr(getattr(self.obj, VAR_14), '_...
[ "def get_order_columns_list(self, list_columns=None):...\n", "\"\"\"docstring\"\"\"\n", "ret_lst = list()\n", "list_columns = list_columns or self.get_columns_list()\n", "for col_name in list_columns:\n", "if not self.is_relation(col_name):\n", "return ret_lst\n", "if hasattr(self.obj, col_name):\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Condition", "Return'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_24):...\n", "QNetworkAccessManager.__init__(self)\n", "VAR_27 = QUrl('http://localhost:%d/events' % VAR_24)\n", "self.request = QNetworkRequest(VAR_27)\n", "self.failed_attempts = 0\n", "self.connect_timer = QTimer()\n", "self.current_event_string = ''\n", "self.tribler_version...
[ "def __init__(self, api_port):...\n", "QNetworkAccessManager.__init__(self)\n", "url = QUrl('http://localhost:%d/events' % api_port)\n", "self.request = QNetworkRequest(url)\n", "self.failed_attempts = 0\n", "self.connect_timer = QTimer()\n", "self.current_event_string = ''\n", "self.tribler_version =...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_28(VAR_13):...\n", "self.assertEqual('/request', VAR_13.path)\n", "VAR_12.append('applicable')\n", "return VAR_5\n" ]
[ "def applicable(request):...\n", "self.assertEqual('/request', request.path)\n", "calls.append('applicable')\n", "return ident\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Return'" ]
[ "@FUNC_0...\n", "VAR_27 = VAR_10.get_transport()\n", "VAR_7 = VAR_27.open_session()\n", "VAR_7.invoke_shell()\n", "VAR_0.debug(_('Reading CLI MOTD'))\n", "self._get_output(VAR_7)\n", "VAR_28 = 'stty columns 255'\n", "VAR_0.debug(_(\"Setting CLI terminal width: '%s'\"), VAR_28)\n", "VAR_7.send(VAR_28...
[ "@with_timeout...\n", "transport = ssh.get_transport()\n", "chan = transport.open_session()\n", "chan.invoke_shell()\n", "LOG.debug(_('Reading CLI MOTD'))\n", "self._get_output(chan)\n", "cmd = 'stty columns 255'\n", "LOG.debug(_(\"Setting CLI terminal width: '%s'\"), cmd)\n", "chan.send(cmd + '\\r'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "For", "Assign'", "Return'", "Assign'", "Expr'" ]
[ "def __init__(VAR_39, VAR_40, VAR_41, VAR_42, VAR_43, VAR_44, VAR_45, VAR_46):...\n", "VAR_39.returncode = None\n", "VAR_6 = [sys.executable, bot_main.THIS_FILE, 'run_isolated']\n", "self.assertEqual(VAR_6, VAR_40[:len(VAR_6)])\n", "self.assertEqual(True, VAR_41)\n", "self.assertEqual(subprocess42.PIPE, V...
[ "def __init__(self2, cmd, detached, cwd, stdout, stderr, stdin, close_fds):...\n", "self2.returncode = None\n", "expected = [sys.executable, bot_main.THIS_FILE, 'run_isolated']\n", "self.assertEqual(expected, cmd[:len(expected)])\n", "self.assertEqual(True, detached)\n", "self.assertEqual(subprocess42.PIP...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2():...\n", "VAR_11 = request.args.get('page') or VAR_1\n", "VAR_12 = request.args.get('perPage') or VAR_2\n", "VAR_13 = request.args.get('rating') or VAR_3\n", "VAR_14 = request.args.get('search') or None\n", "VAR_8 = {'page': int(VAR_11), 'perPage': int(VAR_12), 'rating': int(VAR_13),\n 'se...
[ "def get_filters():...\n", "page = request.args.get('page') or DEFAULT_PAGE\n", "perPage = request.args.get('perPage') or DEFAULT_PER_PAGE\n", "rating = request.args.get('rating') or DEFAULT_RATING\n", "search = request.args.get('search') or None\n", "filters = {'page': int(page), 'perPage': int(perPage),...
[ 0, 0, 0, 0, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_0='_Test Event', VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import get_datetime\n", "VAR_2 = frappe.get_doc({'doctype': 'Event', 'subject': VAR_0, 'event_type':\n 'Public', 'starts_on': get_datetime(VAR_1)}).insert(ignore_permissions=True\n )\n", "return VAR_2\n"...
[ "def create_event(subject='_Test Event', starts_on=None):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import get_datetime\n", "event = frappe.get_doc({'doctype': 'Event', 'subject': subject,\n 'event_type': 'Public', 'starts_on': get_datetime(starts_on)}).insert(\n ignore_permissions=True)\n", ...
[ 0, 0, 0, 0, 4 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Assign'", "Return'" ]
[ "def __str__(self):...\n", "return f\"Instance of a connector to the database. The connection is {'opened' if self.conn else 'closed'}. SSH tunnel is {'opened' if self.tunnel_opened else 'closed'}.\"\n" ]
[ "def __str__(self):...\n", "return f\"Instance of a connector to the database. The connection is {'opened' if self.conn else 'closed'}. SSH tunnel is {'opened' if self.tunnel_opened else 'closed'}.\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/<page_name>')...\n", "VAR_3 = VAR_1.query('string' % VAR_2)\n", "VAR_4 = VAR_3.namedresult()\n", "VAR_5 = False\n", "VAR_6 = False\n", "if len(VAR_4) < 1:\n", "VAR_7 = ''\n", "VAR_6 = True\n", "if len(VAR_7) > 0:\n", "VAR_7 = VAR_4[0].content\n", "VAR_5 = True\n", "VAR_7 = mark...
[ "@app.route('/<page_name>')...\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_content.id desc limit 1\"\n % page_name)\n", "wiki_page = query.nam...
[ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(self, VAR_1, VAR_7, VAR_8, VAR_9, VAR_4=None):...\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "VAR_29 = super(CLASS_0, self).view_header_get(VAR_1, VAR_7, VAR_8, VAR_9, VAR_4\n )\n", "if VAR_29:\n", "return VAR_29\n", "if VAR_4.get('active_id', False) and VAR_4.get('active_model'\n", "re...
[ "def view_header_get(self, cr, user, view_id, view_type, context=None):...\n", "if context is None:\n", "context = {}\n", "res = super(product_product, self).view_header_get(cr, user, view_id,\n view_type, context)\n", "if res:\n", "return res\n", "if context.get('active_id', False) and context.get('...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_4(VAR_0):...\n", "VAR_2 = VAR_0.GET.get('url', None)\n", "VAR_15 = FUNC_5(VAR_2)\n", "while VAR_15 != VAR_2:\n", "VAR_2 = VAR_15\n", "return JsonResponse({'url': VAR_15})\n", "VAR_15 = FUNC_5(VAR_2)\n" ]
[ "def expand_url(request):...\n", "url = request.GET.get('url', None)\n", "exurl = expand(url)\n", "while exurl != url:\n", "url = exurl\n", "return JsonResponse({'url': exurl})\n", "exurl = expand(url)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_31(VAR_16, VAR_22, VAR_28):...\n", "VAR_53 = 'string'.format(VAR_22, VAR_28, VAR_28)\n", "print(VAR_53)\n", "VAR_54 = VAR_16.exec(VAR_53)\n", "VAR_54 = [[VAR_41[0], int(VAR_41[1])] for VAR_41 in VAR_54]\n", "return VAR_54\n" ]
[ "def get_bracket_placings_in_scene(db, scene, tag):...\n", "sql = (\n \"select distinct matches.date, placings.place from placings join matches on matches.url=placings.url where scene='{}' and ((player1='{}' and placings.player=player1) or (player2='{}' and placings.player=player2));\"\...
[ 0, 4, 4, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_17(self, VAR_9, VAR_10):...\n", "return VAR_9[VAR_10:VAR_10 + 16].split(b'\\x00', 1)[0]\n" ]
[ "def _format_single_interface_name(self, sock, offset):...\n", "return sock[offset:offset + 16].split(b'\\x00', 1)[0]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(self, VAR_51):...\n", "VAR_81 = VAR_51\n", "VAR_51 = FUNC_3(VAR_51)\n", "if not VAR_51:\n", "return self.error(FUNC_4(VAR_81))\n", "VAR_15 = Account._by_name(VAR_51, True)\n", "return VAR_51\n", "return self.error(errors.USERNAME_TAKEN)\n" ]
[ "def run(self, user_name):...\n", "original_user_name = user_name\n", "user_name = chkuser(user_name)\n", "if not user_name:\n", "return self.error(whyuserbad(original_user_name))\n", "a = Account._by_name(user_name, True)\n", "return user_name\n", "return self.error(errors.USERNAME_TAKEN)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Return'", "Return'" ]
[ "def __repr__(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.__module__ + '.' + self.__class__.__name__ + '\\nInstance: ' + self.name\n" ]
[ "def __repr__(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.__module__ + '.' + self.__class__.__name__ + '\\nInstance: ' + self.name\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __eq__(self, VAR_35):...\n", "return self.__class__ == VAR_35.__class__ and self.inner_type == VAR_35.inner_type\n" ]
[ "def __eq__(self, other):...\n", "return self.__class__ == other.__class__ and self.inner_type == other.inner_type\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_5(self, VAR_18):...\n", "self.setResponseCode(302)\n", "self.setHeader(b'location', VAR_18)\n" ]
[ "def redirect(self, url):...\n", "self.setResponseCode(302)\n", "self.setHeader(b'location', url)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_4(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_3[1] == '0':\n", "return self.cursor.execute(\n 'select * from item where item.name = \"%s\"' % VAR_3[0])\n", "return self.cursor.execute('string' % (VAR_3[0], VAR_3[1]))\n" ]
[ "def find_item_name(self, nameid):...\n", "\"\"\"docstring\"\"\"\n", "if nameid[1] == '0':\n", "return self.cursor.execute(\n 'select * from item where item.name = \"%s\"' % nameid[0])\n", "return self.cursor.execute(\n 'select item.id, item.name, item.shoppinglistid, i...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(self):...\n", "if self._IsServerAlive():\n", "return BaseRequest.PostDataToHandler(BuildRequestData(), 'defined_subcommands')\n", "return []\n" ]
[ "def GetDefinedSubcommands(self):...\n", "if self._IsServerAlive():\n", "return BaseRequest.PostDataToHandler(BuildRequestData(), 'defined_subcommands')\n", "return []\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "@app.route('/upload', methods=['POST'])...\n", "VAR_2 = {'secret': app.config['G_CAPTCHA_SECRET'], 'response': request.form\n ['g-recaptcha-response'], 'remoteip': request.remote_addr}\n", "VAR_3 = requests.post(app.config['G_CAPTCHA_VERIFY'], VAR_2=data).json()\n", "if VAR_3['success']:\n", "VAR_1 = Pr...
[ "@app.route('/upload', methods=['POST'])...\n", "data = {'secret': app.config['G_CAPTCHA_SECRET'], 'response': request.form[\n 'g-recaptcha-response'], 'remoteip': request.remote_addr}\n", "resp = requests.post(app.config['G_CAPTCHA_VERIFY'], data=data).json()\n", "if resp['success']:\n", "form = Process...
[ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Return'", "For", "Assign'", "For", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr...
[ "def FUNC_2():...\n", "VAR_11, VAR_10 = FUNC_1()\n", "VAR_11.execute('string')\n", "VAR_11.execute('string')\n", "VAR_10.commit()\n", "VAR_10.close()\n" ]
[ "def createDatabase():...\n", "c, conn = getConnection()\n", "c.execute(\n \"\"\"CREATE TABLE if not exists npc\n\t\t\t\t (date text, user text, race text, class text, sex text, level INTEGER, image text, legit INTEGER)\"\"\"\n )\n", "c.execute(\n \"\"\"CREATE TABLE if not exists usage\n\t\t\t\t (id ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_9(self, VAR_13, VAR_14, VAR_15, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "VAR_23 = {}\n", "self.sessid = VAR_14.routing_key\n", "import sys\n", "if 'callbackID' in VAR_23:\n", "VAR_23 = json_decode(VAR_16)\n", "if hasattr(sys, '_called_from_test'):\n", "VAR_17['callbackID'] = VAR_23['cal...
[ "def handle_message(self, ch, method, properties, body):...\n", "\"\"\"docstring\"\"\"\n", "input = {}\n", "self.sessid = method.routing_key\n", "import sys\n", "if 'callbackID' in input:\n", "input = json_decode(body)\n", "if hasattr(sys, '_called_from_test'):\n", "output['callbackID'] = input['cal...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Import'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Conditi...
[ "def FUNC_1(self):...\n", "VAR_1 = self.get_secure_cookie('sid')\n", "if not VAR_1:\n", "return False\n", "VAR_2 = self.session.get('email')\n", "VAR_3 = dbapi.User()\n", "if VAR_2 and VAR_3.get_user(VAR_2) == 0:\n", "VAR_9 = VAR_3.get_user_all(VAR_2)\n", "self.clear_cookies()\n", "if VAR_9:\n", ...
[ "def check(self):...\n", "sid = self.get_secure_cookie('sid')\n", "if not sid:\n", "return False\n", "email = self.session.get('email')\n", "user = dbapi.User()\n", "if email and user.get_user(email) == 0:\n", "profile = user.get_user_all(email)\n", "self.clear_cookies()\n", "if profile:\n", "re...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Return'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(self, VAR_4):...\n", "self.headers.append(('Content-Type', '%s; charset=utf-8' % VAR_0))\n", "if isinstance(VAR_4, list) or isinstance(VAR_4, tuple):\n", "VAR_7 = self._render_obj_list(VAR_4)\n", "VAR_7 = self._render_single_obj(VAR_4)\n", "self.body = json.dumps(VAR_7, indent=self.INDENT)\n" ...
[ "def render(self, objects):...\n", "self.headers.append(('Content-Type', '%s; charset=utf-8' % CONTENT_TYPE))\n", "if isinstance(objects, list) or isinstance(objects, tuple):\n", "json_data = self._render_obj_list(objects)\n", "json_data = self._render_single_obj(objects)\n", "self.body = json.dumps(json_...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_45(VAR_25, VAR_39):...\n", "if self.parentfield:\n", "return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(VAR_25.label), VAR_39)\n", "return '{}: {}'.format(_(VAR_25.label), VAR_39)\n" ]
[ "def get_msg(df, docname):...\n", "if self.parentfield:\n", "return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(df.label), docname)\n", "return '{}: {}'.format(_(df.label), docname)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_5(self, VAR_6, VAR_7):...\n", "" ]
[ "def _executeSQL(self, cur, sql):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_1():...\n", "VAR_3 = files.get_static_data('./static/home.html')\n", "VAR_4 = users.get_user_by_cookie(self.get_cookie('user_active_login',\n default=''))\n", "VAR_3 = preproc.preprocess_webpage(VAR_3, VAR_4)\n", "VAR_2.set_result(VAR_3)\n" ]
[ "def get_index_html_async():...\n", "file_data = files.get_static_data('./static/home.html')\n", "working_user = users.get_user_by_cookie(self.get_cookie('user_active_login',\n default=''))\n", "file_data = preproc.preprocess_webpage(file_data, working_user)\n", "future.set_result(file_data)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_0(self):...\n", "VAR_0 = Section('some_name')\n", "self.uut = Lint(VAR_0, None)\n" ]
[ "def setUp(self):...\n", "section = Section('some_name')\n", "self.uut = Lint(section, None)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def __init__(self, VAR_40):...\n", "assert VAR_40 in (32, 64)\n", "self.size = VAR_40\n" ]
[ "def __init__(self, size):...\n", "assert size in (32, 64)\n", "self.size = size\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Assign'" ]
[ "def FUNC_20(self):...\n", "self._ServerCleanup()\n" ]
[ "def OnVimLeave(self):...\n", "self._ServerCleanup()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_7(VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "return '/logout?' + urllib.parse.urlencode({'csrf_token': form.\n generate_csrf_token(), 'dest': VAR_8})\n" ]
[ "def make_logout_url(dest_url):...\n", "\"\"\"docstring\"\"\"\n", "return '/logout?' + urllib.parse.urlencode({'csrf_token': form.\n generate_csrf_token(), 'dest': dest_url})\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "@FUNC_1.command(aliases=['u', 'upd'])...\n", "\"\"\"docstring\"\"\"\n", "if not self.updating:\n", "self.updating = True\n", "await VAR_1.send('Database update still in progress.')\n", "await VAR_1.send('Database update in progress...')\n", "VAR_6 = asyncio.get_event_loop()\n", "await VAR_6.run_in_ex...
[ "@eddb.command(aliases=['u', 'upd'])...\n", "\"\"\"docstring\"\"\"\n", "if not self.updating:\n", "self.updating = True\n", "await ctx.send('Database update still in progress.')\n", "await ctx.send('Database update in progress...')\n", "loop = asyncio.get_event_loop()\n", "await loop.run_in_executor(N...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'" ]
[ "@staticmethod...\n", "VAR_0 = Database()\n", "VAR_11 = VAR_0.list_tasks(VAR_2=limit, VAR_3=offset, VAR_30='file',\n not_status=TASK_PENDING)\n", "VAR_12 = VAR_0.list_tasks(VAR_2=limit, VAR_3=offset, VAR_30='url',\n not_status=TASK_PENDING)\n", "VAR_9 = []\n", "if VAR_11:\n", "for VAR_10 in VAR_11...
[ "@staticmethod...\n", "db = Database()\n", "tasks_files = db.list_tasks(limit=limit, offset=offset, category='file',\n not_status=TASK_PENDING)\n", "tasks_urls = db.list_tasks(limit=limit, offset=offset, category='url',\n not_status=TASK_PENDING)\n", "data = []\n", "if tasks_files:\n", "for task i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "For", "Condition", "Assign'", "For", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Condition", "Assign'", "Expr'" ]
[ "@tornado.web.authenticated...\n", "self.render('../config.html', cfg=cfgDAO.loadConfig())\n" ]
[ "@tornado.web.authenticated...\n", "self.render('../config.html', cfg=cfgDAO.loadConfig())\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def __lt__(self, VAR_11):...\n", "return self.rule.__lt__(VAR_11.rule)\n" ]
[ "def __lt__(self, other):...\n", "return self.rule.__lt__(other.rule)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@wraps(VAR_8)...\n", "if g.oidc_id_token is None:\n", "return self.redirect_to_auth_server(request.url)\n", "return VAR_8(*VAR_14, **kwargs)\n" ]
[ "@wraps(view_func)...\n", "if g.oidc_id_token is None:\n", "return self.redirect_to_auth_server(request.url)\n", "return view_func(*args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_7(VAR_14):...\n", "\"\"\"docstring\"\"\"\n", "VAR_0.info('Creating admin...')\n", "VAR_5['username'] = 'admin%s' % VAR_14\n", "VAR_5['password'] = 'adminpwd'\n", "FUNC_4([sys.executable, 'cmscontrib/AddAdmin.py', '%(username)s' % VAR_5,\n '-p', '%(password)s' % VAR_5])\n" ]
[ "def initialize_aws(rand):...\n", "\"\"\"docstring\"\"\"\n", "logger.info('Creating admin...')\n", "admin_info['username'] = 'admin%s' % rand\n", "admin_info['password'] = 'adminpwd'\n", "sh([sys.executable, 'cmscontrib/AddAdmin.py', '%(username)s' % admin_info,\n '-p', '%(password)s' % admin_info])\n"...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(**VAR_6):...\n", "import sql\n", "import http.cookies\n", "VAR_25 = http.cookies.SimpleCookie(os.environ.get('HTTP_COOKIE'))\n", "VAR_26 = VAR_25.get('uuid')\n", "VAR_27 = os.environ.get('SCRIPT_NAME')\n", "sql.delete_old_uuid()\n", "if VAR_26 is not None:\n", "sql.update_last_act_user(V...
[ "def check_login(**kwargs):...\n", "import sql\n", "import http.cookies\n", "cookie = http.cookies.SimpleCookie(os.environ.get('HTTP_COOKIE'))\n", "user_uuid = cookie.get('uuid')\n", "ref = os.environ.get('SCRIPT_NAME')\n", "sql.delete_old_uuid()\n", "if user_uuid is not None:\n", "sql.update_last_a...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Import'", "Import'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_5():...\n", "\"\"\"docstring\"\"\"\n", "user.ensure_group('jupyterhub-admins')\n", "user.ensure_group('jupyterhub-users')\n", "VAR_1.info('Granting passwordless sudo to JupyterHub admins...')\n", "f.write('%jupyterhub-admins ALL = (ALL) NOPASSWD: ALL\\n')\n", "f.write('Defaults exempt_group = ...
[ "def ensure_usergroups():...\n", "\"\"\"docstring\"\"\"\n", "user.ensure_group('jupyterhub-admins')\n", "user.ensure_group('jupyterhub-users')\n", "logger.info('Granting passwordless sudo to JupyterHub admins...')\n", "f.write('%jupyterhub-admins ALL = (ALL) NOPASSWD: ALL\\n')\n", "f.write('Defaults exe...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_0.inclusion_tag('exercise/_user_last.html', takes_context=True)...\n", "VAR_14 = VAR_1['request'].user\n", "VAR_16 = FUNC_1(VAR_1)\n", "if VAR_14.is_authenticated():\n", "VAR_25 = LearningObjectDisplay.objects.filter(profile=user.userprofile,\n learning_object__status=LearningObject.STATUS.READY,\n...
[ "@register.inclusion_tag('exercise/_user_last.html', takes_context=True)...\n", "user = context['request'].user\n", "points = _prepare_context(context)\n", "if user.is_authenticated():\n", "last = LearningObjectDisplay.objects.filter(profile=user.userprofile,\n learning_object__status=LearningObject.STAT...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_32(VAR_19):...\n", "return dict((expr, vimsupport.VimExpressionToPythonType(expr)) for expr in\n VAR_19)\n" ]
[ "def BuildExtraConfData(extra_conf_vim_data):...\n", "return dict((expr, vimsupport.VimExpressionToPythonType(expr)) for expr in\n extra_conf_vim_data)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_7(self):...\n", "return {}\n" ]
[ "def Response(self):...\n", "return {}\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_8(self):...\n", "return 'try to login'\n" ]
[ "def describe(self):...\n", "return 'try to login'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_21(VAR_18, VAR_29, VAR_30=60):...\n", "VAR_50 = re.compile(\n 'Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.|Scoring\\\\.\\\\.\\\\.|Evaluated')\n", "VAR_51 = re.compile('Compilation failed|Evaluated \\\\(|Scored \\\\(')\n", "VAR_34 = FUNC_0()\n", "VAR_52 = 0.1\n", "while VAR_30 > 0:\n", ...
[ "def get_evaluation_result(contest_id, submission_id, timeout=60):...\n", "WAITING_STATUSES = re.compile(\n 'Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.|Scoring\\\\.\\\\.\\\\.|Evaluated')\n", "COMPLETED_STATUS = re.compile('Compilation failed|Evaluated \\\\(|Scored \\\\(')\n", "browser = get_aws_bro...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "AugAssign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Expr'" ]
[ "def FUNC_1(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_16 = os.path.basename(VAR_0)\n", "print('Fetching %s...' % VAR_16)\n", "FUNC_0(VAR_0 + '.asc')\n", "FUNC_0(VAR_0)\n", "FUNC_0(VAR_0 + '.sha256')\n", "FUNC_0(VAR_0 + '.asc.sha256')\n", "print('Verifying %s...' % VAR_16)\n", "os.system('shas...
[ "def fetch(url):...\n", "\"\"\"docstring\"\"\"\n", "base = os.path.basename(url)\n", "print('Fetching %s...' % base)\n", "fetch_file(url + '.asc')\n", "fetch_file(url)\n", "fetch_file(url + '.sha256')\n", "fetch_file(url + '.asc.sha256')\n", "print('Verifying %s...' % base)\n", "os.system('shasum ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]