lines listlengths 1 383 | raw_lines listlengths 1 383 | label listlengths 1 383 | type listlengths 1 383 |
|---|---|---|---|
[
"def FUNC_15(VAR_3, **VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"self.fail(\"shouldn't ever get here\")\n"
] | [
"def _callback(request, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"self.fail(\"shouldn't ever get here\")\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"@VAR_0.route('/ajax/getcustomenum/<int:c_id>')...\n",
"VAR_80 = list()\n",
"VAR_32 = calibre_db.session.query(db.Custom_Columns).filter(db.\n Custom_Columns.id == VAR_43).filter(db.Custom_Columns.datatype.notin_(\n db.cc_exceptions)).one_or_none()\n",
"VAR_80.append({'value': '', 'text': ''})\n",
"fo... | [
"@editbook.route('/ajax/getcustomenum/<int:c_id>')...\n",
"ret = list()\n",
"cc = calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns.\n id == c_id).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)\n ).one_or_none()\n",
"ret.append({'value': '', 'text': ''})\n",
"for idx, en... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Return'"
] |
[
"@login_required...\n",
"VAR_15 = Topic.objects.filter(VAR_7=request.user, category_id=settings.\n ST_TOPIC_PRIVATE_CATEGORY_PK).exclude(topics_private__user=request.user)\n",
"VAR_15 = yt_paginate(VAR_15, per_page=config.topics_per_page, page_number=\n request.GET.get('page', 1))\n",
"return render(VAR... | [
"@login_required...\n",
"topics = Topic.objects.filter(user=request.user, category_id=settings.\n ST_TOPIC_PRIVATE_CATEGORY_PK).exclude(topics_private__user=request.user)\n",
"topics = yt_paginate(topics, per_page=config.topics_per_page, page_number=\n request.GET.get('page', 1))\n",
"return render(requ... | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = self.client.post('/password_reset/', {'email':\n 'staffmember@example.com'})\n",
"self.assertEqual(VAR_3.status_code, 302)\n",
"self.assertEqual(len(mail.outbox), 1)\n",
"self.assertTrue('http://' in mail.outbox[0].body)\n",
"self.assertEq... | [
"def test_email_found(self):...\n",
"\"\"\"docstring\"\"\"\n",
"response = self.client.post('/password_reset/', {'email':\n 'staffmember@example.com'})\n",
"self.assertEqual(response.status_code, 302)\n",
"self.assertEqual(len(mail.outbox), 1)\n",
"self.assertTrue('http://' in mail.outbox[0].body)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_29(self):...\n",
""
] | [
"def about_us(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_64(VAR_122=False, VAR_123=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if getattr(VAR_19, 'in_install_db', True):\n",
"return []\n",
"if not VAR_12:\n",
"FUNC_5()\n",
"if not VAR_1.all_apps:\n",
"VAR_1.all_apps = FUNC_10().get_value('all_apps', FUNC_63)\n",
"VAR_190 = json.loads(VAR_12.get_g... | [
"def get_installed_apps(sort=False, frappe_last=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if getattr(flags, 'in_install_db', True):\n",
"return []\n",
"if not db:\n",
"connect()\n",
"if not local.all_apps:\n",
"local.all_apps = cache().get_value('all_apps', get_all_apps)\n",
"installed = json.loads... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Expr'"
] |
[
"@parameterized.named_parameters(('non_tfrt', False))...\n",
"self.parser = saved_model_cli.create_parser()\n",
"VAR_10 = test.test_src_dir_path(VAR_0)\n",
"VAR_42 = os.path.join(test.get_temp_dir(), 'new_dir')\n",
"VAR_11 = self.parser.parse_args(['run', '--dir', VAR_10, '--tag_set',\n 'serve', '--signa... | [
"@parameterized.named_parameters(('non_tfrt', False))...\n",
"self.parser = saved_model_cli.create_parser()\n",
"base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n",
"output_dir = os.path.join(test.get_temp_dir(), 'new_dir')\n",
"args = self.parser.parse_args(['run', '--dir', base_path, '--tag_set',\n ... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@def_function.function...\n",
"if VAR_55:\n",
"return VAR_53 + VAR_54\n",
"return VAR_53 * VAR_54\n"
] | [
"@def_function.function...\n",
"if c:\n",
"return a + b\n",
"return a * b\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"@VAR_1.route('/admin/book/convert/<int:book_id>', methods=['POST'])...\n",
"VAR_76 = VAR_32.form.get('book_format_from', None)\n",
"VAR_77 = VAR_32.form.get('book_format_to', None)\n",
"if VAR_76 is None or VAR_77 is None:\n",
"flash(_(u'Source or destination format for conversion missing'), category=\n ... | [
"@editbook.route('/admin/book/convert/<int:book_id>', methods=['POST'])...\n",
"book_format_from = request.form.get('book_format_from', None)\n",
"book_format_to = request.form.get('book_format_to', None)\n",
"if book_format_from is None or book_format_to is None:\n",
"flash(_(u'Source or destination format... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"self.set_doctype_roles()\n"
] | [
"def before_insert(self):...\n",
"self.set_doctype_roles()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_10(self, VAR_16, VAR_58):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.whitelist_tags is not None and VAR_16.tag not in self.whitelist_tags:\n",
"return False\n",
"VAR_77, VAR_78, VAR_79, VAR_80, VAR_81 = urlsplit(VAR_58)\n",
"VAR_78 = VAR_78.lower().split(':', 1)[0]\n",
"if VAR_77 not in ('http... | [
"def allow_embedded_url(self, el, url):...\n",
"\"\"\"docstring\"\"\"\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', '... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4):...\n",
"self.other_user_id = self.register_user('otheruser', 'pass')\n",
"self.other_access_token = self.login('otheruser', 'pass')\n"
] | [
"def prepare(self, reactor, clock, hs):...\n",
"self.other_user_id = self.register_user('otheruser', 'pass')\n",
"self.other_access_token = self.login('otheruser', 'pass')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_34(VAR_34):...\n",
"VAR_66 = \"'\" * isinstance(VAR_34, str)\n",
"return VAR_66 + str(VAR_34) + VAR_66\n"
] | [
"def _maybe_add_quotes(value):...\n",
"is_quotes = \"'\" * isinstance(value, str)\n",
"return is_quotes + str(value) + is_quotes\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_38(VAR_47):...\n",
"return VAR_47\n"
] | [
"def fake_wrapper_session(sess):...\n",
"return sess\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_93(self, VAR_177, VAR_178, VAR_179, VAR_180=False):...\n",
""
] | [
"def get_query(self, field, op, value, refsearch=False):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_33(self, VAR_39, VAR_3, VAR_36, VAR_37):...\n",
"VAR_39.cert_reqs = 'CERT_NONE'\n",
"VAR_39.ca_certs = None\n"
] | [
"def cert_verify(self, conn, url, verify, cert):...\n",
"conn.cert_reqs = 'CERT_NONE'\n",
"conn.ca_certs = None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, VAR_19, VAR_20, VAR_21):...\n",
"if not VAR_20.strip():\n",
"VAR_20 = 'nothing'\n",
"super().__init__(VAR_19, VAR_20, VAR_21, self._TRAVERSER)\n"
] | [
"def __init__(self, name, expr, engine):...\n",
"if not expr.strip():\n",
"expr = 'nothing'\n",
"super().__init__(name, expr, engine, self._TRAVERSER)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'"
] |
[
"@VAR_2.route('/logout')...\n",
"if VAR_87 is not None and VAR_87.is_authenticated:\n",
"ub.delete_user_session(VAR_87.id, VAR_91.get('_id', ''))\n",
"VAR_3.debug(u'User logged out')\n",
"logout_user()\n",
"return redirect(url_for('web.login'))\n",
"if VAR_0['oauth'] and (config.config_login_type == 2 o... | [
"@web.route('/logout')...\n",
"if current_user is not None and current_user.is_authenticated:\n",
"ub.delete_user_session(current_user.id, flask_session.get('_id', ''))\n",
"log.debug(u'User logged out')\n",
"logout_user()\n",
"return redirect(url_for('web.login'))\n",
"if feature_support['oauth'] and (... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = VAR_3.adjusted(QUrl.NormalizePathSegments | QUrl.StripTrailingSlash)\n",
"if VAR_14 != VAR_3:\n",
"VAR_15 = VAR_3.path()\n",
"VAR_16 = VAR_3.host()\n",
"VAR_17 = urlutils.query_string(VAR_3)\n",
"log.misc.debug('url: {}, path: {}, host {}... | [
"def data_for_url(url):...\n",
"\"\"\"docstring\"\"\"\n",
"norm_url = url.adjusted(QUrl.NormalizePathSegments | QUrl.StripTrailingSlash)\n",
"if norm_url != url:\n",
"path = url.path()\n",
"host = url.host()\n",
"query = urlutils.query_string(url)\n",
"log.misc.debug('url: {}, path: {}, host {}'.forma... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition"
... |
[
"def FUNC_13(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_39 = {}\n",
"VAR_40 = VAR_16.split(';')\n",
"for input_raw in filter(bool, VAR_40):\n",
"VAR_67 = re.match('([^=]+)=([^\\\\[\\\\]]+)\\\\[([^\\\\[\\\\]]+)\\\\]$', input_raw)\n",
"return VAR_39\n",
"if VAR_67:\n",
"VAR_39[VAR_67.group(1)] = ... | [
"def preprocess_inputs_arg_string(inputs_str):...\n",
"\"\"\"docstring\"\"\"\n",
"input_dict = {}\n",
"inputs_raw = inputs_str.split(';')\n",
"for input_raw in filter(bool, inputs_raw):\n",
"match = re.match('([^=]+)=([^\\\\[\\\\]]+)\\\\[([^\\\\[\\\\]]+)\\\\]$', input_raw)\n",
"return input_dict\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"@FUNC_0...\n",
"return DeviceMessageHandler(self)\n"
] | [
"@cache_in_self...\n",
"return DeviceMessageHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_25(VAR_14, VAR_16, VAR_19):...\n",
"VAR_32 = calibre_db.session.query(db.Custom_Columns).filter(db.\n Custom_Columns.datatype.notin_(db.cc_exceptions)).all()\n",
"return FUNC_26(VAR_14, VAR_16, VAR_19, VAR_32)\n"
] | [
"def edit_all_cc_data(book_id, book, to_save):...\n",
"cc = calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns.\n datatype.notin_(db.cc_exceptions)).all()\n",
"return edit_cc_data(book_id, book, to_save, cc)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@VAR_8.route('/enable_sharing/<path:path>', methods=['GET'])...\n",
"if VAR_17 == 'None':\n",
"VAR_17 = None\n",
"VAR_8.interface.config['share_url'] = VAR_17\n",
"return jsonify(success=True)\n"
] | [
"@app.route('/enable_sharing/<path:path>', methods=['GET'])...\n",
"if path == 'None':\n",
"path = None\n",
"app.interface.config['share_url'] = path\n",
"return jsonify(success=True)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_28(self, VAR_2='password'):...\n",
"VAR_3 = self.client.post('/login/', {'username': 'testclient', 'password':\n VAR_2})\n",
"self.assertFormError(VAR_3, AuthenticationForm.error_messages[\n 'invalid_login'] % {'username': User._meta.get_field('username').\n verbose_name})\n"
] | [
"def fail_login(self, password='password'):...\n",
"response = self.client.post('/login/', {'username': 'testclient',\n 'password': password})\n",
"self.assertFormError(response, AuthenticationForm.error_messages[\n 'invalid_login'] % {'username': User._meta.get_field('username').\n verbose_name})\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(VAR_3):...\n",
"@wraps(VAR_3)...\n",
"if current_user.role_edit() or current_user.role_admin():\n",
"return VAR_3(*VAR_46, **kwargs)\n",
"abort(403)\n",
"return FUNC_44\n"
] | [
"def edit_required(f):...\n",
"@wraps(f)...\n",
"if current_user.role_edit() or current_user.role_admin():\n",
"return f(*args, **kwargs)\n",
"abort(403)\n",
"return inner\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(VAR_4):...\n",
"@wraps(VAR_4)...\n",
"if VAR_87.role_download():\n",
"return VAR_4(*VAR_49, **kwargs)\n",
"abort(403)\n",
"return FUNC_71\n"
] | [
"def download_required(f):...\n",
"@wraps(f)...\n",
"if current_user.role_download():\n",
"return f(*args, **kwargs)\n",
"abort(403)\n",
"return inner\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"@expose('/oauth-authorized/<provider>')...\n",
"VAR_0.debug('Authorized init')\n",
"VAR_45 = self.appbuilder.sm.oauth_remotes[VAR_41].authorize_access_token()\n",
"if VAR_45 is None:\n",
"flash(u'You denied the request to sign in.', 'warning')\n",
"VAR_0.debug('OAUTH Authorized resp: {0}'.format(VAR_45))... | [
"@expose('/oauth-authorized/<provider>')...\n",
"log.debug('Authorized init')\n",
"resp = self.appbuilder.sm.oauth_remotes[provider].authorize_access_token()\n",
"if resp is None:\n",
"flash(u'You denied the request to sign in.', 'warning')\n",
"log.debug('OAUTH Authorized resp: {0}'.format(resp))\n",
"... | [
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"... |
[
"def FUNC_19(self):...\n",
"VAR_5 = {'not_rooms': ['!anothersecretbase:unknown']}\n",
"VAR_6 = FUNC_0(sender='@foo:bar', type='m.room.message', room_id=\n '!anothersecretbase:unknown')\n",
"self.assertFalse(Filter(VAR_5).check(VAR_6))\n"
] | [
"def test_definition_not_rooms_works_with_literals(self):...\n",
"definition = {'not_rooms': ['!anothersecretbase:unknown']}\n",
"event = MockEvent(sender='@foo:bar', type='m.room.message', room_id=\n '!anothersecretbase:unknown')\n",
"self.assertFalse(Filter(definition).check(event))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_52():...\n",
"self.http_server.stop()\n",
"self.io_loop.stop()\n"
] | [
"def _stop():...\n",
"self.http_server.stop()\n",
"self.io_loop.stop()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0: str) ->str:...\n",
"return re.sub('[^\\\\w _-]+', '', VAR_0)\n"
] | [
"def _sanitize(value: str) ->str:...\n",
"return re.sub('[^\\\\w _-]+', '', value)\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_74(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._set_canonical_alias({'alt_aliases': '@bad:test'}, VAR_17=400)\n",
"self._set_canonical_alias({'alt_aliases': None}, VAR_17=400)\n",
"self._set_canonical_alias({'alt_aliases': 0}, VAR_17=400)\n",
"self._set_canonical_alias({'alt_aliases': 1}, VAR... | [
"def test_bad_data(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._set_canonical_alias({'alt_aliases': '@bad:test'}, expected_code=400)\n",
"self._set_canonical_alias({'alt_aliases': None}, expected_code=400)\n",
"self._set_canonical_alias({'alt_aliases': 0}, expected_code=400)\n",
"self._set_canonical_al... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(VAR_4, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = FUNC_0(VAR_4.config) + ['--temp-basedir', '-s',\n 'content.private_browsing', 'true']\n",
"VAR_6.start(VAR_11)\n",
"VAR_6.compare_session('string')\n",
"VAR_6.send_cmd(':quit')\n",
"VAR_6.wait_for_quit()\n"
] | [
"def test_initial_private_browsing(request, quteproc_new):...\n",
"\"\"\"docstring\"\"\"\n",
"args = _base_args(request.config) + ['--temp-basedir', '-s',\n 'content.private_browsing', 'true']\n",
"quteproc_new.start(args)\n",
"quteproc_new.compare_session(\n \"\"\"\n windows:\n - pr... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"async def FUNC_14():...\n",
""
] | [
"async def do_iterations():...\n",
""
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Condition"
] |
[
"@VAR_11.before_request...\n",
"session.permanent = True\n",
"VAR_11.permanent_session_lifetime = timedelta(seconds=settings.\n SESSION_EXPIRY_TIME)\n"
] | [
"@app.before_request...\n",
"session.permanent = True\n",
"app.permanent_session_lifetime = timedelta(seconds=settings.SESSION_EXPIRY_TIME\n )\n"
] | [
0,
0,
0
] | [
"For",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(VAR_2: 'RequestToCommandArgs', VAR_3: List[str]):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0.info('Executing archivy command')\n",
"if not VAR_22.environ.get('PYTHONIOENCODING'):\n",
"VAR_22.environ['PYTHONIOENCODING'] = 'UTF-8'\n",
"VAR_8 = subprocess.Popen(VAR_3, shell=False, stdout=subprocess... | [
"def _run_script_and_generate_stream(req_to_args: 'RequestToCommandArgs',...\n",
"\"\"\"docstring\"\"\"\n",
"logger.info('Executing archivy command')\n",
"if not os.environ.get('PYTHONIOENCODING'):\n",
"os.environ['PYTHONIOENCODING'] = 'UTF-8'\n",
"process = subprocess.Popen(cmd, shell=False, stdout=subpr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"For",
"Expr'"
] |
[
"def __call__(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_56 = VAR_263.request\n",
"if len(VAR_56.args) < 1:\n",
"VAR_320 = VAR_56.args(0)\n",
"if VAR_320 == 'run':\n",
"return self.serve_run(VAR_56.args[1:])\n",
"if VAR_320 == 'rss':\n",
"return self.serve_rss(VAR_56.args[1:])\n",
"if VAR_320 =... | [
"def __call__(self):...\n",
"\"\"\"docstring\"\"\"\n",
"request = current.request\n",
"if len(request.args) < 1:\n",
"arg0 = request.args(0)\n",
"if arg0 == 'run':\n",
"return self.serve_run(request.args[1:])\n",
"if arg0 == 'rss':\n",
"return self.serve_rss(request.args[1:])\n",
"if arg0 == 'csv'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Re... |
[
"def FUNC_13(VAR_22, VAR_23: Element) ->Union[Any, Type[NoValue]]:...\n",
"VAR_23.component_instance.component_name = self.name\n",
"VAR_23.component_instance.form_id = current_form_id(VAR_22)\n",
"if self.url is not None:\n",
"VAR_23.component_instance.url = self.url\n",
"def FUNC_14():...\n",
"VAR_23.... | [
"def marshall_component(dg, element: Element) ->Union[Any, Type[NoValue]]:...\n",
"element.component_instance.component_name = self.name\n",
"element.component_instance.form_id = current_form_id(dg)\n",
"if self.url is not None:\n",
"element.component_instance.url = self.url\n",
"def marshall_element_args... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self, VAR_3, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.links.append({'url': VAR_3, 'title': VAR_2})\n",
"return self\n"
] | [
"def with_link(self, url, title):...\n",
"\"\"\"docstring\"\"\"\n",
"self.links.append({'url': url, 'title': title})\n",
"return self\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"if self._pull_to_push_producer:\n",
"self._pull_to_push_producer.stop()\n"
] | [
"def unregisterProducer(self):...\n",
"if self._pull_to_push_producer:\n",
"self._pull_to_push_producer.stop()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def FUNC_16(self):...\n",
"self.call('testCall2', 'hello')\n"
] | [
"def mount(self):...\n",
"self.call('testCall2', 'hello')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_23):...\n",
"assert isinstance(VAR_23, text_type)\n",
"if self.encoding:\n",
"return VAR_23.encode(self.encoding, 'strict')\n",
"return VAR_23\n"
] | [
"def encodeStrict(self, string):...\n",
"assert isinstance(string, text_type)\n",
"if self.encoding:\n",
"return string.encode(self.encoding, 'strict')\n",
"return string\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Condition",
"Return'",
"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_4(self):...\n",
"return FUNC_0(self.rel.limit_choices_to)\n"
] | [
"def base_url_parameters(self):...\n",
"return url_params_from_lookup_dict(self.rel.limit_choices_to)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_33(self):...\n",
"from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver\n",
"from Products.PageTemplates.unicodeconflictresolver import IgnoringUnicodeEncodingConflictResolver\n",
"from zope.component import getUtility\n",
"from zope.component import provideUtility\n",
"... | [
"def testIgnoringResolver(self):...\n",
"from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver\n",
"from Products.PageTemplates.unicodeconflictresolver import IgnoringUnicodeEncodingConflictResolver\n",
"from zope.component import getUtility\n",
"from zope.component import provideUt... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"from __future__ import unicode_literals\n",
"import frappe\n",
"import json, datetime\n",
"from frappe import _, scrub\n",
"import frappe.desk.query_report\n",
"from frappe.utils import cint, cstr\n",
"from frappe.model.document import Document\n",
"from frappe.modules.export_file import export_to_fi... | [
"from __future__ import unicode_literals\n",
"import frappe\n",
"import json, datetime\n",
"from frappe import _, scrub\n",
"import frappe.desk.query_report\n",
"from frappe.utils import cint, cstr\n",
"from frappe.model.document import Document\n",
"from frappe.modules.export_file import export_to_fi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"... |
[
"def FUNC_9(VAR_25):...\n",
"return VAR_25[:-1] if VAR_25.endswith('_') else VAR_25\n"
] | [
"def norm(k):...\n",
"return k[:-1] if k.endswith('_') else k\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"async def FUNC_3(VAR_6, VAR_7):...\n",
"return web.json_response({'status': VAR_7.status, 'message': VAR_7.reason},\n status=response.status)\n"
] | [
"async def handle_any(request, response):...\n",
"return web.json_response({'status': response.status, 'message': response.\n reason}, status=response.status)\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Return'"
] |
[
"def FUNC_86(self, VAR_25, *VAR_0, **VAR_1):...\n",
"FUNC_83(self, VAR_72(self, *VAR_0, **kwargs))\n",
"for VAR_6 in VAR_73:\n",
"FUNC_83(self, VAR_6(self, VAR_25, *VAR_0, **kwargs))\n",
"return self._return_value\n"
] | [
"def runner(self, method, *args, **kwargs):...\n",
"add_to_return_value(self, fn(self, *args, **kwargs))\n",
"for f in hooks:\n",
"add_to_return_value(self, f(self, method, *args, **kwargs))\n",
"return self._return_value\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Expr'",
"Return'"
] |
[
"def FUNC_65(VAR_6):...\n",
"return reverse(VAR_120, VAR_116=(iid,))\n"
] | [
"def urlprefix(iid):...\n",
"return reverse(prefix, args=(iid,))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_1: str):...\n",
"self.sourceName = VAR_1\n",
"self.type = 'file'\n",
"self.content = None\n"
] | [
"def __init__(self, sourceName: str):...\n",
"self.sourceName = sourceName\n",
"self.type = 'file'\n",
"self.content = None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"async def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"async def get_resolved_spec(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Docstring"
] |
[
"def FUNC_77(VAR_94, VAR_132=True):...\n",
"\"\"\"docstring\"\"\"\n",
"import copy\n",
"def FUNC_119(VAR_174):...\n",
"for df in VAR_174.meta.get('fields', {'no_copy': 1}):\n",
"if hasattr(VAR_174, df.fieldname):\n",
"VAR_195 = ['name', 'owner', 'creation', 'modified', 'modified_by']\n",
"VAR_174.set(... | [
"def copy_doc(doc, ignore_no_copy=True):...\n",
"\"\"\"docstring\"\"\"\n",
"import copy\n",
"def remove_no_copy_fields(d):...\n",
"for df in d.meta.get('fields', {'no_copy': 1}):\n",
"if hasattr(d, df.fieldname):\n",
"fields_to_clear = ['name', 'owner', 'creation', 'modified', 'modified_by']\n",
"d.se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Import'",
"FunctionDef'",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'",
"Return'",
"For",
"Expr'",
"Condition",
... |
[
"def __init__(self, VAR_309, VAR_310):...\n",
"VAR_393 = CLASS_5.jsonrpc_errors.get(VAR_309)\n",
"if VAR_393:\n",
"self.message, self.description = VAR_393\n",
"self.code, self.info = VAR_309, VAR_310\n"
] | [
"def __init__(self, code, info):...\n",
"jrpc_error = Service.jsonrpc_errors.get(code)\n",
"if jrpc_error:\n",
"self.message, self.description = jrpc_error\n",
"self.code, self.info = code, info\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_22(self, VAR_1):...\n",
"VAR_5 = VAR_1.MagicMock()\n",
"VAR_26 = VAR_1.MagicMock()\n",
"VAR_23 = oai.Schema.construct(type='string', schema_format='date')\n",
"VAR_37 = VAR_1.patch(f'{VAR_0}.DateProperty')\n",
"from openapi_python_client.parser.properties import _string_based_property\n",
"VAR... | [
"def test__string_based_property_date_format(self, mocker):...\n",
"name = mocker.MagicMock()\n",
"required = mocker.MagicMock()\n",
"data = oai.Schema.construct(type='string', schema_format='date')\n",
"DateProperty = mocker.patch(f'{MODULE_NAME}.DateProperty')\n",
"from openapi_python_client.parser.prop... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assert'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"async def FUNC_25(self, VAR_32):...\n",
"return await self.store.get_min_depth(VAR_32)\n"
] | [
"async def get_min_depth_for_context(self, context):...\n",
"return await self.store.get_min_depth(context)\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Return'"
] |
[
"def FUNC_67(VAR_44, VAR_45, VAR_46, VAR_47, VAR_48):...\n",
"VAR_55 = request.form.to_dict()\n",
"VAR_87.random_books = 0\n",
"if VAR_87.role_passwd() or VAR_87.role_admin():\n",
"if VAR_55.get('password'):\n",
"if VAR_55.get('kindle_mail', VAR_87.kindle_mail) != VAR_87.kindle_mail:\n",
"flash(str(ex),... | [
"def change_profile(kobo_support, local_oauth_check, oauth_status,...\n",
"to_save = request.form.to_dict()\n",
"current_user.random_books = 0\n",
"if current_user.role_passwd() or current_user.role_admin():\n",
"if to_save.get('password'):\n",
"if to_save.get('kindle_mail', current_user.kindle_mail\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"For",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Condition",
"Assign'",
"Condition",... |
[
"def FUNC_4(self):...\n",
""
] | [
"def clean(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_40(self, VAR_28, VAR_35):...\n",
"VAR_15 = self.getUserId()\n",
"VAR_80 = self.playlistdb.createPLS(VAR_28=plid, VAR_15=userid, addrstr=hostaddr\n )\n",
"VAR_81 = self.playlistdb.getName(VAR_28, VAR_15)\n",
"if VAR_80 and VAR_81:\n",
"return self.serve_string_as_file(VAR_80, VAR_81 + '.pls')\... | [
"def api_downloadpls(self, plid, hostaddr):...\n",
"userid = self.getUserId()\n",
"pls = self.playlistdb.createPLS(plid=plid, userid=userid, addrstr=hostaddr)\n",
"name = self.playlistdb.getName(plid, userid)\n",
"if pls and name:\n",
"return self.serve_string_as_file(pls, name + '.pls')\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_1():...\n",
"if VAR_92.get('_user_id', ''):\n",
"VAR_0.error('No user id in session')\n",
"if not FUNC_3(VAR_92.get('_user_id', ''), VAR_92.get('_id', '')):\n",
"VAR_1.rollback()\n",
"VAR_94 = CLASS_4(VAR_92.get('_user_id', ''), VAR_92.get('_id', ''))\n",
"VAR_0.info('Found stored session : ' ... | [
"def store_user_session():...\n",
"if flask_session.get('_user_id', ''):\n",
"log.error('No user id in session')\n",
"if not check_user_session(flask_session.get('_user_id', ''), flask_session.\n",
"session.rollback()\n",
"user_session = User_Sessions(flask_session.get('_user_id', ''),\n flask_session.... | [
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
2
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(VAR_13, VAR_14, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_23 = ['ffmpeg', '-v', 'quiet', '-ss', str(VAR_14), '-t', str(VAR_15),\n '-i', str(VAR_13), '-movflags', 'frag_keyframe+empty_moov', '-c',\n 'copy', '-f', 'mp4', 'pipe:1']\n",
"VAR_17 = subprocess.Popen(VAR_23, stdout=subprocess.... | [
"def _create_ffmpeg_segment_proc(video_path, start_sec, duration_sec):...\n",
"\"\"\"docstring\"\"\"\n",
"cmd_l = ['ffmpeg', '-v', 'quiet', '-ss', str(start_sec), '-t', str(\n duration_sec), '-i', str(video_path), '-movflags',\n 'frag_keyframe+empty_moov', '-c', 'copy', '-f', 'mp4', 'pipe:1']\n",
"proc ... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_0, VAR_2):...\n",
"VAR_8 = VAR_0.post('/', data={'file': 'does_not_exist.txt', 's3file': 'file'})\n",
"S3FileMiddleware(lambda x: None)(VAR_8)\n",
"assert not VAR_8.FILES.getlist('file')\n",
"assert 'File not found: does_not_exist.txt' in VAR_2.text\n"
] | [
"def test_process_request__no_file(self, rf, caplog):...\n",
"request = rf.post('/', data={'file': 'does_not_exist.txt', 's3file': 'file'})\n",
"S3FileMiddleware(lambda x: None)(request)\n",
"assert not request.FILES.getlist('file')\n",
"assert 'File not found: does_not_exist.txt' in caplog.text\n"
] | [
0,
1,
0,
0,
1
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assert'",
"Assert'"
] |
[
"def FUNC_6(VAR_8):...\n",
"VAR_9 = VAR_8.args.get('api_key', None)\n",
"if VAR_9 is not None:\n",
"return VAR_9\n",
"if VAR_8.headers.get('Authorization'):\n",
"VAR_27 = VAR_8.headers.get('Authorization')\n",
"if VAR_8.view_args is not None and VAR_8.view_args.get('token'):\n",
"VAR_9 = VAR_27.replac... | [
"def get_api_key_from_request(request):...\n",
"api_key = request.args.get('api_key', None)\n",
"if api_key is not None:\n",
"return api_key\n",
"if request.headers.get('Authorization'):\n",
"auth_header = request.headers.get('Authorization')\n",
"if request.view_args is not None and request.view_args.g... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_49 = self.get_doc_before_save()\n",
"return VAR_49.get(VAR_18) != self.get(VAR_18) if VAR_49 else True\n"
] | [
"def has_value_changed(self, fieldname):...\n",
"\"\"\"docstring\"\"\"\n",
"previous = self.get_doc_before_save()\n",
"return previous.get(fieldname) != self.get(fieldname) if previous else True\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_17(self, VAR_20=False, VAR_15=None, VAR_16=True):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.flags.name_set and not VAR_20:\n",
"return\n",
"if self.get('__newname'):\n",
"self.name = self.get('__newname')\n",
"if VAR_15:\n",
"self.flags.name_set = True\n",
"self.name = VAR_15\n",
"FUNC_... | [
"def set_new_name(self, force=False, set_name=None, set_child_names=True):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.flags.name_set and not force:\n",
"return\n",
"if self.get('__newname'):\n",
"self.name = self.get('__newname')\n",
"if set_name:\n",
"self.flags.name_set = True\n",
"self.name = set... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Condition",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(VAR_19):...\n",
"if VAR_2:\n",
"return 'file://' + FUNC_10(VAR_19)\n",
"return url_for('.get_object_src_http', VAR_20=object_path)\n"
] | [
"def _get_object_src_uri(object_path):...\n",
"if LOCAL_OBJ_URI:\n",
"return 'file://' + _get_obj_absolute_path(object_path)\n",
"return url_for('.get_object_src_http', obj_path=object_path)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"return CLASS_7()\n"
] | [
"def _makeEngine(self):...\n",
"return DummyEngine()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@VAR_0.route('/shelf/remove/<int:shelf_id>/<int:book_id>')...\n",
"VAR_12 = request.headers.get('X-Requested-With') == 'XMLHttpRequest'\n",
"VAR_0 = ub.session.query(ub.Shelf).filter(ub.Shelf.id == VAR_3).first()\n",
"if VAR_0 is None:\n",
"VAR_1.error('Invalid shelf specified: {}'.format(VAR_3))\n",
"if... | [
"@shelf.route('/shelf/remove/<int:shelf_id>/<int:book_id>')...\n",
"xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'\n",
"shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()\n",
"if shelf is None:\n",
"log.error('Invalid shelf specified: {}'.format(shelf_id))\n",
"i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'",
"Ret... |
[
"@VAR_2.route('/send/<int:book_id>/<book_format>/<int:convert>')...\n",
"if not config.get_mail_server_configured():\n",
"flash(_(u'Please configure the SMTP mail settings first...'), category='error')\n",
"if VAR_87.kindle_mail:\n",
"if 'HTTP_REFERER' in request.environ:\n",
"VAR_135 = send_mail(VAR_5, V... | [
"@web.route('/send/<int:book_id>/<book_format>/<int:convert>')...\n",
"if not config.get_mail_server_configured():\n",
"flash(_(u'Please configure the SMTP mail settings first...'), category='error')\n",
"if current_user.kindle_mail:\n",
"if 'HTTP_REFERER' in request.environ:\n",
"result = send_mail(book_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"For",
"Condition",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Return'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_30(VAR_20, VAR_36):...\n",
"if VAR_20['author_name'] == _(u'Unknown'):\n",
"VAR_20['author_name'] = ''\n",
"if VAR_20['book_title'] == _(u'Unknown'):\n",
"VAR_20['book_title'] = ''\n",
"for VAR_93, m_field in [('tags', 'tags'), ('author_name', 'author'), (\n",
"VAR_20[VAR_93] = VAR_20[VAR_93] ... | [
"def merge_metadata(to_save, meta):...\n",
"if to_save['author_name'] == _(u'Unknown'):\n",
"to_save['author_name'] = ''\n",
"if to_save['book_title'] == _(u'Unknown'):\n",
"to_save['book_title'] = ''\n",
"for s_field, m_field in [('tags', 'tags'), ('author_name', 'author'), (\n",
"to_save[s_field] = to... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = []\n",
"for filename in VAR_1:\n",
"VAR_11 = os.path.join(VAR_0, filename)\n",
"return sorted(VAR_6, key=lambda v: v['name'].lower())\n",
"if VAR_2(VAR_11):\n",
"VAR_6.append({'name': filename, 'absname': VAR_11})\n"
] | [
"def get_file_list(basedir, all_files, filterfunc):...\n",
"\"\"\"docstring\"\"\"\n",
"items = []\n",
"for filename in all_files:\n",
"absname = os.path.join(basedir, filename)\n",
"return sorted(items, key=lambda v: v['name'].lower())\n",
"if filterfunc(absname):\n",
"items.append({'name': filename, ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"@staticmethod...\n",
"VAR_27, VAR_38 = utils.execute('openssl', 'rsautl', '-decrypt', '-inkey', \n '%s' % VAR_20, process_input=encrypted_key, check_exit_code=False)\n",
"if VAR_38:\n",
"VAR_39, VAR_38 = utils.execute('openssl', 'rsautl', '-decrypt', '-inkey', \n '%s' % VAR_20, process_input=encrypted_... | [
"@staticmethod...\n",
"key, err = utils.execute('openssl', 'rsautl', '-decrypt', '-inkey', '%s' %\n cloud_private_key, process_input=encrypted_key, check_exit_code=False)\n",
"if err:\n",
"iv, err = utils.execute('openssl', 'rsautl', '-decrypt', '-inkey', '%s' %\n cloud_private_key, process_input=encryp... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition"
] |
[
"@VAR_0.simple_tag...\n",
"VAR_12 = {'template_pack': VAR_10} if VAR_10 else {}\n",
"VAR_40 = HTMLFormRenderer()\n",
"return VAR_40.render(VAR_9.data, None, {'style': VAR_12})\n"
] | [
"@register.simple_tag...\n",
"style = {'template_pack': template_pack} if template_pack else {}\n",
"renderer = HTMLFormRenderer()\n",
"return renderer.render(serializer.data, None, {'style': style})\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_24(VAR_14, VAR_31):...\n",
"from babel.messages.pofile import read_po\n",
"from octoprint.util import dict_merge\n",
"VAR_83 = {}\n",
"VAR_84 = None\n",
"def FUNC_34(VAR_9, VAR_14, VAR_31):...\n",
"VAR_83 = {}\n",
"VAR_85 = read_po(FUNC_47, VAR_14=locale, VAR_31=domain)\n",
"for message in... | [
"def _get_translations(locale, domain):...\n",
"from babel.messages.pofile import read_po\n",
"from octoprint.util import dict_merge\n",
"messages = {}\n",
"plural_expr = None\n",
"def messages_from_po(path, locale, domain):...\n",
"messages = {}\n",
"catalog = read_po(f, locale=locale, domain=domain)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_4():...\n",
"VAR_39 = FUNC_3(CLASS_4, VAR_9=False)\n",
"VAR_39.types['python'] = PythonExpr\n",
"return VAR_39\n"
] | [
"def createTrustedZopeEngine():...\n",
"e = createZopeEngine(TrustedZopePathExpr, untrusted=False)\n",
"e.types['python'] = PythonExpr\n",
"return e\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_83(VAR_9, VAR_10):...\n",
""
] | [
"def wrapped(request, course_id):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@login_required...\n",
"VAR_5 = get_object_or_404(CommentLike, VAR_2=pk, user=request.user)\n",
"if is_post(VAR_0):\n",
"VAR_5.delete()\n",
"return render(VAR_0=request, template_name=\n 'spirit/comment/like/delete.html', context={'like': like})\n",
"VAR_5.comment.decrease_likes_count()\n",
"if is_a... | [
"@login_required...\n",
"like = get_object_or_404(CommentLike, pk=pk, user=request.user)\n",
"if is_post(request):\n",
"like.delete()\n",
"return render(request=request, template_name=\n 'spirit/comment/like/delete.html', context={'like': like})\n",
"like.comment.decrease_likes_count()\n",
"if is_aja... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_7(self, VAR_22: bytes, VAR_23: bytes, VAR_24: Optional[Headers]=...\n",
"VAR_43 = urllib.parse.urlparse(VAR_23.decode('ascii'))\n",
"VAR_7 = IPAddress(VAR_43.hostname)\n",
"return self._agent.request(VAR_22, VAR_23, VAR_24=headers, VAR_25=bodyProducer)\n",
"if FUNC_0(VAR_7, self._ip_whitelist, sel... | [
"def request(self, method: bytes, uri: bytes, headers: Optional[Headers]=...\n",
"h = urllib.parse.urlparse(uri.decode('ascii'))\n",
"ip_address = IPAddress(h.hostname)\n",
"return self._agent.request(method, uri, headers=headers, bodyProducer=\n bodyProducer)\n",
"if check_against_blacklist(ip_address, ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(VAR_8):...\n",
"VAR_13 = current_org._get_current_object()\n",
"VAR_21 = None\n",
"if org_settings['auth_jwt_auth_cookie_name']:\n",
"VAR_28 = VAR_8.cookies.get(org_settings['auth_jwt_auth_cookie_name'], None)\n",
"if org_settings['auth_jwt_auth_header_name']:\n",
"if VAR_28:\n",
"VAR_28 =... | [
"def jwt_token_load_user_from_request(request):...\n",
"org = current_org._get_current_object()\n",
"payload = None\n",
"if org_settings['auth_jwt_auth_cookie_name']:\n",
"jwt_token = request.cookies.get(org_settings['auth_jwt_auth_cookie_name'], None\n )\n",
"if org_settings['auth_jwt_auth_header_name... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"async def FUNC_4(VAR_5, VAR_6, VAR_7, VAR_8=None, VAR_9=0):...\n",
"if VAR_6.startswith('/_matrix/federation/v1/get_missing_events/'):\n",
"return {'events': []}\n"
] | [
"async def post_json(destination, path, data, headers=None, timeout=0):...\n",
"if path.startswith('/_matrix/federation/v1/get_missing_events/'):\n",
"return {'events': []}\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_34(self):...\n",
"self.parser = saved_model_cli.create_parser()\n",
"VAR_9 = test.test_src_dir_path(VAR_0)\n",
"VAR_10 = self.parser.parse_args(['scan', '--dir', VAR_9])\n",
"saved_model_cli.scan(VAR_10)\n",
"VAR_11 = out.getvalue().strip()\n",
"self.assertTrue('does not contain denylisted ops... | [
"def testScanCommand(self):...\n",
"self.parser = saved_model_cli.create_parser()\n",
"base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n",
"args = self.parser.parse_args(['scan', '--dir', base_path])\n",
"saved_model_cli.scan(args)\n",
"output = out.getvalue().strip()\n",
"self.assertTrue('does not... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"super(CLASS_0, self).setUp()\n",
"if platform.system() == 'Windows':\n",
"self.skipTest('Skipping failing tests on Windows.')\n"
] | [
"def setUp(self):...\n",
"super(SavedModelCLITestCase, self).setUp()\n",
"if platform.system() == 'Windows':\n",
"self.skipTest('Skipping failing tests on Windows.')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Expr'"
] |
[
"@app.route('/bookmarks/new', methods=['GET', 'POST'])...\n",
"VAR_8 = app.config.get('DEFAULT_BOOKMARKS_DIR', 'root directory')\n",
"VAR_9 = forms.NewBookmarkForm(VAR_7=default_dir)\n",
"VAR_9.path.choices = [('', 'root directory')] + [(pathname, pathname) for\n pathname in data.get_dirs()]\n",
"if VAR_... | [
"@app.route('/bookmarks/new', methods=['GET', 'POST'])...\n",
"default_dir = app.config.get('DEFAULT_BOOKMARKS_DIR', 'root directory')\n",
"form = forms.NewBookmarkForm(path=default_dir)\n",
"form.path.choices = [('', 'root directory')] + [(pathname, pathname) for\n pathname in data.get_dirs()]\n",
"if f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"@login_required...\n",
"VAR_6 = TopicNotification.objects.for_access(VAR_0.user).filter(is_read=False\n ).with_related_data()\n",
"VAR_7 = paginate(VAR_0, query_set=notifications, lookup_field='date',\n page_var='p', per_page=settings.ST_NOTIFICATIONS_PER_PAGE)\n",
"return render(VAR_0=request, templat... | [
"@login_required...\n",
"notifications = TopicNotification.objects.for_access(request.user).filter(\n is_read=False).with_related_data()\n",
"page = paginate(request, query_set=notifications, lookup_field='date',\n page_var='p', per_page=settings.ST_NOTIFICATIONS_PER_PAGE)\n",
"return render(request=req... | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_52(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._send_labelled_messages_in_room()\n",
"VAR_39 = 's0_0_0_0_0_0_0_0_0'\n",
"VAR_22, VAR_23 = self.make_request('GET', \n '/rooms/%s/messages?access_token=%s&from=%s&filter=%s' % (self.room_id,\n self.tok, VAR_39, json.dumps(self.FILTER_NOT_LABE... | [
"def test_messages_filter_not_labels(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._send_labelled_messages_in_room()\n",
"token = 's0_0_0_0_0_0_0_0_0'\n",
"request, channel = self.make_request('GET', \n '/rooms/%s/messages?access_token=%s&from=%s&filter=%s' % (self.room_id,\n self.tok, token, json.du... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"self.folder.laf.write(util.read_input('TeeShopLAF.html'))\n",
"self.assert_expected(self.folder.t, 'TeeShop1.html', getProducts=self.\n getProducts)\n"
] | [
"def test_3(self):...\n",
"self.folder.laf.write(util.read_input('TeeShopLAF.html'))\n",
"self.assert_expected(self.folder.t, 'TeeShop1.html', getProducts=self.\n getProducts)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_27(self, VAR_90=None, VAR_91=True, VAR_66=True, VAR_88='_token'):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_153(VAR_114):...\n",
"def FUNC_118(*VAR_11, **VAR_351):...\n",
"VAR_85 = self.get_jwt_token_from_request(VAR_88=token_param)\n",
"if VAR_91:\n",
"if VAR_85 and len(VAR_85) < self.max_h... | [
"def allows_jwt(self, otherwise=None, required=True, verify_expiration=True,...\n",
"\"\"\"docstring\"\"\"\n",
"def decorator(action):...\n",
"def f(*args, **kwargs):...\n",
"token = self.get_jwt_token_from_request(token_param=token_param)\n",
"if required:\n",
"if token and len(token) < self.max_header... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_8(self, VAR_20, VAR_13, VAR_21=None, VAR_22=None, **VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = VAR_13\n",
"VAR_106 = VAR_17.get_target_plurals()\n",
"VAR_59 = VAR_17.translation.language\n",
"VAR_107 = VAR_17.translation.plural\n",
"VAR_108 = self.attrs['tabindex']\n",
"VAR_109 = [h... | [
"def render(self, name, value, attrs=None, renderer=None, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"unit = value\n",
"values = unit.get_target_plurals()\n",
"lang = unit.translation.language\n",
"plural = unit.translation.plural\n",
"tabindex = self.attrs['tabindex']\n",
"placeables = [hl[2] for h... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",... |
[
"async def FUNC_5(self, VAR_14: str, VAR_15: str, VAR_16: str, VAR_17: str...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_36 = {'token': VAR_15, 'client_secret': VAR_16, 'sid': VAR_17}\n",
"VAR_37 = (self.hs.config.public_baseurl + \n '_matrix/client/unstable/registration/email/submit_token?%s' % urllib.\n pars... | [
"async def send_registration_mail(self, email_address: str, token: str,...\n",
"\"\"\"docstring\"\"\"\n",
"params = {'token': token, 'client_secret': client_secret, 'sid': sid}\n",
"link = (self.hs.config.public_baseurl + \n '_matrix/client/unstable/registration/email/submit_token?%s' % urllib.\n parse.... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"VAR_30 = '@some_other_guy:red'\n",
"VAR_29 = self.helper.create_room_as(VAR_30)\n",
"VAR_31 = '/rooms/%s/members' % VAR_29\n",
"self.helper.invite(VAR_7=room_id, src=room_creator, targ=self.user_id)\n",
"VAR_22, VAR_23 = self.make_request('GET', VAR_31)\n",
"self.assertEquals... | [
"def test_get_member_list_mixed_memberships(self):...\n",
"room_creator = '@some_other_guy:red'\n",
"room_id = self.helper.create_room_as(room_creator)\n",
"room_path = '/rooms/%s/members' % room_id\n",
"self.helper.invite(room=room_id, src=room_creator, targ=self.user_id)\n",
"request, channel = self.mak... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_1):...\n",
"from openapi_python_client.parser.properties import RefProperty\n",
"VAR_25 = VAR_28(VAR_5='test', VAR_26=True, default=None, reference=mocker.\n MagicMock(class_name='MyRefClass'))\n",
"assert VAR_25.get_type_string() == 'MyRefClass'\n",
"VAR_25.required = False\n",
"... | [
"def test_get_type_string(self, mocker):...\n",
"from openapi_python_client.parser.properties import RefProperty\n",
"ref_property = RefProperty(name='test', required=True, default=None,\n reference=mocker.MagicMock(class_name='MyRefClass'))\n",
"assert ref_property.get_type_string() == 'MyRefClass'\n",
... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Assert'",
"Assign'",
"Assert'"
] |
[
"def FUNC_2(VAR_2, VAR_3):...\n",
"if not VAR_2:\n",
"return None\n",
"VAR_6 = VAR_2.identifier, VAR_3\n",
"if VAR_6 not in VAR_0:\n",
"VAR_5 = FUNC_1(VAR_2, VAR_3)\n",
"VAR_5 = VAR_0[VAR_6]\n",
"VAR_0[VAR_6] = VAR_5\n",
"return VAR_5\n"
] | [
"def get_view_by_name(theme, view_name):...\n",
"if not theme:\n",
"return None\n",
"cache_key = theme.identifier, view_name\n",
"if cache_key not in _VIEW_CACHE:\n",
"view = _get_view_by_name(theme, view_name)\n",
"view = _VIEW_CACHE[cache_key]\n",
"_VIEW_CACHE[cache_key] = view\n",
"return view\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@log_function...\n",
"VAR_2 = FUNC_2('/send_join/%s/%s', VAR_6, VAR_7)\n",
"VAR_37 = await self.client.put_json(VAR_5=destination, VAR_2=path, VAR_39=\n content)\n",
"return VAR_37\n"
] | [
"@log_function...\n",
"path = _create_v2_path('/send_join/%s/%s', room_id, event_id)\n",
"response = await self.client.put_json(destination=destination, path=path,\n data=content)\n",
"return response\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_1.route('/get_title', methods=['POST'])...\n",
"VAR_11 = urllib2.build_opener()\n",
"VAR_12 = VAR_11.open(VAR_0.url_to_clone).read()\n",
"VAR_12 = VAR_12[VAR_12.find('<title>') + 7:VAR_12.find('</title>')]\n",
"return json.dumps({'status': 'OK', 'title': VAR_12})\n"
] | [
"@app.route('/get_title', methods=['POST'])...\n",
"opener = urllib2.build_opener()\n",
"html = opener.open(trape.url_to_clone).read()\n",
"html = html[html.find('<title>') + 7:html.find('</title>')]\n",
"return json.dumps({'status': 'OK', 'title': html})\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = FUNC_10(VAR_2, VAR_3)\n",
"print(\n 'The given SavedModel MetaGraphDef contains SignatureDefs with the following keys:'\n )\n",
"for VAR_5 in sorted(VAR_26.keys()):\n",
"print('SignatureDef key: \"%s\"' % VAR_5)\n"
] | [
"def _show_signature_def_map_keys(saved_model_dir, tag_set):...\n",
"\"\"\"docstring\"\"\"\n",
"signature_def_map = get_signature_def_map(saved_model_dir, tag_set)\n",
"print(\n 'The given SavedModel MetaGraphDef contains SignatureDefs with the following keys:'\n )\n",
"for signature_def_key in sorted... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"async def FUNC_11(self, VAR_23: str, VAR_32: Any, VAR_16: Optional[...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_16:\n",
"VAR_39 = urllib.parse.urlencode(VAR_16, True)\n",
"VAR_48 = encode_canonical_json(VAR_32)\n",
"VAR_23 = '%s?%s' % (VAR_23, VAR_39)\n",
"VAR_46 = {b'Content-Type': [b'application/json']... | [
"async def put_json(self, uri: str, json_body: Any, args: Optional[...\n",
"\"\"\"docstring\"\"\"\n",
"if args:\n",
"query_str = urllib.parse.urlencode(args, True)\n",
"json_str = encode_canonical_json(json_body)\n",
"uri = '%s?%s' % (uri, query_str)\n",
"actual_headers = {b'Content-Type': [b'applicatio... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_2(**VAR_5):...\n",
"VAR_27 = dict(python=expressions.PythonExpr, path=TrustedPathExpr)\n",
"VAR_27.update(VAR_5)\n",
"return FUNC_1(VAR_4=False, **ovr)\n"
] | [
"def createTrustedChameleonEngine(**overrides):...\n",
"ovr = dict(python=expressions.PythonExpr, path=TrustedPathExpr)\n",
"ovr.update(overrides)\n",
"return createChameleonEngine(untrusted=False, **ovr)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_14(self, VAR_35):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_35 = self._substitute_comments('', VAR_35)\n",
"VAR_35 = VAR_35.replace('\\\\', '')\n",
"VAR_35 = VAR_5('', VAR_35)\n",
"VAR_35 = VAR_35.lower()\n",
"if 'javascript:' in VAR_35:\n",
"return True\n",
"if 'expression(' in VAR_35:\n",
... | [
"def _has_sneaky_javascript(self, style):...\n",
"\"\"\"docstring\"\"\"\n",
"style = self._substitute_comments('', style)\n",
"style = style.replace('\\\\', '')\n",
"style = _substitute_whitespace('', style)\n",
"style = style.lower()\n",
"if 'javascript:' in style:\n",
"return True\n",
"if 'express... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"async def FUNC_8(self):...\n",
"VAR_36 = await self.get_resolved_spec()\n",
"return f'https://doi.org/{VAR_36}'\n"
] | [
"async def get_resolved_ref_url(self):...\n",
"resolved_spec = await self.get_resolved_spec()\n",
"return f'https://doi.org/{resolved_spec}'\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Return'"
] |
[
"async def FUNC_6(*VAR_9, **VAR_10):...\n",
"return None\n"
] | [
"async def _insert_client_ip(*args, **kwargs):...\n",
"return None\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Return'"
] |
[
"def FUNC_88(self):...\n",
"if not isinstance(VAR_263.session['settings_%s' % self.section], dict):\n",
"VAR_222 = dict(self.config.items(self.section))\n",
"VAR_222 = VAR_263.session['settings_%s' % self.section]\n",
"return VAR_222\n"
] | [
"def read(self):...\n",
"if not isinstance(current.session['settings_%s' % self.section], dict):\n",
"settings = dict(self.config.items(self.section))\n",
"settings = current.session['settings_%s' % self.section]\n",
"return settings\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.