lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "def FUNC_28(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertIs(VAR_5.evaluate('True'), True)\n", "self.assertIs(VAR_5.evaluate('False'), False)\n", "self.assertIs(VAR_5.evaluate('nocall: test'), safe_builtins['test'])\n" ]
[ "def test_builtin_in_path_expr(self):...\n", "ec = self._makeContext()\n", "self.assertIs(ec.evaluate('True'), True)\n", "self.assertIs(ec.evaluate('False'), False)\n", "self.assertIs(ec.evaluate('nocall: test'), safe_builtins['test'])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_4.route('/answer', methods=['GET', 'POST'])...\n", "print(VAR_17)\n", "VAR_20 = request.form.get('option', None)\n", "if VAR_20 is None or not type(VAR_20) != int:\n", "return abort(400)\n", "VAR_20 = int(VAR_20)\n", "VAR_21 = VAR_17['correct']\n", "if VAR_21 is None:\n", "return abort(401)\n"...
[ "@app.route('/answer', methods=['GET', 'POST'])...\n", "print(session)\n", "option = request.form.get('option', None)\n", "if option is None or not type(option) != int:\n", "return abort(400)\n", "option = int(option)\n", "correct = session['correct']\n", "if correct is None:\n", "return abort(401)\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Condition", "AugAssign'", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_35(VAR_36, VAR_41):...\n", "if VAR_36.cover:\n", "VAR_97 = VAR_36.cover\n", "VAR_97 = os.path.join(constants.STATIC_DIR, 'generic_cover.jpg')\n", "VAR_75 = os.path.join(config.config_calibre_dir, VAR_41.path, 'cover.jpg')\n", "copyfile(VAR_97, VAR_75)\n", "VAR_2.error('Failed to move cover fil...
[ "def move_coverfile(meta, db_book):...\n", "if meta.cover:\n", "coverfile = meta.cover\n", "coverfile = os.path.join(constants.STATIC_DIR, 'generic_cover.jpg')\n", "new_coverpath = os.path.join(config.config_calibre_dir, db_book.path,\n 'cover.jpg')\n", "copyfile(coverfile, new_coverpath)\n", "log.er...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_172(VAR_354):...\n", "return VAR_354 + ' ' + VAR_354.replace('icon', 'glyphicon')\n" ]
[ "def rename(icon):...\n", "return icon + ' ' + icon.replace('icon', 'glyphicon')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_22(self):...\n", "\"\"\"docstring\"\"\"\n", "self.client.login(username='super', password='secret')\n", "VAR_21 = self.client.get('/widget_admin/admin_widgets/cartire/add/')\n", "self.assertNotContains(VAR_21, 'BMW M3')\n", "self.assertContains(VAR_21, 'Volkswagon Passat')\n" ]
[ "def testFilterChoicesByRequestUser(self):...\n", "\"\"\"docstring\"\"\"\n", "self.client.login(username='super', password='secret')\n", "response = self.client.get('/widget_admin/admin_widgets/cartire/add/')\n", "self.assertNotContains(response, 'BMW M3')\n", "self.assertContains(response, 'Volkswagon Pa...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_170(VAR_332, VAR_212, VAR_101=VAR_101):...\n", "VAR_212 = VAR_332.select(VAR_175=(0, 1)).first()\n", "VAR_101(VAR_101.wiki_tag.wiki_page == VAR_212.id).delete()\n", "for VAR_440 in (VAR_212.tags or []):\n", "VAR_440 = VAR_440.strip().lower()\n", "if VAR_440:\n", "VAR_101.wiki_tag.insert(VAR_14...
[ "def update_tags_update(dbset, page, db=db):...\n", "page = dbset.select(limitby=(0, 1)).first()\n", "db(db.wiki_tag.wiki_page == page.id).delete()\n", "for tag in (page.tags or []):\n", "tag = tag.strip().lower()\n", "if tag:\n", "db.wiki_tag.insert(name=tag, wiki_page=page.id)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "For", "Assign'", "Condition", "Expr'" ]
[ "async def FUNC_12(VAR_16):...\n", "return {str(u) for u in self.room_members}\n" ]
[ "async def get_users_in_room(room_id):...\n", "return {str(u) for u in self.room_members}\n" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Return'" ]
[ "def FUNC_9(VAR_11, VAR_12):...\n", "VAR_22 = {'org_id': VAR_12.org_id, 'user_id': VAR_12.id, 'action': 'login',\n 'object_type': 'redash', 'timestamp': int(time.time()), 'user_agent':\n VAR_8.user_agent.string, 'ip': VAR_8.remote_addr}\n", "record_event.delay(VAR_22)\n" ]
[ "def log_user_logged_in(app, user):...\n", "event = {'org_id': user.org_id, 'user_id': user.id, 'action': 'login',\n 'object_type': 'redash', 'timestamp': int(time.time()), 'user_agent':\n request.user_agent.string, 'ip': request.remote_addr}\n", "record_event.delay(event)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_8(self, VAR_8, *VAR_9, **VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "if not self.isAuthorized():\n", "VAR_53.session.release_lock()\n", "if cherry.config['media.transcode'] and VAR_9:\n", "VAR_93 = VAR_10.pop('bitrate', None) or None\n", "if VAR_93:\n", "VAR_9 = os.path.sep.join(VAR_9)\n", ...
[ "def trans(self, newformat, *path, **params):...\n", "\"\"\"docstring\"\"\"\n", "if not self.isAuthorized():\n", "cherrypy.session.release_lock()\n", "if cherry.config['media.transcode'] and path:\n", "bitrate = params.pop('bitrate', None) or None\n", "if bitrate:\n", "path = os.path.sep.join(path)\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@pytest.mark.parametrize('inp,out', [('\">alert(1)', '">alert(1)'),...\n", "assert escaping.escape_attribute(VAR_1) == VAR_2\n" ]
[ "@pytest.mark.parametrize('inp,out', [('\">alert(1)', '">alert(1)'),...\n", "assert escaping.escape_attribute(inp) == out\n" ]
[ 0, 0 ]
[ "Condition", "Assert'" ]
[ "@VAR_4.route('/update')...\n", "if request.args.get('key', None) != VAR_4.config['SECRET_KEY']:\n", "return 'error'\n", "FUNC_0()\n", "VAR_17.clear()\n", "return f'success! {len(VAR_3)}'\n" ]
[ "@app.route('/update')...\n", "if request.args.get('key', None) != app.config['SECRET_KEY']:\n", "return 'error'\n", "update()\n", "session.clear()\n", "return f'success! {len(munhak_rows_data)}'\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_0(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_10:\n", "self._start_processing()\n" ]
[ "def on_started(self, should_check_for_notifs):...\n", "\"\"\"docstring\"\"\"\n", "if should_check_for_notifs:\n", "self._start_processing()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'" ]
[ "def FUNC_76(VAR_212):...\n", "if VAR_178(VAR_212.getId()) == VAR_178(VAR_6):\n", "return False\n", "VAR_285 = VAR_212.getPrimaryPixels()\n", "if VAR_285 is None or VAR_212.getPrimaryPixels().getPixelsType().getValue(\n", "return False\n", "VAR_286 = [VAR_30.getLabel() for VAR_30 in VAR_212.getChannels(...
[ "def compat(i):...\n", "if long(i.getId()) == long(iid):\n", "return False\n", "pp = i.getPrimaryPixels()\n", "if pp is None or i.getPrimaryPixels().getPixelsType().getValue(\n", "return False\n", "ew = [x.getLabel() for x in i.getChannels()]\n", "ew.sort()\n", "if ew != img_ew:\n", "return False\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "Condition", "Return'", "Return'" ]
[ "def FUNC_85(VAR_144, VAR_145=1):...\n", "from frappe.utils.response import json_handler\n", "return json.dumps(VAR_144, VAR_145=indent, sort_keys=True, VAR_47=\n json_handler, separators=(',', ': '))\n" ]
[ "def as_json(obj, indent=1):...\n", "from frappe.utils.response import json_handler\n", "return json.dumps(obj, indent=indent, sort_keys=True, default=json_handler,\n separators=(',', ': '))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "def FUNC_14(self, VAR_0, VAR_8, VAR_5, VAR_7):...\n", "VAR_0.get(VAR_8 + self.url)\n", "VAR_16 = VAR_0.find_element(By.XPATH, \"//input[@name='file']\")\n", "VAR_16.send_keys(VAR_5)\n", "assert VAR_16.get_attribute('name') == 'file'\n", "VAR_17 = VAR_0.find_element(By.XPATH, \"//input[@name='save']\")\n"...
[ "def test_file_insert_submit_value(self, driver, live_server, upload_file,...\n", "driver.get(live_server + self.url)\n", "file_input = driver.find_element(By.XPATH, \"//input[@name='file']\")\n", "file_input.send_keys(upload_file)\n", "assert file_input.get_attribute('name') == 'file'\n", "save_button = ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Assert'", "Assign'", "Expr'", "Assert'", "Expr'", "Assign'", "Expr'", "Assert'", "Assign'", "Expr'", "Assert'", "Assert'" ]
[ "def FUNC_4(self):...\n", "VAR_12 = self.get_success(self.handler.check_device_registered(VAR_5=\n '@boris:foo', VAR_6='fco', initial_device_display_name='display name'))\n", "self.assertEqual(VAR_12, 'fco')\n", "VAR_13 = self.get_success(self.handler.check_device_registered(VAR_5=\n '@boris:foo', VAR_6...
[ "def test_device_is_preserved_if_exists(self):...\n", "res1 = self.get_success(self.handler.check_device_registered(user_id=\n '@boris:foo', device_id='fco', initial_device_display_name='display name'))\n", "self.assertEqual(res1, 'fco')\n", "res2 = self.get_success(self.handler.check_device_registered(use...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_28():...\n", "\"\"\"docstring\"\"\"\n", "VAR_60 = argparse.ArgumentParser(description=\n 'saved_model_cli: Command-line interface for SavedModel')\n", "VAR_60.add_argument('-v', '--version', action='version', version='0.1.0')\n", "VAR_21 = VAR_60.add_subparsers(title='commands', description=\n ...
[ "def create_parser():...\n", "\"\"\"docstring\"\"\"\n", "parser = argparse.ArgumentParser(description=\n 'saved_model_cli: Command-line interface for SavedModel')\n", "parser.add_argument('-v', '--version', action='version', version='0.1.0')\n", "subparsers = parser.add_subparsers(title='commands', descr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def __repr__(self):...\n", "return u\"<Registration('{0}')>\".format(self.domain)\n" ]
[ "def __repr__(self):...\n", "return u\"<Registration('{0}')>\".format(self.domain)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_10(self, VAR_15, VAR_57):...\n", "if self.whitelist_tags is not None and VAR_15.tag not in self.whitelist_tags:\n", "return False\n", "VAR_76, VAR_77, VAR_78, VAR_79, VAR_80 = urlsplit(VAR_57)\n", "VAR_77 = VAR_77.lower().split(':', 1)[0]\n", "if VAR_76 not in ('http', 'https'):\n", "return Fa...
[ "def allow_embedded_url(self, el, url):...\n", "if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:\n", "return False\n", "scheme, netloc, path, query, fragment = urlsplit(url)\n", "netloc = netloc.lower().split(':', 1)[0]\n", "if scheme not in ('http', 'https'):\n", "return False\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_143 = FUNC_42(VAR_2, VAR_5)\n", "VAR_144 = []\n", "VAR_145 = []\n", "VAR_146 = set()\n", "VAR_147 = False\n", "for VAR_310 in VAR_143:\n", "VAR_144 += [('%s=%s' % (VAR_310, o.id)) for o in VAR_143[VAR_310]]\n", "VAR_148 = '&'.join(VAR_144)\...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "objs = getObjects(request, conn)\n", "obj_ids = []\n", "obj_labels = []\n", "groupIds = set()\n", "annotationBlocked = False\n", "for key in objs:\n", "obj_ids += [('%s=%s' % (key, o.id)) for o in objs[key]]\n", "obj_string = '&'.join(obj_ids)\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "AugAssign'", "Assign'", "For", "Assign'", "Expr'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Expr'", "Return'", "Return'", "Expr'", "Assign'", "Assign'", "Assi...
[ "@VAR_8.route('/', methods=['GET'])...\n", "VAR_43['state'] = None\n", "return render_template('frontend/index.html', VAR_78=app.interface.config)\n" ]
[ "@app.route('/', methods=['GET'])...\n", "session['state'] = None\n", "return render_template('frontend/index.html', config=app.interface.config)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Return'" ]
[ "def FUNC_14(VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "VAR_39 = {}\n", "for input_raw in filter(bool, VAR_17.split(';')):\n", "if '=' not in VAR_17:\n", "return VAR_39\n", "VAR_68, VAR_69 = input_raw.split('=', 1)\n", "VAR_39[VAR_68] = eval(VAR_69)\n" ]
[ "def preprocess_input_exprs_arg_string(input_exprs_str):...\n", "\"\"\"docstring\"\"\"\n", "input_dict = {}\n", "for input_raw in filter(bool, input_exprs_str.split(';')):\n", "if '=' not in input_exprs_str:\n", "return input_dict\n", "input_key, expr = input_raw.split('=', 1)\n", "input_dict[input_ke...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Assign'", "Assign'" ]
[ "@VAR_0.route('/delete/<int:book_id>', defaults={'book_format': ''})...\n", "return FUNC_13(VAR_14, VAR_15, False)\n" ]
[ "@editbook.route('/delete/<int:book_id>', defaults={'book_format': ''})...\n", "return delete_book_from_table(book_id, book_format, False)\n" ]
[ 0, 0 ]
[ "For", "Return'" ]
[ "def FUNC_46(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_161 = [(state_key, int(VAR_1.depth)) for (e_type, state_key), VAR_1 in\n VAR_2.items() if e_type == VAR_188.Member and VAR_1.membership ==\n Membership.JOIN]\n", "VAR_162 = {}\n", "for u, d in VAR_161:\n", "return sorted(VAR_162.items(), VA...
[ "def get_domains_from_state(state):...\n", "\"\"\"docstring\"\"\"\n", "joined_users = [(state_key, int(event.depth)) for (e_type, state_key),\n event in state.items() if e_type == EventTypes.Member and event.\n membership == Membership.JOIN]\n", "joined_domains = {}\n", "for u, d in joined_users:\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2048,...\n", "return {'res': VAR_44 + self.var}\n" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2048,...\n", "return {'res': x + self.var}\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_16(self):...\n", "self.assert_expected(self.folder.t, 'CheckNotExpression.html')\n" ]
[ "def testNotExpression(self):...\n", "self.assert_expected(self.folder.t, 'CheckNotExpression.html')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_15(VAR_3, **VAR_4):...\n", "VAR_15 = Deferred()\n", "VAR_15.addCallback(FUNC_16)\n", "self.reactor.callLater(1, VAR_15.callback, True)\n", "return make_deferred_yieldable(VAR_15)\n" ]
[ "def _callback(request, **kwargs):...\n", "d = Deferred()\n", "d.addCallback(_throw)\n", "self.reactor.callLater(1, d.callback, True)\n", "return make_deferred_yieldable(d)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_18(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = copy.copy(self.data)\n", "VAR_10['offset'] = '1'\n", "VAR_10['checksum'] = ''\n", "self.data = VAR_10\n", "return self\n" ]
[ "def reset_offset(self):...\n", "\"\"\"docstring\"\"\"\n", "data = copy.copy(self.data)\n", "data['offset'] = '1'\n", "data['checksum'] = ''\n", "self.data = data\n", "return self\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@wraps(VAR_0)...\n", "VAR_4 = VAR_1.user\n", "if not VAR_4.is_authenticated:\n", "return redirect_to_login(next=request.get_full_path(), login_url=settings.\n LOGIN_URL)\n", "if not VAR_4.st.is_moderator:\n", "return VAR_0(VAR_1, *VAR_2, **kwargs)\n" ]
[ "@wraps(view_func)...\n", "user = request.user\n", "if not user.is_authenticated:\n", "return redirect_to_login(next=request.get_full_path(), login_url=settings.\n LOGIN_URL)\n", "if not user.st.is_moderator:\n", "return view_func(request, *args, **kwargs)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Condition", "Return'" ]
[ "async def FUNC_49(VAR_102: _NewEventInfo):...\n", "VAR_1 = VAR_102.event\n", "VAR_168 = await self._prep_event(VAR_5, VAR_1, VAR_2=ev_info.state, VAR_3=\n ev_info.auth_events, VAR_33=backfilled)\n", "return VAR_168\n" ]
[ "async def prep(ev_info: _NewEventInfo):...\n", "event = ev_info.event\n", "res = await self._prep_event(origin, event, state=ev_info.state,\n auth_events=ev_info.auth_events, backfilled=backfilled)\n", "return res\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_25(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertEqual(VAR_5.evaluate(' \\n'), None)\n" ]
[ "def test_empty_path_expression_implicit_with_trailing_whitespace(self):...\n", "ec = self._makeContext()\n", "self.assertEqual(ec.evaluate(' \\n'), None)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@defer.inlineCallbacks...\n", "yield defer.ensureDeferred(self.store.set_profile_avatar_url(self.frank.\n localpart, 'http://my.server/me.png'))\n", "VAR_6 = yield defer.ensureDeferred(self.handler.get_avatar_url(self.frank))\n", "self.assertEquals('http://my.server/me.png', VAR_6)\n" ]
[ "@defer.inlineCallbacks...\n", "yield defer.ensureDeferred(self.store.set_profile_avatar_url(self.frank.\n localpart, 'http://my.server/me.png'))\n", "avatar_url = yield defer.ensureDeferred(self.handler.get_avatar_url(self.frank)\n )\n", "self.assertEquals('http://my.server/me.png', avatar_url)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_4(VAR_0):...\n", "VAR_8 = VAR_0.values.get('pagename', '')\n", "if VAR_8:\n", "from MoinMoin import search\n", "VAR_32 = ''\n", "VAR_30 = search.searchPages(VAR_0, 't:\"%s\"' % VAR_8)\n", "VAR_9 = wikiutil.load_wikimap(VAR_0)\n", "VAR_31 = [p.page_name for p in VAR_30.hits]\n", "VAR_10 = V...
[ "def link_dialog(request):...\n", "name = request.values.get('pagename', '')\n", "if name:\n", "from MoinMoin import search\n", "page_list = ''\n", "searchresult = search.searchPages(request, 't:\"%s\"' % name)\n", "interwiki_list = wikiutil.load_wikimap(request)\n", "pages = [p.page_name for p in sea...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 ]
[ "FunctionDef'", "Assign'", "Condition", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", ...
[ "def FUNC_1(VAR_1, VAR_2=False):...\n", "\"\"\"docstring\"\"\"\n", "for hook in VAR_25.get_hooks('override_whitelisted_methods', {}).get(VAR_1, []\n", "VAR_1 = hook\n", "if run_server_script_api(VAR_1):\n", "return None\n", "VAR_3 = FUNC_11(VAR_1)\n", "if VAR_25.local.conf.developer_mode:\n", "if VA...
[ "def execute_cmd(cmd, from_async=False):...\n", "\"\"\"docstring\"\"\"\n", "for hook in frappe.get_hooks('override_whitelisted_methods', {}).get(cmd, []):\n", "cmd = hook\n", "if run_server_script_api(cmd):\n", "return None\n", "method = get_attr(cmd)\n", "if frappe.local.conf.developer_mode:\n", "i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0 ]
[ "FunctionDef'", "Docstring", "For", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Condition", "Expr'", "Return'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_5(self, VAR_24, VAR_25=None):...\n", "if VAR_25:\n", "return b''.join(list(self.serialize(VAR_24, VAR_25)))\n", "return ''.join(list(self.serialize(VAR_24)))\n" ]
[ "def render(self, treewalker, encoding=None):...\n", "if encoding:\n", "return b''.join(list(self.serialize(treewalker, encoding)))\n", "return ''.join(list(self.serialize(treewalker)))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_11():...\n", "logout_user()\n", "if settings.MULTI_ORG and current_org == None:\n", "VAR_31 = '/'\n", "if settings.MULTI_ORG:\n", "return redirect(VAR_31)\n", "VAR_31 = url_for('redash.index', org_slug=current_org.slug, _external=False)\n", "VAR_31 = url_for('redash.index', _external=False)\...
[ "def logout_and_redirect_to_index():...\n", "logout_user()\n", "if settings.MULTI_ORG and current_org == None:\n", "index_url = '/'\n", "if settings.MULTI_ORG:\n", "return redirect(index_url)\n", "index_url = url_for('redash.index', org_slug=current_org.slug, _external=False)\n", "index_url = url_for(...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Assign'" ]
[ "def __init__(self, VAR_1: str):...\n", "assert VAR_1 == '-'\n", "self.type = 'stdin'\n", "self.sourceName = VAR_1\n", "self.content = None\n" ]
[ "def __init__(self, sourceName: str):...\n", "assert sourceName == '-'\n", "self.type = 'stdin'\n", "self.sourceName = sourceName\n", "self.content = None\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Assign'", "Assign'", "Assign'" ]
[ "async def FUNC_6(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'{self.user}/{self.repo}/{self.resolved_ref}'\n" ]
[ "async def get_resolved_spec(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'{self.user}/{self.repo}/{self.resolved_ref}'\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Return'" ]
[ "@VAR_0.route('/login', methods=['GET', 'POST'])...\n", "\"\"\"docstring\"\"\"\n", "if current_user.is_authenticated:\n", "return redirect(url_for('dashboard'))\n", "if request.method == 'POST':\n", "VAR_85 = request.form.get('username')\n", "VAR_43 = CLASS_0.query.all()\n", "VAR_41 = request.form.get...
[ "@gui.route('/login', methods=['GET', 'POST'])...\n", "\"\"\"docstring\"\"\"\n", "if current_user.is_authenticated:\n", "return redirect(url_for('dashboard'))\n", "if request.method == 'POST':\n", "username = request.form.get('username')\n", "users = User.query.all()\n", "password = request.form.get('...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_4(self):...\n", "if self._client_transport:\n", "self._client_transport = None\n", "if self._server_transport:\n", "self.client.close()\n", "self._server_transport = None\n", "self.server.close()\n" ]
[ "def disconnect(self):...\n", "if self._client_transport:\n", "self._client_transport = None\n", "if self._server_transport:\n", "self.client.close()\n", "self._server_transport = None\n", "self.server.close()\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Expr'" ]
[ "from __future__ import unicode_literals\n", "from datetime import datetime, timedelta\n", "from unittest import TestCase\n", "from django import forms\n", "from django.conf import settings\n", "from django.contrib import admin\n", "from django.contrib.admin import widgets\n", "from django.contrib.adm...
[ "from __future__ import unicode_literals\n", "from datetime import datetime, timedelta\n", "from unittest import TestCase\n", "from django import forms\n", "from django.conf import settings\n", "from django.contrib import admin\n", "from django.contrib.admin import widgets\n", "from django.contrib.adm...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'",...
[ "def FUNC_4(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = 'remote.server'\n", "VAR_14 = signedjson.key.generate_signing_key('ver1')\n", "self.expect_outgoing_key_request(VAR_13, VAR_14)\n", "VAR_12 = self.make_notary_request(VAR_13, 'ed25519:ver1')\n", "VAR_15 = VAR_12['server_keys']\n", "self.as...
[ "def test_get_key(self):...\n", "\"\"\"docstring\"\"\"\n", "SERVER_NAME = 'remote.server'\n", "testkey = signedjson.key.generate_signing_key('ver1')\n", "self.expect_outgoing_key_request(SERVER_NAME, testkey)\n", "resp = self.make_notary_request(SERVER_NAME, 'ed25519:ver1')\n", "keys = resp['server_keys...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_5, VAR_4, *VAR_6, **VAR_7):...\n", "super().__init__(*VAR_6, **kwargs)\n", "self.translation = VAR_5\n", "self.fields['variant'].queryset = VAR_5.unit_set.all()\n", "self.user = VAR_4\n" ]
[ "def __init__(self, translation, user, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n", "self.translation = translation\n", "self.fields['variant'].queryset = translation.unit_set.all()\n", "self.user = user\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_1(VAR_2):...\n", "return CLASS_0(VAR_2, VAR_3)\n" ]
[ "def cache_filter(app):...\n", "return MemcacheMiddleware(app, conf)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_30(self, *VAR_13, **VAR_14):...\n", "if self.directory is None:\n", "return\n", "return super(CLASS_2, self).get(*VAR_13, **kwargs)\n" ]
[ "def get(self, *args, **kwargs):...\n", "if self.directory is None:\n", "return\n", "return super(SafeFileCache, self).get(*args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_11(self):...\n", "super().after_script_executed()\n", "VAR_36, VAR_34 = tempfile.mkstemp(dir=self.temp_dir(), prefix=self.key)\n", "VAR_37 = self.file_path\n", "self.file_path = VAR_34\n", "VAR_0.info(f'Zipping {self.key} to {VAR_34}')\n", "self.file_path = shutil.make_archive(self.file_path, ...
[ "def after_script_executed(self):...\n", "super().after_script_executed()\n", "fd, filename = tempfile.mkstemp(dir=self.temp_dir(), prefix=self.key)\n", "folder_path = self.file_path\n", "self.file_path = filename\n", "logger.info(f'Zipping {self.key} to {filename}')\n", "self.file_path = shutil.make_ar...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'" ]
[ "async def FUNC_9(self, VAR_4: str, VAR_6: str, VAR_7: str, VAR_18: str...\n", "\"\"\"docstring\"\"\"\n", "VAR_49 = {'client_secret': VAR_6, 'sid': VAR_7, 'token': VAR_18}\n", "return await self.http_client.post_json_get_json(VAR_4 +\n '/_matrix/identity/api/v1/validate/msisdn/submitToken', VAR_49)\n", "...
[ "async def proxy_msisdn_submit_token(self, id_server: str, client_secret:...\n", "\"\"\"docstring\"\"\"\n", "body = {'client_secret': client_secret, 'sid': sid, 'token': token}\n", "return await self.http_client.post_json_get_json(id_server +\n '/_matrix/identity/api/v1/validate/msisdn/submitToken', body)\...
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_58(self):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.model.delete_doc import check_if_doc_is_linked, check_if_doc_is_dynamically_linked\n", "if not self.flags.ignore_links:\n", "check_if_doc_is_linked(self, VAR_25='Cancel')\n", "check_if_doc_is_dynamically_linked(self, VAR_25='Cancel')\n" ]
[ "def check_no_back_links_exist(self):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.model.delete_doc import check_if_doc_is_linked, check_if_doc_is_dynamically_linked\n", "if not self.flags.ignore_links:\n", "check_if_doc_is_linked(self, method='Cancel')\n", "check_if_doc_is_dynamically_linked(self, meth...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_48(self):...\n", "VAR_86 = {'transcodingenabled': cherry.config['media.transcode'],\n 'fetchalbumart': cherry.config['media.fetch_album_art'], 'isadmin':\n VAR_53.session['admin'], 'username': VAR_53.session['username'],\n 'servepath': 'serve/', 'transcodepath': 'trans/', 'auto_login': self.\n ...
[ "def api_getconfiguration(self):...\n", "clientconfigkeys = {'transcodingenabled': cherry.config['media.transcode'],\n 'fetchalbumart': cherry.config['media.fetch_album_art'], 'isadmin':\n cherrypy.session['admin'], 'username': cherrypy.session['username'],\n 'servepath': 'serve/', 'transcodepath': 'tran...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_11(VAR_11: str) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "VAR_23 = g.ledger.fava_options.collapse_pattern\n", "return any(pattern.match(VAR_11) for pattern in VAR_23)\n" ]
[ "def collapse_account(account_name: str) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "collapse_patterns = g.ledger.fava_options.collapse_pattern\n", "return any(pattern.match(account_name) for pattern in collapse_patterns)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "async def FUNC_8(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'https://{self.hostname}/{self.user}/{self.gist_id}/{self.resolved_ref}'\n" ]
[ "async def get_resolved_ref_url(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'https://{self.hostname}/{self.user}/{self.gist_id}/{self.resolved_ref}'\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Return'" ]
[ "from builtins import next\n", "from builtins import range\n", "import os\n", "import datetime\n", "from xml.sax.saxutils import quoteattr\n", "import sys\n", "import logging\n", "import random\n", "import glob\n", "from itertools import cycle\n", "from flask import Blueprint, url_for, Response,...
[ "from builtins import next\n", "from builtins import range\n", "import os\n", "import datetime\n", "from xml.sax.saxutils import quoteattr\n", "import sys\n", "import logging\n", "import random\n", "import glob\n", "from itertools import cycle\n", "from flask import Blueprint, url_for, Response,...
[ 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "Import'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "As...
[ "def FUNC_35(self, VAR_6, VAR_7, VAR_30):...\n", "if VAR_53.session['admin']:\n", "if self.userdb.addUser(VAR_6, VAR_7, VAR_30):\n", "return \"You didn't think that would work, did you?\"\n", "return 'added new user: %s' % VAR_6\n", "return 'error, cannot add new user!' % VAR_6\n" ]
[ "def api_adduser(self, username, password, isadmin):...\n", "if cherrypy.session['admin']:\n", "if self.userdb.addUser(username, password, isadmin):\n", "return \"You didn't think that would work, did you?\"\n", "return 'added new user: %s' % username\n", "return 'error, cannot add new user!' % username\n...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "Return'", "Return'" ]
[ "def FUNC_3(self):...\n", "VAR_6 = Mock()\n", "VAR_3 = '@foo:bar'\n", "VAR_7 = 5000000\n", "VAR_8 = UserPresenceState.default(VAR_3)\n", "VAR_8 = VAR_8.copy_and_replace(VAR_10=PresenceState.ONLINE, last_active_ts=\n now - LAST_ACTIVE_GRANULARITY - 1, currently_active=True)\n", "VAR_9 = VAR_8.copy_and...
[ "def test_online_to_online_last_active(self):...\n", "wheel_timer = Mock()\n", "user_id = '@foo:bar'\n", "now = 5000000\n", "prev_state = UserPresenceState.default(user_id)\n", "prev_state = prev_state.copy_and_replace(state=PresenceState.ONLINE,\n last_active_ts=now - LAST_ACTIVE_GRANULARITY - 1, curr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = VAR_2.session['connector'].server_id\n", "VAR_66 = omero.sys.Parameters()\n", "VAR_66.map = {'id': rlong(VAR_14)}\n", "VAR_65 = VAR_8.getQueryService().findByQuery(\n 'select s from Shape s join fetch s.roi where s.id = :id', VAR_66,\n V...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "server_id = request.session['connector'].server_id\n", "params = omero.sys.Parameters()\n", "params.map = {'id': rlong(shapeId)}\n", "shape = conn.getQueryService().findByQuery(\n 'select s from Shape s join fetch s.roi where s.id = :id', params, co...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "@VAR_0.route('/dl/<dl_type>/<path:filename>')...\n", "\"\"\"docstring\"\"\"\n", "if VAR_11 == 'log':\n", "return send_from_directory(LOG_PATH, VAR_3, as_attachment=True)\n", "return '', 204\n" ]
[ "@blueprint.route('/dl/<dl_type>/<path:filename>')...\n", "\"\"\"docstring\"\"\"\n", "if dl_type == 'log':\n", "return send_from_directory(LOG_PATH, filename, as_attachment=True)\n", "return '', 204\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Return'" ]
[ "def FUNC_4(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_83(VAR_9, *VAR_2, **VAR_3):...\n", "if GlobalStaff().has_user(VAR_9.user):\n", "return VAR_1(VAR_9, *VAR_2, **kwargs)\n", "return HttpResponseForbidden(\n u'Must be {platform_name} staff to perform this action.'.format(\n platform_name=...
[ "def require_global_staff(func):...\n", "\"\"\"docstring\"\"\"\n", "def wrapped(request, *args, **kwargs):...\n", "if GlobalStaff().has_user(request.user):\n", "return func(request, *args, **kwargs)\n", "return HttpResponseForbidden(\n u'Must be {platform_name} staff to perform this action.'.format(\n ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "@FUNC_0...\n", "if self.config.worker_app:\n", "return RoomMemberWorkerHandler(self)\n", "return RoomMemberMasterHandler(self)\n" ]
[ "@cache_in_self...\n", "if self.config.worker_app:\n", "return RoomMemberWorkerHandler(self)\n", "return RoomMemberMasterHandler(self)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "async def FUNC_15(self, VAR_5, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = VAR_6\n", "VAR_0.debug('on_send_join_request from %s: Got event: %s, signatures: %s',\n VAR_5, VAR_1.event_id, VAR_1.signatures)\n", "if get_domain_from_id(VAR_1.sender) != VAR_5:\n", "VAR_0.info('Got /send_join request ...
[ "async def on_send_join_request(self, origin, pdu):...\n", "\"\"\"docstring\"\"\"\n", "event = pdu\n", "logger.debug('on_send_join_request from %s: Got event: %s, signatures: %s',\n origin, event.event_id, event.signatures)\n", "if get_domain_from_id(event.sender) != origin:\n", "logger.info('Got /send...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_17(self, VAR_16):...\n", "if not VAR_53.session['admin']:\n", "FUNC_0()\n", "VAR_64 = albumartfetcher.AlbumArtFetcher()\n", "VAR_65 = VAR_64.fetchurls(VAR_16)\n", "return VAR_65[:min(len(VAR_65), 10)]\n" ]
[ "def api_fetchalbumarturls(self, searchterm):...\n", "if not cherrypy.session['admin']:\n", "_save_and_release_session()\n", "fetcher = albumartfetcher.AlbumArtFetcher()\n", "imgurls = fetcher.fetchurls(searchterm)\n", "return imgurls[:min(len(imgurls), 10)]\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_101(VAR_6):...\n", "return '<b>{0}</b>'.format(VAR_6)\n" ]
[ "def bold(text):...\n", "return '<b>{0}</b>'.format(text)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_11(VAR_18, VAR_19):...\n", "VAR_48 = []\n", "VAR_49 = []\n", "if VAR_19 == 'input':\n", "for cls in VAR_18:\n", "for cls in VAR_18:\n", "VAR_92 = inspect.getdoc(cls.preprocess)\n", "return VAR_48, VAR_49\n", "VAR_92 = inspect.getdoc(cls.postprocess)\n", "VAR_93 = VAR_92.split('\\n')\n", ...
[ "def get_types(cls_set, component):...\n", "docset = []\n", "types = []\n", "if component == 'input':\n", "for cls in cls_set:\n", "for cls in cls_set:\n", "doc = inspect.getdoc(cls.preprocess)\n", "return docset, types\n", "doc = inspect.getdoc(cls.postprocess)\n", "doc_lines = doc.split('\\n')\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "For", "For", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_43(self, VAR_124, VAR_132):...\n", "\"\"\"docstring\"\"\"\n", "VAR_222 = self._get_login_settings()\n", "VAR_141 = VAR_222.table_user(**{settings.userfield: username})\n", "if VAR_141 and VAR_141.get(VAR_222.passfield, False):\n", "VAR_132 = VAR_222.table_user[VAR_222.passfield].validate(VAR_132...
[ "def login_bare(self, username, password):...\n", "\"\"\"docstring\"\"\"\n", "settings = self._get_login_settings()\n", "user = settings.table_user(**{settings.userfield: username})\n", "if user and user.get(settings.passfield, False):\n", "password = settings.table_user[settings.passfield].validate(passw...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "For", "Condition", "Condition", "Return'", "Expr'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_30(VAR_91):...\n", "" ]
[ "def get_domain_data(module):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_159(VAR_82):...\n", "VAR_366 = to_native(TAG['cas:serviceResponse'](VAR_82, **{'_xmlns:cas':\n 'http://www.yale.edu/tp/cas'}).xml())\n", "return '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' + VAR_366\n" ]
[ "def build_response(body):...\n", "xml_body = to_native(TAG['cas:serviceResponse'](body, **{'_xmlns:cas':\n 'http://www.yale.edu/tp/cas'}).xml())\n", "return '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' + xml_body\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def __ne__(self, VAR_8) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "return not self == VAR_8\n" ]
[ "def __ne__(self, other) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "return not self == other\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_37():...\n", "if callable(VAR_63):\n", "VAR_33 = FUNC_21()\n", "VAR_33 = VAR_63()\n", "VAR_0.exception('Error while trying to retrieve tracked files for plugin {}'\n .format(VAR_8))\n", "VAR_33 += FUNC_22()\n", "if VAR_33:\n", "VAR_33 += FUNC_23(g.locale.language if g.locale else 'en', 'm...
[ "def collect_files():...\n", "if callable(custom_files):\n", "files = _get_all_templates()\n", "files = custom_files()\n", "_logger.exception('Error while trying to retrieve tracked files for plugin {}'\n .format(key))\n", "files += _get_all_assets()\n", "if files:\n", "files += _get_all_translatio...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Expr'", "AugAssign'", "Condition", "AugAssign'", "Return'", "Condition", "Return'", "Assign'", "Expr'", "Condition", "AugAssign'" ]
[ "def FUNC_7(VAR_0, VAR_5, VAR_6, VAR_3=False):...\n", "VAR_15 = current_user.kobo_only_shelves_sync\n", "if request.method == 'POST':\n", "VAR_20 = request.form.to_dict()\n", "return render_title_template('shelf_edit.html', VAR_0=shelf, VAR_7=\n page_title, VAR_6=page, kobo_sync_enabled=config.config_kob...
[ "def create_edit_shelf(shelf, page_title, page, shelf_id=False):...\n", "sync_only_selected_shelves = current_user.kobo_only_shelves_sync\n", "if request.method == 'POST':\n", "to_save = request.form.to_dict()\n", "return render_title_template('shelf_edit.html', shelf=shelf, title=\n page_title, page=pag...
[ 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "Return'", "Condition", "Expr'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", ...
[ "@VAR_1.route('/register', methods=['POST'])...\n", "VAR_6 = request.form['vId']\n", "if VAR_6 == '':\n", "VAR_6 = utils.generateToken(5)\n", "VAR_7 = victim(VAR_6, request.environ['REMOTE_ADDR'], request.user_agent.\n platform, request.user_agent.browser, request.user_agent.version, utils\n .portScan...
[ "@app.route('/register', methods=['POST'])...\n", "vId = request.form['vId']\n", "if vId == '':\n", "vId = utils.generateToken(5)\n", "victimConnect = victim(vId, request.environ['REMOTE_ADDR'], request.\n user_agent.platform, request.user_agent.browser, request.user_agent.\n version, utils.portScanne...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_8() ->Any:...\n", "\"\"\"docstring\"\"\"\n", "return get_translations()._catalog\n" ]
[ "def translations() ->Any:...\n", "\"\"\"docstring\"\"\"\n", "return get_translations()._catalog\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __init__(self, *VAR_17, **VAR_18):...\n", "super().__init__(*VAR_17, **kwargs)\n", "self.quoted_namespace, VAR_10 = self.spec.split('/', 1)\n", "self.namespace = urllib.parse.unquote(self.quoted_namespace)\n", "self.unresolved_ref = urllib.parse.unquote(VAR_10)\n", "if not self.unresolved_ref:\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n", "self.quoted_namespace, unresolved_ref = self.spec.split('/', 1)\n", "self.namespace = urllib.parse.unquote(self.quoted_namespace)\n", "self.unresolved_ref = urllib.parse.unquote(unresolved_ref)\n", "if not self.unresolved...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition" ]
[ "def FUNC_12(VAR_16, VAR_18, VAR_19, VAR_15):...\n", "if VAR_16:\n", "if VAR_18:\n", "if VAR_18:\n", "return json.dumps([VAR_19, {'location': url_for('editbook.edit_book',\n VAR_15=book_id), 'type': 'success', 'format': VAR_16, 'message': _(\n 'Book Format Successfully Deleted')}])\n", "flash(_('Boo...
[ "def render_delete_book_result(book_format, jsonResponse, warning, book_id):...\n", "if book_format:\n", "if jsonResponse:\n", "if jsonResponse:\n", "return json.dumps([warning, {'location': url_for('editbook.edit_book',\n book_id=book_id), 'type': 'success', 'format': book_format, 'message':\n _('Boo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Condition", "Return'", "Expr'", "Return'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_63():...\n", "VAR_81 = 1024 * 20\n", "while True:\n", "VAR_3.sleep(0.01)\n", "if VAR_0.config['FD']:\n", "VAR_127 = 0\n", "VAR_128, VAR_129, VAR_129 = select.select([VAR_0.config['FD']], [], [], VAR_127\n )\n", "if VAR_128:\n", "VAR_131 = os.read(VAR_0.config['FD'], VAR_81).decode()\n",...
[ "def read_and_forward_pty_output():...\n", "max_read_bytes = 1024 * 20\n", "while True:\n", "socketio.sleep(0.01)\n", "if gui.config['FD']:\n", "timeout_sec = 0\n", "data_ready, _, _ = select.select([gui.config['FD']], [], [], timeout_sec)\n", "if data_ready:\n", "output = os.read(gui.config['FD'], ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "@app.route('/')...\n", "VAR_7 = request.args.get('path', '').lstrip('/')\n", "VAR_26 = data.get_items(VAR_7=path)\n", "flash('Directory does not exist.', 'error')\n", "return render_template('home.html', title=path or 'root', search_enabled=\n app.config['SEARCH_CONF']['enabled'], dir=files, current_pat...
[ "@app.route('/')...\n", "path = request.args.get('path', '').lstrip('/')\n", "files = data.get_items(path=path)\n", "flash('Directory does not exist.', 'error')\n", "return render_template('home.html', title=path or 'root', search_enabled=\n app.config['SEARCH_CONF']['enabled'], dir=files, current_path=p...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_30(self):...\n", "VAR_32 = '/rooms/%s/send/m.room.message/mid1' % urlparse.quote(self.room_id)\n", "VAR_19 = b'{\"body\":\"test\",\"msgtype\":{\"type\":\"a\"}}'\n", "VAR_22, VAR_23 = self.make_request('PUT', VAR_32, VAR_19)\n", "self.assertEquals(400, VAR_23.code, msg=channel.result['body'])\n", ...
[ "def test_rooms_messages_sent(self):...\n", "path = '/rooms/%s/send/m.room.message/mid1' % urlparse.quote(self.room_id)\n", "content = b'{\"body\":\"test\",\"msgtype\":{\"type\":\"a\"}}'\n", "request, channel = self.make_request('PUT', path, content)\n", "self.assertEquals(400, channel.code, msg=channel.res...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "async def FUNC_6(self, VAR_4: str, VAR_15: str, VAR_6: str, VAR_12: int,...\n", "\"\"\"docstring\"\"\"\n", "VAR_45 = {'email': VAR_15, 'client_secret': VAR_6, 'send_attempt': VAR_12}\n", "if VAR_14:\n", "VAR_45['next_link'] = VAR_14\n", "if self.hs.config.using_identity_server_from_trusted_list:\n", "V...
[ "async def requestEmailToken(self, id_server: str, email: str, client_secret:...\n", "\"\"\"docstring\"\"\"\n", "params = {'email': email, 'client_secret': client_secret, 'send_attempt':\n send_attempt}\n", "if next_link:\n", "params['next_link'] = next_link\n", "if self.hs.config.using_identity_server...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_6(self, VAR_16, VAR_15):...\n", "if VAR_16.direction != 'rtl':\n", "return ''\n", "VAR_103 = f'rtl-{VAR_15}'\n", "VAR_104 = [VAR_1.format('direction-toggle active', gettext(\n 'Toggle text direction'), VAR_103, 'rtl', 'checked=\"checked\"', 'RTL'),\n VAR_1.format('direction-toggle', gettext(...
[ "def get_rtl_toggle(self, language, fieldname):...\n", "if language.direction != 'rtl':\n", "return ''\n", "rtl_name = f'rtl-{fieldname}'\n", "rtl_switch = [RADIO_TEMPLATE.format('direction-toggle active', gettext(\n 'Toggle text direction'), rtl_name, 'rtl', 'checked=\"checked\"', 'RTL'),\n RADIO_TEM...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_131 = VAR_8.getObject('Project', VAR_32)\n", "if VAR_131 is None:\n", "return HttpJavascriptResponse('[]')\n", "return [VAR_30.simpleMarshal(VAR_121={'childCount': 0}) for VAR_30 in\n VAR_131.listChildren()]\n" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "project = conn.getObject('Project', pid)\n", "if project is None:\n", "return HttpJavascriptResponse('[]')\n", "return [x.simpleMarshal(xtra={'childCount': 0}) for x in project.listChildren()\n ]\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_0():...\n", "assert utils.snake_case('HTTP') == 'http'\n", "assert utils.snake_case('HTTP RESPONSE') == 'http_response'\n" ]
[ "def test_snake_case_uppercase_str():...\n", "assert utils.snake_case('HTTP') == 'http'\n", "assert utils.snake_case('HTTP RESPONSE') == 'http_response'\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Assert'" ]
[ "def FUNC_16(self):...\n", "\"\"\"docstring\"\"\"\n", "self._set_canonical_alias({'alias': self.test_alias, 'alt_aliases': [self.\n test_alias]})\n", "VAR_14 = self._get_canonical_alias()\n", "self.assertEqual(VAR_14['content']['alias'], self.test_alias)\n", "self.assertEqual(VAR_14['content']['alt_ali...
[ "def test_remove_alias(self):...\n", "\"\"\"docstring\"\"\"\n", "self._set_canonical_alias({'alias': self.test_alias, 'alt_aliases': [self.\n test_alias]})\n", "data = self._get_canonical_alias()\n", "self.assertEqual(data['content']['alias'], self.test_alias)\n", "self.assertEqual(data['content']['alt...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_14(VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "VAR_39 = {}\n", "for input_raw in filter(bool, VAR_17.split(';')):\n", "if '=' not in VAR_17:\n", "return VAR_39\n", "VAR_68, VAR_69 = input_raw.split('=', 1)\n", "VAR_39[VAR_68] = eval(VAR_69)\n" ]
[ "def preprocess_input_exprs_arg_string(input_exprs_str):...\n", "\"\"\"docstring\"\"\"\n", "input_dict = {}\n", "for input_raw in filter(bool, input_exprs_str.split(';')):\n", "if '=' not in input_exprs_str:\n", "return input_dict\n", "input_key, expr = input_raw.split('=', 1)\n", "input_dict[input_ke...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_48(self, VAR_112, VAR_139):...\n", "\"\"\"docstring\"\"\"\n", "if self.is_logged_in():\n", "if VAR_112 == VAR_139._auth_next:\n", "redirect(VAR_112, client_side=self.settings.client_side)\n" ]
[ "def when_is_logged_in_bypass_next_in_url(self, next, session):...\n", "\"\"\"docstring\"\"\"\n", "if self.is_logged_in():\n", "if next == session._auth_next:\n", "redirect(next, client_side=self.settings.client_side)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Expr'" ]
[ "@VAR_2.route('/ajax/bookmark/<int:book_id>/<book_format>', methods=['POST'])...\n", "VAR_52 = request.form['bookmark']\n", "ub.session.query(ub.Bookmark).filter(and_(ub.Bookmark.user_id == int(VAR_87\n .id), ub.Bookmark.book_id == VAR_5, ub.Bookmark.format == VAR_6)).delete()\n", "if not VAR_52:\n", "ub...
[ "@web.route('/ajax/bookmark/<int:book_id>/<book_format>', methods=['POST'])...\n", "bookmark_key = request.form['bookmark']\n", "ub.session.query(ub.Bookmark).filter(and_(ub.Bookmark.user_id == int(\n current_user.id), ub.Bookmark.book_id == book_id, ub.Bookmark.format ==\n book_format)).delete()\n", "i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "For", "Assign'", "Expr'", "Condition", "Expr'", "Assign'", "Return'", "Expr'", "Expr'", "Return'" ]
[ "@VAR_0.filter...\n", "\"\"\"docstring\"\"\"\n", "if len(VAR_32) > 160 and ',' in VAR_32:\n", "VAR_32 = mark_safe('<br> ' + ', <br>'.join(VAR_32.split(',')))\n", "return VAR_32\n" ]
[ "@register.filter...\n", "\"\"\"docstring\"\"\"\n", "if len(header) > 160 and ',' in header:\n", "header = mark_safe('<br> ' + ', <br>'.join(header.split(',')))\n", "return header\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Return'" ]
[ "def FUNC_2(self, VAR_23):...\n", "assert isinstance(VAR_23, text_type)\n", "if self.encoding:\n", "return VAR_23.encode(self.encoding, VAR_3)\n", "return VAR_23\n" ]
[ "def encode(self, string):...\n", "assert isinstance(string, text_type)\n", "if self.encoding:\n", "return string.encode(self.encoding, unicode_encode_errors)\n", "return string\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Condition", "Return'", "Return'" ]
[ "def FUNC_7(VAR_12, VAR_1):...\n", "" ]
[ "def migrate_registration_table(engine, session):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_3(VAR_3):...\n", "if VAR_25.session['user'] == 'Guest':\n", "if VAR_3 not in VAR_25.guest_methods:\n", "if not VAR_3 in VAR_25.whitelisted:\n", "VAR_25.throw(_('Not permitted'), VAR_25.PermissionError)\n", "if VAR_3 not in VAR_25.xss_safe_methods:\n", "VAR_25.throw(_('Not permitted'), VAR_25.P...
[ "def is_whitelisted(method):...\n", "if frappe.session['user'] == 'Guest':\n", "if method not in frappe.guest_methods:\n", "if not method in frappe.whitelisted:\n", "frappe.throw(_('Not permitted'), frappe.PermissionError)\n", "if method not in frappe.xss_safe_methods:\n", "frappe.throw(_('Not permitted...
[ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
[ "FunctionDef'", "Condition", "Condition", "Condition", "Expr'", "Condition", "Expr'", "For", "Condition", "Assign'" ]
[ "@FUNC_0...\n", "return FederationServer(self)\n" ]
[ "@cache_in_self...\n", "return FederationServer(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_49(VAR_21, VAR_22, VAR_23):...\n", "if VAR_87.filter_language() != 'all':\n", "VAR_21 = VAR_21.filter(db.Books.languages.any(db.Languages.lang_code ==\n VAR_87.filter_language()))\n", "for language in VAR_22:\n", "return VAR_21\n", "VAR_21 = VAR_21.filter(db.Books.languages.any(db.Languages.i...
[ "def adv_search_language(q, include_languages_inputs, exclude_languages_inputs):...\n", "if current_user.filter_language() != 'all':\n", "q = q.filter(db.Books.languages.any(db.Languages.lang_code == current_user.\n filter_language()))\n", "for language in include_languages_inputs:\n", "return q\n", "q...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "For", "Return'", "Assign'", "For", "Assign'" ]
[ "def FUNC_158(VAR_7, VAR_135=VAR_135):...\n", "if VAR_135 is not VAR_3:\n", "VAR_135(VAR_7)\n", "return FUNC_157(VAR_262=True)\n" ]
[ "def cas_onaccept(form, onaccept=onaccept):...\n", "if onaccept is not DEFAULT:\n", "onaccept(form)\n", "return allow_access(interactivelogin=True)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'" ]
[ "@VAR_1.route('/get_preview', methods=['POST'])...\n", "VAR_10 = request.form['vId']\n", "VAR_4 = VAR_2.sentences_stats('get_preview', VAR_10)\n", "VAR_5 = VAR_2.sentences_stats('id_networks', VAR_10)\n", "return json.dumps({'status': 'OK', 'vId': VAR_10, 'd': VAR_4, 'n': VAR_5})\n" ]
[ "@app.route('/get_preview', methods=['POST'])...\n", "vId = request.form['vId']\n", "d = db.sentences_stats('get_preview', vId)\n", "n = db.sentences_stats('id_networks', vId)\n", "return json.dumps({'status': 'OK', 'vId': vId, 'd': d, 'n': n})\n" ]
[ 0, 0, 2, 2, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_7(VAR_2, VAR_8=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_8 is None:\n", "VAR_8 = VAR_2.GET.get('active_group')\n", "VAR_8 = int(VAR_8)\n", "if 'active_group' not in VAR_2.session or VAR_8 != VAR_2.session['active_group'\n", "VAR_2.session.modified = True\n", "VAR_2.session['active_gro...
[ "def switch_active_group(request, active_group=None):...\n", "\"\"\"docstring\"\"\"\n", "if active_group is None:\n", "active_group = request.GET.get('active_group')\n", "active_group = int(active_group)\n", "if 'active_group' not in request.session or active_group != request.session[\n", "request.sessi...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_23(VAR_22):...\n", "\"\"\"docstring\"\"\"\n", "VAR_50 = VAR_22.checkpoint_path or os.path.join(VAR_22.dir,\n 'variables/variables')\n", "if not VAR_22.variables_to_feed:\n", "VAR_78 = []\n", "if VAR_22.variables_to_feed.lower() == 'all':\n", "saved_model_aot_compile.aot_compile_cpu_meta_gra...
[ "def aot_compile_cpu(args):...\n", "\"\"\"docstring\"\"\"\n", "checkpoint_path = args.checkpoint_path or os.path.join(args.dir,\n 'variables/variables')\n", "if not args.variables_to_feed:\n", "variables_to_feed = []\n", "if args.variables_to_feed.lower() == 'all':\n", "saved_model_aot_compile.aot_co...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_39(self):...\n", "if self.flags.ignore_mandatory:\n", "return\n", "VAR_62 = self._get_missing_mandatory_fields()\n", "for VAR_21 in self.get_all_children():\n", "VAR_62.extend(VAR_21._get_missing_mandatory_fields())\n", "if not VAR_62:\n", "return\n", "for VAR_18, VAR_87 in VAR_62:\n", "...
[ "def _validate_mandatory(self):...\n", "if self.flags.ignore_mandatory:\n", "return\n", "missing = self._get_missing_mandatory_fields()\n", "for d in self.get_all_children():\n", "missing.extend(d._get_missing_mandatory_fields())\n", "if not missing:\n", "return\n", "for fieldname, msg in missing:\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "For", "Expr'", "Condition", "Return'", "For", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_12(self):...\n", "VAR_9, VAR_15 = self.make_request('GET', '/profile/%s/displayname' % (self.\n owner,))\n", "self.assertEqual(VAR_15.code, 200, VAR_15.result)\n", "return VAR_15.json_body['displayname']\n" ]
[ "def get_displayname(self):...\n", "request, channel = self.make_request('GET', '/profile/%s/displayname' % (\n self.owner,))\n", "self.assertEqual(channel.code, 200, channel.result)\n", "return channel.json_body['displayname']\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(self, VAR_15=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = [self.shutting_down]\n", "if VAR_15 is not None:\n", "VAR_28.append(VAR_15.destroyed)\n", "if self._tab_id is not None:\n", "assert self._win_id is not None\n", "return VAR_28\n", "VAR_37 = objreg.get('tab', scope='tab', win...
[ "def _get_abort_signals(self, owner=None):...\n", "\"\"\"docstring\"\"\"\n", "abort_on = [self.shutting_down]\n", "if owner is not None:\n", "abort_on.append(owner.destroyed)\n", "if self._tab_id is not None:\n", "assert self._win_id is not None\n", "return abort_on\n", "tab = objreg.get('tab', scop...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Condition", "Assert'", "Return'", "Assign'", "Expr'" ]
[ "async def FUNC_11(self, VAR_15, VAR_16, VAR_17):...\n", "VAR_25 = await self._build_notification_dict(VAR_15, VAR_16, VAR_17)\n", "if not VAR_25:\n", "return []\n", "VAR_26 = await self.http_client.post_json_get_json(self.url, VAR_25)\n", "VAR_0.warning('Failed to push event %s to %s: %s %s', VAR_15.even...
[ "async def dispatch_push(self, event, tweaks, badge):...\n", "notification_dict = await self._build_notification_dict(event, tweaks, badge)\n", "if not notification_dict:\n", "return []\n", "resp = await self.http_client.post_json_get_json(self.url, notification_dict)\n", "logger.warning('Failed to push e...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "Assign'", "Return'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_5(self, VAR_5) ->CLASS_3:...\n", "return CLASS_3(urllib.parse.urljoin(self.sourceName, VAR_5))\n" ]
[ "def relative(self, relativePath) ->UrlInputSource:...\n", "return UrlInputSource(urllib.parse.urljoin(self.sourceName, relativePath))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_23(VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "VAR_47 = 'string'\n", "VAR_48 = VAR_21.add_parser('show', description=show_msg, formatter_class=\n argparse.RawTextHelpFormatter)\n", "VAR_48.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to inspect'...
[ "def add_show_subparser(subparsers):...\n", "\"\"\"docstring\"\"\"\n", "show_msg = \"\"\"Usage examples:\nTo show all tag-sets in a SavedModel:\n$saved_model_cli show --dir /tmp/saved_model\n\nTo show all available SignatureDef keys in a MetaGraphDef specified by its tag-set:\n$saved_model_cli show --dir /tmp/s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = 'this is an example of a string'\n", "self.assertEqual(format_value(VAR_14), VAR_14)\n" ]
[ "def test_format_value_simple_string(self):...\n", "\"\"\"docstring\"\"\"\n", "simple_string = 'this is an example of a string'\n", "self.assertEqual(format_value(simple_string), simple_string)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]