lines
sequencelengths 1
383
| raw_lines
sequencelengths 1
383
| label
sequencelengths 1
383
| type
sequencelengths 1
383
|
---|---|---|---|
[
"def FUNC_6(VAR_7, VAR_8='Argument', VAR_6=0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = ' ' * VAR_6\n",
"def FUNC_31(VAR_31):...\n",
"VAR_63 = \"'\" * isinstance(VAR_31, str)\n",
"return VAR_63 + str(VAR_31) + VAR_63\n"
] | [
"def _print_args(arguments, argument_type='Argument', indent=0):...\n",
"\"\"\"docstring\"\"\"\n",
"indent_str = ' ' * indent\n",
"def _maybe_add_quotes(value):...\n",
"is_quotes = \"'\" * isinstance(value, str)\n",
"return is_quotes + str(value) + is_quotes\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_24(VAR_40):...\n",
"return VAR_39[VAR_40]\n"
] | [
"def models_dir_get(x):...\n",
"return module_paths[x]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_19(VAR_2, *VAR_23, **VAR_24):...\n",
"VAR_3 = VAR_2.GET.get('url')\n",
"if VAR_3 is None or len(VAR_3) == 0:\n",
"VAR_3 = VAR_2.get_full_path()\n",
"VAR_9 = False\n",
"VAR_14 = VAR_24.get('conn', None)\n",
"VAR_16 = None\n",
"VAR_19 = VAR_24.get('server_id', None)\n",
"if VAR_14 is None:\n",
"VAR_9 = VAR_20.doConnectionCleanup\n",
"VAR_36 = None\n",
"VAR_0.debug('Connection not provided, attempting to get one.')\n",
"VAR_36 = VAR_21(VAR_2, *VAR_23, **kwargs)\n",
"VAR_39 = isinstance(VAR_36, CLASS_0)\n",
"return VAR_36\n",
"VAR_14 = VAR_20.get_connection(VAR_19, VAR_2)\n",
"VAR_0.error('Error retrieving connection.', exc_info=True)\n",
"if VAR_14 is None:\n",
"if VAR_9 and VAR_39:\n",
"VAR_16 = str(x)\n",
"return VAR_20.on_not_logged_in(VAR_2, VAR_3, VAR_16)\n",
"VAR_20.on_logged_in(VAR_2, VAR_14)\n",
"VAR_9 = not VAR_39\n",
"VAR_20.verify_is_admin(VAR_14)\n",
"VAR_0.debug('Doing connection cleanup? %s' % VAR_9)\n",
"VAR_20.verify_is_group_owner(VAR_14, VAR_24.get('gid'))\n",
"if VAR_9:\n",
"VAR_0.warn('Failed to clean up connection', exc_info=True)\n",
"VAR_20.load_server_settings(VAR_14, VAR_2)\n",
"if VAR_14 is not None and VAR_14.c is not None:\n",
"VAR_15 = VAR_24.get('share_id')\n",
"VAR_14.close(hard=False)\n",
"VAR_17 = VAR_20.prepare_share_connection(VAR_2, VAR_14, VAR_15)\n",
"if VAR_17 is not None:\n",
"VAR_20.on_share_connection_prepared(VAR_2, VAR_17)\n",
"VAR_24['conn'] = VAR_14\n",
"VAR_24['conn'] = VAR_17\n",
"VAR_24['url'] = VAR_3\n"
] | [
"def wrapped(request, *args, **kwargs):...\n",
"url = request.GET.get('url')\n",
"if url is None or len(url) == 0:\n",
"url = request.get_full_path()\n",
"doConnectionCleanup = False\n",
"conn = kwargs.get('conn', None)\n",
"error = None\n",
"server_id = kwargs.get('server_id', None)\n",
"if conn is None:\n",
"doConnectionCleanup = ctx.doConnectionCleanup\n",
"retval = None\n",
"logger.debug('Connection not provided, attempting to get one.')\n",
"retval = f(request, *args, **kwargs)\n",
"delayConnectionCleanup = isinstance(retval, ConnCleaningHttpResponse)\n",
"return retval\n",
"conn = ctx.get_connection(server_id, request)\n",
"logger.error('Error retrieving connection.', exc_info=True)\n",
"if conn is None:\n",
"if doConnectionCleanup and delayConnectionCleanup:\n",
"error = str(x)\n",
"return ctx.on_not_logged_in(request, url, error)\n",
"ctx.on_logged_in(request, conn)\n",
"doConnectionCleanup = not delayConnectionCleanup\n",
"ctx.verify_is_admin(conn)\n",
"logger.debug('Doing connection cleanup? %s' % doConnectionCleanup)\n",
"ctx.verify_is_group_owner(conn, kwargs.get('gid'))\n",
"if doConnectionCleanup:\n",
"logger.warn('Failed to clean up connection', exc_info=True)\n",
"ctx.load_server_settings(conn, request)\n",
"if conn is not None and conn.c is not None:\n",
"share_id = kwargs.get('share_id')\n",
"conn.close(hard=False)\n",
"conn_share = ctx.prepare_share_connection(request, conn, share_id)\n",
"if conn_share is not None:\n",
"ctx.on_share_connection_prepared(request, conn_share)\n",
"kwargs['conn'] = conn\n",
"kwargs['conn'] = conn_share\n",
"kwargs['url'] = url\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
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_151(VAR_199):...\n",
"if [VAR_14 for VAR_14 in VAR_199 if 32 > ord(VAR_14) or ord(VAR_14) > 127]:\n",
"return Header(VAR_199.encode('utf-8'), 'utf-8')\n",
"return VAR_199\n"
] | [
"def encode_header(key):...\n",
"if [c for c in key if 32 > ord(c) or ord(c) > 127]:\n",
"return Header(key.encode('utf-8'), 'utf-8')\n",
"return key\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Return'",
"Return'"
] |
[
"def FUNC_24(VAR_23):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_51 = 'string'\n",
"VAR_52 = VAR_23.add_parser('show', description=show_msg, formatter_class=\n argparse.RawTextHelpFormatter)\n",
"VAR_52.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to inspect')\n",
"VAR_52.add_argument('--all', action='store_true', help=\n 'if set, will output all information in given SavedModel')\n",
"VAR_52.add_argument('--tag_set', type=str, default=None, help=\n \"tag-set of graph in SavedModel to show, separated by ','\")\n",
"VAR_52.add_argument('--signature_def', type=str, default=None, metavar=\n 'SIGNATURE_DEF_KEY', help=\n 'key of SignatureDef to display input(s) and output(s) for')\n",
"VAR_52.set_defaults(func=show)\n"
] | [
"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/saved_model --tag_set serve\n\nFor a MetaGraphDef with multiple tags in the tag-set, all tags must be passed in, separated by ';':\n$saved_model_cli show --dir /tmp/saved_model --tag_set serve,gpu\n\nTo show all inputs and outputs TensorInfo for a specific SignatureDef specified by the SignatureDef key in a MetaGraph.\n$saved_model_cli show --dir /tmp/saved_model --tag_set serve --signature_def serving_default\n\nTo show all available information in the SavedModel:\n$saved_model_cli show --dir /tmp/saved_model --all\"\"\"\n",
"parser_show = subparsers.add_parser('show', description=show_msg,\n formatter_class=argparse.RawTextHelpFormatter)\n",
"parser_show.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to inspect')\n",
"parser_show.add_argument('--all', action='store_true', help=\n 'if set, will output all information in given SavedModel')\n",
"parser_show.add_argument('--tag_set', type=str, default=None, help=\n \"tag-set of graph in SavedModel to show, separated by ','\")\n",
"parser_show.add_argument('--signature_def', type=str, default=None, metavar\n ='SIGNATURE_DEF_KEY', help=\n 'key of SignatureDef to display input(s) and output(s) for')\n",
"parser_show.set_defaults(func=show)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_34(VAR_94=None, VAR_93='read', VAR_10=None, VAR_95=False, VAR_62=None...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_10:\n",
"VAR_10 = VAR_18.user\n",
"if VAR_94:\n",
"if isinstance(VAR_94, string_types):\n",
"VAR_184 = (FUNC_66('has_website_permission') or {}).get(VAR_62, [])\n",
"VAR_94 = FUNC_45(VAR_62, VAR_94)\n",
"VAR_62 = VAR_94.doctype\n",
"if VAR_184:\n",
"if VAR_94.flags.ignore_permissions:\n",
"for method in VAR_184:\n",
"return False\n",
"return True\n",
"if hasattr(VAR_94, 'has_website_permission'):\n",
"VAR_218 = FUNC_73(method, VAR_94=doc, VAR_93=ptype, VAR_10=user, VAR_95=verbose\n )\n",
"return True\n",
"return VAR_94.has_website_permission(VAR_93, VAR_10, VAR_95=verbose)\n",
"if not VAR_218:\n",
"return False\n"
] | [
"def has_website_permission(doc=None, ptype='read', user=None, verbose=False,...\n",
"\"\"\"docstring\"\"\"\n",
"if not user:\n",
"user = session.user\n",
"if doc:\n",
"if isinstance(doc, string_types):\n",
"hooks = (get_hooks('has_website_permission') or {}).get(doctype, [])\n",
"doc = get_doc(doctype, doc)\n",
"doctype = doc.doctype\n",
"if hooks:\n",
"if doc.flags.ignore_permissions:\n",
"for method in hooks:\n",
"return False\n",
"return True\n",
"if hasattr(doc, 'has_website_permission'):\n",
"result = call(method, doc=doc, ptype=ptype, user=user, verbose=verbose)\n",
"return True\n",
"return doc.has_website_permission(ptype, user, verbose=verbose)\n",
"if not result:\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"For",
"Return'",
"Return'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_4, VAR_55, *VAR_6, **VAR_7):...\n",
"VAR_58 = VAR_7.pop('project')\n",
"VAR_7['auto_id'] = 'id_bulk_%s'\n",
"super().__init__(*VAR_6, **kwargs)\n",
"VAR_129 = VAR_58.label_set.all()\n",
"if VAR_129:\n",
"self.fields['remove_labels'].queryset = VAR_129\n",
"VAR_130 = {STATE_EMPTY, STATE_READONLY}\n",
"self.fields['add_labels'].queryset = VAR_129\n",
"if VAR_4 is not None and not VAR_4.has_perm('unit.review', VAR_55):\n",
"VAR_130.add(STATE_APPROVED)\n",
"self.fields['state'].choices = [x for x in self.fields['state'].choices if \n x[0] not in VAR_130]\n",
"self.helper = FormHelper(self)\n",
"self.helper.form_tag = False\n",
"self.helper.layout = Layout(Div(template='snippets/bulk-help.html'),\n SearchField('q'), Field('state'), Field('add_flags'), Field('remove_flags')\n )\n",
"if VAR_129:\n",
"self.helper.layout.append(InlineCheckboxes('add_labels'))\n",
"self.helper.layout.append(InlineCheckboxes('remove_labels'))\n"
] | [
"def __init__(self, user, obj, *args, **kwargs):...\n",
"project = kwargs.pop('project')\n",
"kwargs['auto_id'] = 'id_bulk_%s'\n",
"super().__init__(*args, **kwargs)\n",
"labels = project.label_set.all()\n",
"if labels:\n",
"self.fields['remove_labels'].queryset = labels\n",
"excluded = {STATE_EMPTY, STATE_READONLY}\n",
"self.fields['add_labels'].queryset = labels\n",
"if user is not None and not user.has_perm('unit.review', obj):\n",
"excluded.add(STATE_APPROVED)\n",
"self.fields['state'].choices = [x for x in self.fields['state'].choices if \n x[0] not in excluded]\n",
"self.helper = FormHelper(self)\n",
"self.helper.form_tag = False\n",
"self.helper.layout = Layout(Div(template='snippets/bulk-help.html'),\n SearchField('q'), Field('state'), Field('add_flags'), Field('remove_flags')\n )\n",
"if labels:\n",
"self.helper.layout.append(InlineCheckboxes('add_labels'))\n",
"self.helper.layout.append(InlineCheckboxes('remove_labels'))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_18, VAR_13, VAR_14, VAR_19=None):...\n",
"self.is_hidden = VAR_18.is_hidden\n",
"self.needs_multipart_form = VAR_18.needs_multipart_form\n",
"self.attrs = VAR_18.attrs\n",
"self.choices = VAR_18.choices\n",
"self.widget = VAR_18\n",
"self.rel = VAR_13\n",
"if VAR_19 is None:\n",
"VAR_19 = VAR_13.to in VAR_14._registry\n",
"self.can_add_related = VAR_19\n",
"self.admin_site = VAR_14\n"
] | [
"def __init__(self, widget, rel, admin_site, can_add_related=None):...\n",
"self.is_hidden = widget.is_hidden\n",
"self.needs_multipart_form = widget.needs_multipart_form\n",
"self.attrs = widget.attrs\n",
"self.choices = widget.choices\n",
"self.widget = widget\n",
"self.rel = rel\n",
"if can_add_related is None:\n",
"can_add_related = rel.to in admin_site._registry\n",
"self.can_add_related = can_add_related\n",
"self.admin_site = admin_site\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(self):...\n",
"if 'project' not in self.cleaned_data:\n",
"return\n",
"VAR_58 = self.cleaned_data['project']\n",
"VAR_20 = self.cleaned_data.get('name')\n",
"if VAR_20 and VAR_58.component_set.filter(name__iexact=name).exists():\n",
"VAR_69 = self.cleaned_data.get('slug')\n",
"if VAR_69 and VAR_58.component_set.filter(slug__iexact=slug).exists():\n"
] | [
"def clean(self):...\n",
"if 'project' not in self.cleaned_data:\n",
"return\n",
"project = self.cleaned_data['project']\n",
"name = self.cleaned_data.get('name')\n",
"if name and project.component_set.filter(name__iexact=name).exists():\n",
"slug = self.cleaned_data.get('slug')\n",
"if slug and project.component_set.filter(slug__iexact=slug).exists():\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition"
] |
[
"def FUNC_86(VAR_123, VAR_86, VAR_124):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_185 = HttpResponse(content_type='text/csv')\n",
"VAR_185['Content-Disposition'] = 'attachment; filename={0}'.format(unicode(\n VAR_123).encode('utf-8'))\n",
"VAR_186 = VAR_26.writer(VAR_185, dialect='excel', quotechar='\"', quoting=\n csv.QUOTE_ALL)\n",
"VAR_187 = [unicode(s).encode('utf-8') for s in VAR_86]\n",
"VAR_186.writerow(VAR_187)\n",
"for row in VAR_124:\n",
"VAR_187 = [unicode(s).encode('utf-8') for s in row]\n",
"return VAR_185\n",
"VAR_186.writerow(VAR_187)\n"
] | [
"def csv_response(filename, header, rows):...\n",
"\"\"\"docstring\"\"\"\n",
"response = HttpResponse(content_type='text/csv')\n",
"response['Content-Disposition'] = 'attachment; filename={0}'.format(unicode\n (filename).encode('utf-8'))\n",
"writer = csv.writer(response, dialect='excel', quotechar='\"', quoting=csv.\n QUOTE_ALL)\n",
"encoded = [unicode(s).encode('utf-8') for s in header]\n",
"writer.writerow(encoded)\n",
"for row in rows:\n",
"encoded = [unicode(s).encode('utf-8') for s in row]\n",
"return response\n",
"writer.writerow(encoded)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_1, VAR_2):...\n",
"VAR_3 = self.setup_test_homeserver('server', http_client=None)\n",
"self.store = VAR_3.get_datastore()\n",
"return VAR_3\n"
] | [
"def make_homeserver(self, reactor, clock):...\n",
"hs = self.setup_test_homeserver('server', http_client=None)\n",
"self.store = hs.get_datastore()\n",
"return hs\n"
] | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_60(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.login()\n",
"VAR_3 = self.client.get('/logout/next_page/named/')\n",
"self.assertEqual(VAR_3.status_code, 302)\n",
"self.assertURLEqual(VAR_3.url, '/password_reset/')\n",
"self.confirm_logged_out()\n"
] | [
"def test_logout_with_named_redirect(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.login()\n",
"response = self.client.get('/logout/next_page/named/')\n",
"self.assertEqual(response.status_code, 302)\n",
"self.assertURLEqual(response.url, '/password_reset/')\n",
"self.confirm_logged_out()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_2.route('/admin/resetpassword/<int:user_id>')...\n",
"if VAR_62 is not None and VAR_62.is_authenticated:\n",
"VAR_59, VAR_71 = reset_password(VAR_9)\n",
"return redirect(url_for('admin.admin'))\n",
"if VAR_59 == 1:\n",
"VAR_0.debug(u'Password for user %s reset', VAR_71)\n",
"if VAR_59 == 0:\n",
"flash(_(u'Password for user %(user)s reset', VAR_12=message), category=\n 'success')\n",
"VAR_0.error(u'An unknown error occurred. Please try again later.')\n",
"VAR_0.error(u'Please configure the SMTP mail settings first...')\n",
"flash(_(u'An unknown error occurred. Please try again later.'), category=\n 'error')\n",
"flash(_(u'Please configure the SMTP mail settings first...'), category='error')\n"
] | [
"@admi.route('/admin/resetpassword/<int:user_id>')...\n",
"if current_user is not None and current_user.is_authenticated:\n",
"ret, message = reset_password(user_id)\n",
"return redirect(url_for('admin.admin'))\n",
"if ret == 1:\n",
"log.debug(u'Password for user %s reset', message)\n",
"if ret == 0:\n",
"flash(_(u'Password for user %(user)s reset', user=message), category='success')\n",
"log.error(u'An unknown error occurred. Please try again later.')\n",
"log.error(u'Please configure the SMTP mail settings first...')\n",
"flash(_(u'An unknown error occurred. Please try again later.'), category=\n 'error')\n",
"flash(_(u'Please configure the SMTP mail settings first...'), category='error')\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __call__(self):...\n",
"VAR_56 = VAR_263.request\n",
"VAR_222 = self.settings\n",
"VAR_222.controller = VAR_222.controller or VAR_56.controller\n",
"VAR_222.function = VAR_222.function or VAR_56.function\n",
"self.automenu()\n",
"VAR_299 = VAR_56.args(0) or 'index'\n",
"if VAR_299 and VAR_299.isdigit():\n",
"return self.media(int(VAR_299))\n",
"if not VAR_299 or not VAR_299.startswith('_'):\n",
"return self.read(VAR_299)\n",
"if VAR_299 == '_edit':\n",
"return self.edit(VAR_56.args(1) or 'index', VAR_56.args(2) or 0)\n",
"if VAR_299 == '_editmedia':\n",
"return self.editmedia(VAR_56.args(1) or 'index')\n",
"if VAR_299 == '_create':\n",
"return self.create()\n",
"if VAR_299 == '_pages':\n",
"return self.pages()\n",
"if VAR_299 == '_search':\n",
"return self.search()\n",
"if VAR_299 == '_recent':\n",
"VAR_473 = int(VAR_56.vars.page or 0)\n",
"if VAR_299 == '_cloud':\n",
"VAR_173 = self.auth.db.wiki_page.created_by == VAR_56.args(1, cast=int)\n",
"return self.cloud()\n",
"if VAR_299 == '_preview':\n",
"return self.search(VAR_173=query, VAR_174=~self.auth.db.wiki_page.\n created_on, VAR_175=(ipage * self.rows_page, (ipage + 1) * self.rows_page))\n",
"return self.preview(self.get_renderer())\n"
] | [
"def __call__(self):...\n",
"request = current.request\n",
"settings = self.settings\n",
"settings.controller = settings.controller or request.controller\n",
"settings.function = settings.function or request.function\n",
"self.automenu()\n",
"zero = request.args(0) or 'index'\n",
"if zero and zero.isdigit():\n",
"return self.media(int(zero))\n",
"if not zero or not zero.startswith('_'):\n",
"return self.read(zero)\n",
"if zero == '_edit':\n",
"return self.edit(request.args(1) or 'index', request.args(2) or 0)\n",
"if zero == '_editmedia':\n",
"return self.editmedia(request.args(1) or 'index')\n",
"if zero == '_create':\n",
"return self.create()\n",
"if zero == '_pages':\n",
"return self.pages()\n",
"if zero == '_search':\n",
"return self.search()\n",
"if zero == '_recent':\n",
"ipage = int(request.vars.page or 0)\n",
"if zero == '_cloud':\n",
"query = self.auth.db.wiki_page.created_by == request.args(1, cast=int)\n",
"return self.cloud()\n",
"if zero == '_preview':\n",
"return self.search(query=query, orderby=~self.auth.db.wiki_page.created_on,\n limitby=(ipage * self.rows_page, (ipage + 1) * self.rows_page))\n",
"return self.preview(self.get_renderer())\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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"from setuptools import setup\n",
"setup(name='security_monkey', version='0.8.0', long_description=__doc__,\n packages=['security_monkey'], include_package_data=True, zip_safe=False,\n install_requires=['APScheduler==2.1.2', 'Flask==0.10.1',\n 'Flask-Login==0.2.10', 'Flask-Mail==0.9.0', 'Flask-Migrate==1.3.1',\n 'Flask-Principal==0.4.0', 'Flask-RESTful==0.3.3',\n 'Flask-SQLAlchemy==1.0', 'Flask-Script==0.6.3', 'Flask-Security==1.7.4',\n 'Flask-WTF==0.9.5', 'Jinja2==2.8', 'SQLAlchemy==0.9.2', 'boto>=2.41.0',\n 'ipaddr==2.1.11', 'itsdangerous==0.23', 'psycopg2==2.5.2',\n 'bcrypt==2.0.0', 'Sphinx==1.2.2', 'gunicorn==18.0',\n 'cryptography==1.3.2', 'boto3>=1.4.2', 'botocore>=1.4.81',\n 'dpath==1.3.2', 'pyyaml==3.11', 'jira==0.32', 'cloudaux>=1.0.6',\n 'joblib>=0.9.4', 'pyjwt>=1.01'], extras_require={'onelogin': [\n 'python-saml>=2.2.0'], 'tests': ['nose==1.3.0', 'mock==1.0.1',\n 'moto==0.4.30', 'freezegun>=0.3.7']})\n"
] | [
"from setuptools import setup\n",
"setup(name='security_monkey', version='0.8.0', long_description=__doc__,\n packages=['security_monkey'], include_package_data=True, zip_safe=False,\n install_requires=['APScheduler==2.1.2', 'Flask==0.10.1',\n 'Flask-Login==0.2.10', 'Flask-Mail==0.9.0', 'Flask-Migrate==1.3.1',\n 'Flask-Principal==0.4.0', 'Flask-RESTful==0.3.3',\n 'Flask-SQLAlchemy==1.0', 'Flask-Script==0.6.3', 'Flask-Security==1.7.4',\n 'Flask-WTF==0.9.5', 'Jinja2==2.8', 'SQLAlchemy==0.9.2', 'boto>=2.41.0',\n 'ipaddr==2.1.11', 'itsdangerous==0.23', 'psycopg2==2.5.2',\n 'bcrypt==2.0.0', 'Sphinx==1.2.2', 'gunicorn==18.0',\n 'cryptography==1.3.2', 'boto3>=1.4.2', 'botocore>=1.4.81',\n 'dpath==1.3.2', 'pyyaml==3.11', 'jira==0.32', 'cloudaux>=1.0.6',\n 'joblib>=0.9.4', 'pyjwt>=1.01'], extras_require={'onelogin': [\n 'python-saml>=2.2.0'], 'tests': ['nose==1.3.0', 'mock==1.0.1',\n 'moto==0.4.30', 'freezegun>=0.3.7']})\n"
] | [
0,
4
] | [
"ImportFrom'",
"Expr'"
] |
[
"@app.route('/tags/<tag_name>')...\n",
"if not app.config['SEARCH_CONF']['enabled'] and not which('rg'):\n",
"flash(\n 'Search (for example ripgrep) must be installed to view pages about embedded tags.'\n , 'error')\n",
"VAR_11 = search(f'#{VAR_0}#', strict=True)\n",
"return redirect('/')\n",
"return render_template('tags/show.html', title=f'Tags - {tag_name}', VAR_0=\n tag_name, search_result=search_results)\n"
] | [
"@app.route('/tags/<tag_name>')...\n",
"if not app.config['SEARCH_CONF']['enabled'] and not which('rg'):\n",
"flash(\n 'Search (for example ripgrep) must be installed to view pages about embedded tags.'\n , 'error')\n",
"search_results = search(f'#{tag_name}#', strict=True)\n",
"return redirect('/')\n",
"return render_template('tags/show.html', title=f'Tags - {tag_name}',\n tag_name=tag_name, search_result=search_results)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_115(self):...\n",
""
] | [
"def error(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@staticmethod...\n",
"tar.extractall(VAR_4)\n"
] | [
"@staticmethod...\n",
"tar.extractall(target_path)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_14(VAR_21, VAR_22, VAR_23=None, VAR_24=None, VAR_25=None, VAR_26=None...\n",
"if VAR_26 is None:\n",
"VAR_26 = os.path.join(VAR_8.cwd, VAR_8.interface.flagging_dir)\n",
"VAR_60 = '{}/log.csv'.format(VAR_26)\n",
"VAR_61 = VAR_8.interface.encryption_key if VAR_8.interface.encrypt else None\n",
"VAR_62 = not os.path.exists(VAR_60)\n",
"if VAR_24 is None:\n",
"VAR_81 = []\n",
"def FUNC_30(VAR_63):...\n",
"for i, VAR_29 in enumerate(VAR_8.interface.input_components):\n",
"VAR_63 = io.StringIO(VAR_63)\n",
"VAR_81.append(VAR_29.save_flagged(VAR_26, VAR_8.interface.config[\n 'input_components'][i]['label'], VAR_21[i], VAR_61))\n",
"for i, VAR_29 in enumerate(VAR_8.interface.output_components):\n",
"VAR_82 = list(csv.reader(VAR_63))\n",
"VAR_81.append(VAR_29.save_flagged(VAR_26, VAR_8.interface.config[\n 'output_components'][i]['label'], VAR_22[i], VAR_61) if VAR_22[i] is not\n None else '')\n",
"if VAR_23 is not None:\n",
"VAR_83 = VAR_82[0]\n",
"VAR_81.append(VAR_23)\n",
"if VAR_25 is not None:\n",
"VAR_84 = VAR_83.index('flag')\n",
"VAR_81.append(VAR_25)\n",
"VAR_81.append(str(datetime.datetime.now()))\n",
"VAR_82[VAR_24][VAR_84] = VAR_23\n",
"if VAR_62:\n",
"VAR_47 = io.StringIO()\n",
"VAR_94 = [VAR_29['label'] for VAR_29 in VAR_8.interface.config[\n 'input_components']]\n",
"VAR_85 = csv.writer(VAR_47)\n",
"VAR_94 += [VAR_29['label'] for VAR_29 in VAR_8.interface.config[\n 'output_components']]\n",
"VAR_85.writerows(VAR_82)\n",
"if VAR_8.interface.flagging_options is not None:\n",
"return VAR_47.getvalue()\n",
"VAR_94.append('flag')\n",
"if VAR_25 is not None:\n",
"VAR_94.append('username')\n",
"VAR_94.append('timestamp')\n"
] | [
"def flag_data(input_data, output_data, flag_option=None, flag_index=None,...\n",
"if flag_path is None:\n",
"flag_path = os.path.join(app.cwd, app.interface.flagging_dir)\n",
"log_fp = '{}/log.csv'.format(flag_path)\n",
"encryption_key = (app.interface.encryption_key if app.interface.encrypt else\n None)\n",
"is_new = not os.path.exists(log_fp)\n",
"if flag_index is None:\n",
"csv_data = []\n",
"def replace_flag_at_index(file_content):...\n",
"for i, interface in enumerate(app.interface.input_components):\n",
"file_content = io.StringIO(file_content)\n",
"csv_data.append(interface.save_flagged(flag_path, app.interface.config[\n 'input_components'][i]['label'], input_data[i], encryption_key))\n",
"for i, interface in enumerate(app.interface.output_components):\n",
"content = list(csv.reader(file_content))\n",
"csv_data.append(interface.save_flagged(flag_path, app.interface.config[\n 'output_components'][i]['label'], output_data[i], encryption_key) if \n output_data[i] is not None else '')\n",
"if flag_option is not None:\n",
"header = content[0]\n",
"csv_data.append(flag_option)\n",
"if username is not None:\n",
"flag_col_index = header.index('flag')\n",
"csv_data.append(username)\n",
"csv_data.append(str(datetime.datetime.now()))\n",
"content[flag_index][flag_col_index] = flag_option\n",
"if is_new:\n",
"output = io.StringIO()\n",
"headers = [interface['label'] for interface in app.interface.config[\n 'input_components']]\n",
"writer = csv.writer(output)\n",
"headers += [interface['label'] for interface in app.interface.config[\n 'output_components']]\n",
"writer.writerows(content)\n",
"if app.interface.flagging_options is not None:\n",
"return output.getvalue()\n",
"headers.append('flag')\n",
"if username is not None:\n",
"headers.append('username')\n",
"headers.append('timestamp')\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
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"For",
"Assign'",
"Expr'",
"For",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"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'"
] |
[
"def FUNC_8(self):...\n",
"self.folder.laf.write(util.read_input('TeeShopLAF.html'))\n",
"self.assert_expected(self.folder.t, 'TeeShop2.html', getProducts=self.\n getProducts)\n"
] | [
"def test_2(self):...\n",
"self.folder.laf.write(util.read_input('TeeShopLAF.html'))\n",
"self.assert_expected(self.folder.t, 'TeeShop2.html', getProducts=self.\n getProducts)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_29():...\n",
"return self.build_perspectives_response(VAR_34, VAR_36, VAR_39)\n"
] | [
"def build_response():...\n",
"return self.build_perspectives_response(SERVER_NAME, testkey, VALID_UNTIL_TS)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"self.assert_expected(self.folder.t, 'Loop2.html')\n"
] | [
"def testFancyLoop(self):...\n",
"self.assert_expected(self.folder.t, 'Loop2.html')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@FUNC_0...\n",
"return FederationRateLimiter(self.get_clock(), VAR_8=self.config.rc_federation)\n"
] | [
"@cache_in_self...\n",
"return FederationRateLimiter(self.get_clock(), config=self.config.rc_federation\n )\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = ['item1', 'item2', 'item3']\n",
"self.assertEqual(format_value(VAR_8), \"\"\"\n item1, item2, item3\n\"\"\")\n",
"self.assertEqual(format_value([]), '\\n\\n')\n"
] | [
"def test_format_value_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"list_items = ['item1', 'item2', 'item3']\n",
"self.assertEqual(format_value(list_items), \"\"\"\n item1, item2, item3\n\"\"\")\n",
"self.assertEqual(format_value([]), '\\n\\n')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_25(self, VAR_13, VAR_14):...\n",
"VAR_30 = []\n",
"for fieldname, VAR_4 in VAR_13:\n",
"VAR_5 = frappe.get_meta(VAR_4)\n",
"return VAR_30\n",
"if VAR_5.get_field(fieldname):\n",
"VAR_41 = VAR_5.get_field(fieldname)\n",
"if fieldname == '_aggregate_column':\n",
"VAR_30.append(VAR_41)\n",
"VAR_32 = FUNC_3(VAR_14, VAR_5)\n",
"VAR_32 = VAR_5.get_label(fieldname)\n",
"VAR_41 = frappe._dict(fieldname=fieldname, VAR_32=label)\n",
"if fieldname == 'name':\n",
"VAR_41.fieldtype = 'Link'\n",
"VAR_41.options = VAR_4\n"
] | [
"def build_standard_report_columns(self, columns, group_by_args):...\n",
"_columns = []\n",
"for fieldname, doctype in columns:\n",
"meta = frappe.get_meta(doctype)\n",
"return _columns\n",
"if meta.get_field(fieldname):\n",
"field = meta.get_field(fieldname)\n",
"if fieldname == '_aggregate_column':\n",
"_columns.append(field)\n",
"label = get_group_by_column_label(group_by_args, meta)\n",
"label = meta.get_label(fieldname)\n",
"field = frappe._dict(fieldname=fieldname, label=label)\n",
"if fieldname == 'name':\n",
"field.fieldtype = 'Link'\n",
"field.options = doctype\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_83(self, VAR_71):...\n",
"if isinstance(VAR_71, dict):\n",
"if not self.get('_return_value'):\n",
"self._return_value = VAR_71 or self.get('_return_value')\n",
"self._return_value = {}\n",
"self._return_value.update(VAR_71)\n"
] | [
"def add_to_return_value(self, new_return_value):...\n",
"if isinstance(new_return_value, dict):\n",
"if not self.get('_return_value'):\n",
"self._return_value = new_return_value or self.get('_return_value')\n",
"self._return_value = {}\n",
"self._return_value.update(new_return_value)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_25(self):...\n",
"VAR_5 = {'not_senders': ['@misspiggy:muppets'], 'senders': [\n '@kermit:muppets'], 'rooms': ['!stage:unknown'], 'not_rooms': [\n '!piggyshouse:muppets'], 'types': ['m.room.message', 'muppets.kermit.*'\n ], 'not_types': ['muppets.misspiggy.*']}\n",
"VAR_6 = FUNC_0(sender='@kermit:muppets', type='muppets.misspiggy.kisses',\n room_id='!stage:unknown')\n",
"self.assertFalse(Filter(VAR_5).check(VAR_6))\n"
] | [
"def test_definition_combined_event_bad_type(self):...\n",
"definition = {'not_senders': ['@misspiggy:muppets'], 'senders': [\n '@kermit:muppets'], 'rooms': ['!stage:unknown'], 'not_rooms': [\n '!piggyshouse:muppets'], 'types': ['m.room.message', 'muppets.kermit.*'\n ], 'not_types': ['muppets.misspiggy.*']}\n",
"event = MockEvent(sender='@kermit:muppets', type='muppets.misspiggy.kisses',\n room_id='!stage:unknown')\n",
"self.assertFalse(Filter(definition).check(event))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(VAR_2):...\n",
"return render_to_string('tags/tag_widget.html', {'tag': VAR_2})\n"
] | [
"def widget_single_tag(tag):...\n",
"return render_to_string('tags/tag_widget.html', {'tag': tag})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_15(VAR_3, **VAR_4):...\n",
""
] | [
"def _callback(request, **kwargs):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_106(self, VAR_11=None):...\n",
"VAR_56 = VAR_263.request\n",
"VAR_244 = VAR_263.response\n",
"VAR_244.headers['Content-Type'] = 'text/x-csv'\n",
"if not VAR_11:\n",
"VAR_11 = VAR_56.args\n",
"def FUNC_164(VAR_179):...\n",
"if isinstance(VAR_179, unicodeT):\n",
"return VAR_179.encode('utf8')\n",
"if hasattr(VAR_179, 'isoformat'):\n",
"return VAR_179.isoformat()[:19].replace('T', ' ')\n",
"if VAR_179 is None:\n",
"return '<NULL>'\n",
"return VAR_179\n"
] | [
"def serve_csv(self, args=None):...\n",
"request = current.request\n",
"response = current.response\n",
"response.headers['Content-Type'] = 'text/x-csv'\n",
"if not args:\n",
"args = request.args\n",
"def none_exception(value):...\n",
"if isinstance(value, unicodeT):\n",
"return value.encode('utf8')\n",
"if hasattr(value, 'isoformat'):\n",
"return value.isoformat()[:19].replace('T', ' ')\n",
"if value is None:\n",
"return '<NULL>'\n",
"return value\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"For",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2(VAR_5):...\n",
"return json.load(f)\n"
] | [
"def load_metadata(metadata_file):...\n",
"return json.load(f)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_68(VAR_12, VAR_28):...\n",
"VAR_94 = re.search(VAR_28 + '=([\\\\.\\\\d\\\\s\\\\w-]+)', VAR_12, re.IGNORECASE |\n re.UNICODE)\n",
"if VAR_94:\n",
"return VAR_94.group(1)\n"
] | [
"def extract_user_data_from_field(user, field):...\n",
"match = re.search(field + '=([\\\\.\\\\d\\\\s\\\\w-]+)', user, re.IGNORECASE | re.\n UNICODE)\n",
"if match:\n",
"return match.group(1)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_58(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.login()\n",
"VAR_3 = self.client.get('/logout/?next=/login/')\n",
"self.assertEqual(VAR_3.status_code, 302)\n",
"self.assertURLEqual(VAR_3.url, '/login/')\n",
"self.confirm_logged_out()\n"
] | [
"def test_logout_with_redirect_argument(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.login()\n",
"response = self.client.get('/logout/?next=/login/')\n",
"self.assertEqual(response.status_code, 302)\n",
"self.assertURLEqual(response.url, '/login/')\n",
"self.confirm_logged_out()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_35(VAR_62):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_117():...\n",
"return VAR_12.sql_list('select name from tabDocType where istable=1')\n"
] | [
"def is_table(doctype):...\n",
"\"\"\"docstring\"\"\"\n",
"def get_tables():...\n",
"return db.sql_list('select name from tabDocType where istable=1')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Return'"
] |
[
"@login_required()...\n",
"VAR_142 = VAR_5.getObject('Image', VAR_26)\n",
"if VAR_142 is None:\n",
"VAR_53 = {'template': 'webclient/annotations/original_metadata.html',\n 'imageId': VAR_142.getId()}\n",
"VAR_181 = VAR_142.loadOriginalMetadata()\n",
"return HttpResponse(VAR_286='LockTimeout', VAR_313=408)\n",
"return VAR_53\n",
"if VAR_181 is not None:\n",
"VAR_53['original_metadata'] = VAR_181[0]\n",
"VAR_53['global_metadata'] = VAR_181[1]\n",
"VAR_53['series_metadata'] = VAR_181[2]\n"
] | [
"@login_required()...\n",
"image = conn.getObject('Image', imageId)\n",
"if image is None:\n",
"context = {'template': 'webclient/annotations/original_metadata.html',\n 'imageId': image.getId()}\n",
"om = image.loadOriginalMetadata()\n",
"return HttpResponse(content='LockTimeout', status=408)\n",
"return context\n",
"if om is not None:\n",
"context['original_metadata'] = om[0]\n",
"context['global_metadata'] = om[1]\n",
"context['series_metadata'] = om[2]\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_12 is None:\n",
"return None\n",
"VAR_12 = re.sub('\\\\s+', ' ', VAR_12)\n",
"return [value.strip() for value in re.split(',(?![^()]*\\\\))', VAR_12) if\n value.strip()]\n"
] | [
"def splitForValues(forValues):...\n",
"\"\"\"docstring\"\"\"\n",
"if forValues is None:\n",
"return None\n",
"forValues = re.sub('\\\\s+', ' ', forValues)\n",
"return [value.strip() for value in re.split(',(?![^()]*\\\\))', forValues) if\n value.strip()]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_63(self):...\n",
"VAR_3 = self.client.get('/admin/auth/user/?password__startswith=sha1$')\n",
"self.assertEqual(VAR_3.status_code, 400)\n",
"self.assertEqual(len(logger_calls), 1)\n"
] | [
"def test_changelist_disallows_password_lookups(self):...\n",
"response = self.client.get('/admin/auth/user/?password__startswith=sha1$')\n",
"self.assertEqual(response.status_code, 400)\n",
"self.assertEqual(len(logger_calls), 1)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_9():...\n",
"while True:\n",
"VAR_24 = VAR_17.stdout.read(4096)\n",
"if not VAR_24:\n",
"yield VAR_24\n"
] | [
"def generate():...\n",
"while True:\n",
"data = proc.stdout.read(4096)\n",
"if not data:\n",
"yield data\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_7 = {'room': {'state': {'types': ['m.*']}}}\n",
"VAR_8 = yield defer.ensureDeferred(self.datastore.add_user_filter(VAR_0=\n user_localpart, VAR_10=user_filter_json))\n",
"VAR_6 = FUNC_0(sender='@foo:bar', type='m.room.topic', room_id='!foo:bar')\n",
"VAR_9 = [VAR_6]\n",
"VAR_10 = yield defer.ensureDeferred(self.filtering.get_user_filter(VAR_0=\n user_localpart, VAR_8=filter_id))\n",
"VAR_11 = VAR_10.filter_room_state(VAR_9=events)\n",
"self.assertEquals(VAR_9, VAR_11)\n"
] | [
"@defer.inlineCallbacks...\n",
"user_filter_json = {'room': {'state': {'types': ['m.*']}}}\n",
"filter_id = yield defer.ensureDeferred(self.datastore.add_user_filter(\n user_localpart=user_localpart, user_filter=user_filter_json))\n",
"event = MockEvent(sender='@foo:bar', type='m.room.topic', room_id='!foo:bar')\n",
"events = [event]\n",
"user_filter = yield defer.ensureDeferred(self.filtering.get_user_filter(\n user_localpart=user_localpart, filter_id=filter_id))\n",
"results = user_filter.filter_room_state(events=events)\n",
"self.assertEquals(events, results)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(VAR_9: Union[int, str]) ->Union[int, str]:...\n",
"\"\"\"docstring\"\"\"\n",
"return int(VAR_9)\n",
"return VAR_9\n"
] | [
"def _precision_allowed_type(x: Union[int, str]) ->Union[int, str]:...\n",
"\"\"\"docstring\"\"\"\n",
"return int(x)\n",
"return x\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'",
"Return'"
] |
[
"def FUNC_15(VAR_40: Fingerprint, VAR_35: Fingerprint, VAR_41: bool=False,...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_62 = [VAR_6]\n",
"if VAR_41:\n",
"VAR_62.append(VAR_7)\n",
"if VAR_42:\n",
"VAR_62.append(VAR_12)\n",
"VAR_63 = FUNC_12(VAR_40, VAR_35, CLASS_0(name='finetune', relevant_keys=\n section_keys))\n",
"VAR_64 = version.parse(VAR_40.get(VAR_9)) >= version.parse(\n MINIMUM_COMPATIBLE_VERSION)\n",
"return VAR_64 and not VAR_63\n"
] | [
"def can_finetune(last_fingerprint: Fingerprint, new_fingerprint:...\n",
"\"\"\"docstring\"\"\"\n",
"section_keys = [FINGERPRINT_CONFIG_WITHOUT_EPOCHS_KEY]\n",
"if core:\n",
"section_keys.append(FINGERPRINT_DOMAIN_WITHOUT_NLG_KEY)\n",
"if nlu:\n",
"section_keys.append(FINGERPRINT_NLU_LABELS_KEY)\n",
"fingerprint_changed = did_section_fingerprint_change(last_fingerprint,\n new_fingerprint, Section(name='finetune', relevant_keys=section_keys))\n",
"old_model_above_min_version = version.parse(last_fingerprint.get(\n FINGERPRINT_RASA_VERSION_KEY)) >= version.parse(MINIMUM_COMPATIBLE_VERSION)\n",
"return old_model_above_min_version and not fingerprint_changed\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_39 = FUNC_14(VAR_18)\n",
"for VAR_68, example_list in VAR_39.items():\n",
"if not isinstance(example_list, list):\n",
"return VAR_39\n",
"VAR_39[VAR_68] = [FUNC_16(VAR_41) for VAR_41 in example_list]\n"
] | [
"def preprocess_input_examples_arg_string(input_examples_str):...\n",
"\"\"\"docstring\"\"\"\n",
"input_dict = preprocess_input_exprs_arg_string(input_examples_str)\n",
"for input_key, example_list in input_dict.items():\n",
"if not isinstance(example_list, list):\n",
"return input_dict\n",
"input_dict[input_key] = [_create_example_string(example) for example in\n example_list]\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_20(VAR_9, VAR_12, VAR_10):...\n",
"VAR_63, VAR_64, VAR_65 = calibre_db.fill_indexpage(VAR_9, 0, db.Books, db.\n Books.authors.any(db.Authors.id == VAR_12), [VAR_10[0], db.Series.name,\n db.Books.series_index], db.books_series_link, db.Books.id == db.\n books_series_link.c.book, db.Series)\n",
"if VAR_63 is None or not len(VAR_63):\n",
"flash(_(\n u'Oops! Selected book title is unavailable. File does not exist or is not accessible'\n ), category='error')\n",
"if constants.sqlalchemy_version2:\n",
"return redirect(url_for('web.index'))\n",
"VAR_105 = calibre_db.session.get(db.Authors, VAR_12)\n",
"VAR_105 = calibre_db.session.query(db.Authors).get(VAR_12)\n",
"VAR_36 = VAR_105.name.replace('|', ',')\n",
"VAR_66 = None\n",
"VAR_67 = []\n",
"if services.goodreads_support and config.config_use_goodreads:\n",
"VAR_66 = services.goodreads_support.get_author_info(VAR_36)\n",
"return render_title_template('author.html', VAR_63=entries, VAR_65=\n pagination, id=author_id, VAR_149=_(u'Author: %(name)s', name=\n author_name), VAR_105=author_info, VAR_67=other_books, VAR_9='author')\n",
"VAR_67 = services.goodreads_support.get_other_books(VAR_66, VAR_63)\n"
] | [
"def render_author_books(page, author_id, order):...\n",
"entries, __, pagination = calibre_db.fill_indexpage(page, 0, db.Books, db.\n Books.authors.any(db.Authors.id == author_id), [order[0], db.Series.\n name, db.Books.series_index], db.books_series_link, db.Books.id == db.\n books_series_link.c.book, db.Series)\n",
"if entries is None or not len(entries):\n",
"flash(_(\n u'Oops! Selected book title is unavailable. File does not exist or is not accessible'\n ), category='error')\n",
"if constants.sqlalchemy_version2:\n",
"return redirect(url_for('web.index'))\n",
"author = calibre_db.session.get(db.Authors, author_id)\n",
"author = calibre_db.session.query(db.Authors).get(author_id)\n",
"author_name = author.name.replace('|', ',')\n",
"author_info = None\n",
"other_books = []\n",
"if services.goodreads_support and config.config_use_goodreads:\n",
"author_info = services.goodreads_support.get_author_info(author_name)\n",
"return render_title_template('author.html', entries=entries, pagination=\n pagination, id=author_id, title=_(u'Author: %(name)s', name=author_name\n ), author=author_info, other_books=other_books, page='author')\n",
"other_books = services.goodreads_support.get_other_books(author_info, entries)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_118(*VAR_9, **VAR_13):...\n",
"VAR_431, VAR_432, VAR_141 = self.basic()\n",
"VAR_141 = VAR_141 or self.user\n",
"VAR_433 = VAR_145\n",
"if callable(VAR_433):\n",
"VAR_433 = VAR_433()\n",
"if VAR_433:\n",
"if not VAR_141:\n",
"if callable(VAR_144):\n",
"if VAR_263.request.ajax:\n",
"VAR_453 = VAR_144()\n",
"VAR_453 = VAR_144\n",
"if VAR_90 is not None:\n",
"if not VAR_453:\n",
"if callable(VAR_90):\n",
"if self.settings.allow_basic_login_only or VAR_432 or VAR_263.request.is_restful:\n",
"VAR_263.session.flash = self.messages.access_denied\n",
"return VAR_114(*VAR_9, **b)\n",
"return VAR_90()\n",
"redirect(VAR_90)\n",
"VAR_112 = self.here()\n",
"return FUNC_3(self.settings.on_failed_authorization)\n",
"VAR_263.session.flash = VAR_263.response.flash\n",
"return FUNC_3(self.settings.on_failed_authentication, self.settings.\n login_url + '?_next=' + urllib_quote(VAR_112))\n"
] | [
"def f(*a, **b):...\n",
"basic_allowed, basic_accepted, user = self.basic()\n",
"user = user or self.user\n",
"login_required = requires_login\n",
"if callable(login_required):\n",
"login_required = login_required()\n",
"if login_required:\n",
"if not user:\n",
"if callable(condition):\n",
"if current.request.ajax:\n",
"flag = condition()\n",
"flag = condition\n",
"if otherwise is not None:\n",
"if not flag:\n",
"if callable(otherwise):\n",
"if self.settings.allow_basic_login_only or basic_accepted or current.request.is_restful:\n",
"current.session.flash = self.messages.access_denied\n",
"return action(*a, **b)\n",
"return otherwise()\n",
"redirect(otherwise)\n",
"next = self.here()\n",
"return call_or_redirect(self.settings.on_failed_authorization)\n",
"current.session.flash = current.response.flash\n",
"return call_or_redirect(self.settings.on_failed_authentication, self.\n settings.login_url + '?_next=' + urllib_quote(next))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Return'",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_10):...\n",
"VAR_21 = self.appbuilder.sm.get_user_by_id(g.user.id)\n",
"for key, value in VAR_10.data.items():\n",
"if key == 'csrf_token':\n",
"VAR_48 = getattr(VAR_10, key)\n",
"VAR_48.data = getattr(VAR_21, key)\n"
] | [
"def form_get(self, form):...\n",
"item = self.appbuilder.sm.get_user_by_id(g.user.id)\n",
"for key, value in form.data.items():\n",
"if key == 'csrf_token':\n",
"form_field = getattr(form, key)\n",
"form_field.data = getattr(item, key)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_18(self):...\n",
"VAR_22, VAR_23 = self.make_request('POST', '/createRoom',\n b'{\"visibility\":\"private\",\"custom\":\"things\"}')\n",
"self.assertEquals(200, VAR_23.code)\n",
"self.assertTrue('room_id' in VAR_23.json_body)\n"
] | [
"def test_post_room_known_and_unknown_keys(self):...\n",
"request, channel = self.make_request('POST', '/createRoom',\n b'{\"visibility\":\"private\",\"custom\":\"things\"}')\n",
"self.assertEquals(200, channel.code)\n",
"self.assertTrue('room_id' in channel.json_body)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import get_object_or_404\n",
"from django.shortcuts import redirect\n",
"from django.views.decorators.http import require_POST\n",
"from django.contrib import messages\n",
"from .models import TopicFavorite\n",
"from .forms import FavoriteForm\n",
"from ..models import Topic\n",
"from ...core import utils\n",
"@require_POST...\n",
"VAR_3 = get_object_or_404(Topic, VAR_2=topic_id)\n",
"VAR_4 = FavoriteForm(user=request.user, VAR_3=topic, data=request.POST)\n",
"if VAR_4.is_valid():\n",
"VAR_4.save()\n",
"messages.error(VAR_0, utils.render_form_errors(VAR_4))\n",
"return redirect(VAR_0.POST.get('next', VAR_3.get_absolute_url()))\n"
] | [
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import get_object_or_404\n",
"from django.shortcuts import redirect\n",
"from django.views.decorators.http import require_POST\n",
"from django.contrib import messages\n",
"from .models import TopicFavorite\n",
"from .forms import FavoriteForm\n",
"from ..models import Topic\n",
"from ...core import utils\n",
"@require_POST...\n",
"topic = get_object_or_404(Topic, pk=topic_id)\n",
"form = FavoriteForm(user=request.user, topic=topic, data=request.POST)\n",
"if form.is_valid():\n",
"form.save()\n",
"messages.error(request, utils.render_form_errors(form))\n",
"return redirect(request.POST.get('next', topic.get_absolute_url()))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_15(self, VAR_6):...\n",
"VAR_19 = 30\n",
"VAR_20 = []\n",
"VAR_21 = datetime.datetime.now()\n",
"if self.is_standard == 'Yes':\n",
"VAR_20 = self.execute_module(VAR_6)\n",
"VAR_20 = self.execute_script(VAR_6)\n",
"VAR_22 = (datetime.datetime.now() - VAR_21).total_seconds()\n",
"if VAR_22 > VAR_19 and not self.prepared_report:\n",
"self.db_set('prepared_report', 1)\n",
"frappe.cache().hset('report_execution_time', self.name, VAR_22)\n",
"return VAR_20\n"
] | [
"def execute_script_report(self, filters):...\n",
"threshold = 30\n",
"res = []\n",
"start_time = datetime.datetime.now()\n",
"if self.is_standard == 'Yes':\n",
"res = self.execute_module(filters)\n",
"res = self.execute_script(filters)\n",
"execution_time = (datetime.datetime.now() - start_time).total_seconds()\n",
"if execution_time > threshold and not self.prepared_report:\n",
"self.db_set('prepared_report', 1)\n",
"frappe.cache().hset('report_execution_time', self.name, execution_time)\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_24(self):...\n",
"if not VAR_69:\n",
"return False\n",
"return ask('Save credentials to keyring [y/N]: ', ['y', 'n']) == 'y'\n"
] | [
"def _should_save_password_to_keyring(self):...\n",
"if not keyring:\n",
"return False\n",
"return ask('Save credentials to keyring [y/N]: ', ['y', 'n']) == 'y'\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_1: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"return sha256(encode(VAR_1, encoding='utf-8')).hexdigest()\n"
] | [
"def sha256_str(val: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"return sha256(encode(val, encoding='utf-8')).hexdigest()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"from mock import Mock\n",
"from twisted.internet import defer\n",
"from synapse.rest.client.v1 import presence\n",
"from synapse.types import UserID\n",
"from tests import unittest\n",
"\"\"\" Tests presence REST API. \"\"\"\n",
"VAR_0 = '@sid:red'\n",
"VAR_1 = UserID.from_string(VAR_0)\n",
"VAR_2 = [presence.register_servlets]\n",
"def FUNC_0(self, VAR_3, VAR_4):...\n",
"VAR_5 = Mock()\n",
"VAR_5.set_state.return_value = defer.succeed(None)\n",
"VAR_6 = self.setup_test_homeserver('red', http_client=None,\n federation_client=Mock(), VAR_5=presence_handler)\n",
"return VAR_6\n"
] | [
"from mock import Mock\n",
"from twisted.internet import defer\n",
"from synapse.rest.client.v1 import presence\n",
"from synapse.types import UserID\n",
"from tests import unittest\n",
"\"\"\" Tests presence REST API. \"\"\"\n",
"user_id = '@sid:red'\n",
"user = UserID.from_string(user_id)\n",
"servlets = [presence.register_servlets]\n",
"def make_homeserver(self, reactor, clock):...\n",
"presence_handler = Mock()\n",
"presence_handler.set_state.return_value = defer.succeed(None)\n",
"hs = self.setup_test_homeserver('red', http_client=None, federation_client=\n Mock(), presence_handler=presence_handler)\n",
"return hs\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_47(self):...\n",
"\"\"\"docstring\"\"\"\n",
"from selenium.webdriver.common.keys import Keys\n",
"self.school.students = [self.lisa, self.peter]\n",
"self.school.alumni = [self.lisa, self.peter]\n",
"self.school.save()\n",
"self.admin_login(username='super', password='secret', login_url='/')\n",
"self.selenium.get('%s%s' % (self.live_server_url, \n '/admin_widgets/school/%s/' % self.school.id))\n",
"for VAR_11 in ['students', 'alumni']:\n",
"VAR_49 = '#id_%s_from' % VAR_11\n",
"self.selenium.find_element_by_xpath('//input[@value=\"Save\"]').click()\n",
"VAR_50 = '#id_%s_to' % VAR_11\n",
"self.wait_page_loaded()\n",
"VAR_45 = '#id_%s_add_link' % VAR_11\n",
"self.school = models.School.objects.get(id=self.school.id)\n",
"VAR_47 = '#id_%s_remove_link' % VAR_11\n",
"self.assertEqual(list(self.school.students.all()), [self.jason, self.peter])\n",
"VAR_56 = self.selenium.find_element_by_css_selector('#id_%s_input' % VAR_11)\n",
"self.assertEqual(list(self.school.alumni.all()), [self.jason, self.peter])\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.bob.id),\n str(self.cliff.id), str(self.jason.id), str(self.jenny.id), str(self.\n john.id)])\n",
"VAR_56.send_keys('a')\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.jason.id)])\n",
"VAR_56.send_keys('R')\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id)])\n",
"VAR_56.send_keys([Keys.BACK_SPACE])\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.jason.id)])\n",
"VAR_56.send_keys([Keys.BACK_SPACE])\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.bob.id),\n str(self.cliff.id), str(self.jason.id), str(self.jenny.id), str(self.\n john.id)])\n",
"VAR_56.send_keys('a')\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.jason.id)])\n",
"self.get_select_option(VAR_49, str(self.jason.id)).click()\n",
"self.selenium.find_element_by_css_selector(VAR_45).click()\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id)])\n",
"self.assertSelectOptions(VAR_50, [str(self.lisa.id), str(self.peter.id),\n str(self.jason.id)])\n",
"self.get_select_option(VAR_50, str(self.lisa.id)).click()\n",
"self.selenium.find_element_by_css_selector(VAR_47).click()\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.lisa.id)])\n",
"self.assertSelectOptions(VAR_50, [str(self.peter.id), str(self.jason.id)])\n",
"VAR_56.send_keys([Keys.BACK_SPACE])\n",
"self.assertSelectOptions(VAR_49, [str(self.arthur.id), str(self.bob.id),\n str(self.cliff.id), str(self.jenny.id), str(self.john.id), str(self.\n lisa.id)])\n",
"self.assertSelectOptions(VAR_50, [str(self.peter.id), str(self.jason.id)])\n"
] | [
"def test_filter(self):...\n",
"\"\"\"docstring\"\"\"\n",
"from selenium.webdriver.common.keys import Keys\n",
"self.school.students = [self.lisa, self.peter]\n",
"self.school.alumni = [self.lisa, self.peter]\n",
"self.school.save()\n",
"self.admin_login(username='super', password='secret', login_url='/')\n",
"self.selenium.get('%s%s' % (self.live_server_url, \n '/admin_widgets/school/%s/' % self.school.id))\n",
"for field_name in ['students', 'alumni']:\n",
"from_box = '#id_%s_from' % field_name\n",
"self.selenium.find_element_by_xpath('//input[@value=\"Save\"]').click()\n",
"to_box = '#id_%s_to' % field_name\n",
"self.wait_page_loaded()\n",
"choose_link = '#id_%s_add_link' % field_name\n",
"self.school = models.School.objects.get(id=self.school.id)\n",
"remove_link = '#id_%s_remove_link' % field_name\n",
"self.assertEqual(list(self.school.students.all()), [self.jason, self.peter])\n",
"input = self.selenium.find_element_by_css_selector('#id_%s_input' % field_name)\n",
"self.assertEqual(list(self.school.alumni.all()), [self.jason, self.peter])\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.bob.id),\n str(self.cliff.id), str(self.jason.id), str(self.jenny.id), str(self.\n john.id)])\n",
"input.send_keys('a')\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.jason.id)])\n",
"input.send_keys('R')\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id)])\n",
"input.send_keys([Keys.BACK_SPACE])\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.jason.id)])\n",
"input.send_keys([Keys.BACK_SPACE])\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.bob.id),\n str(self.cliff.id), str(self.jason.id), str(self.jenny.id), str(self.\n john.id)])\n",
"input.send_keys('a')\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.jason.id)])\n",
"self.get_select_option(from_box, str(self.jason.id)).click()\n",
"self.selenium.find_element_by_css_selector(choose_link).click()\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id)])\n",
"self.assertSelectOptions(to_box, [str(self.lisa.id), str(self.peter.id),\n str(self.jason.id)])\n",
"self.get_select_option(to_box, str(self.lisa.id)).click()\n",
"self.selenium.find_element_by_css_selector(remove_link).click()\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.lisa.id)])\n",
"self.assertSelectOptions(to_box, [str(self.peter.id), str(self.jason.id)])\n",
"input.send_keys([Keys.BACK_SPACE])\n",
"self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.bob.id),\n str(self.cliff.id), str(self.jenny.id), str(self.john.id), str(self.\n lisa.id)])\n",
"self.assertSelectOptions(to_box, [str(self.peter.id), str(self.jason.id)])\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_103(VAR_46):...\n",
"if VAR_46 not in VAR_1.system_settings:\n",
"VAR_1.system_settings.update({VAR_46: VAR_12.get_single_value(\n 'System Settings', VAR_46)})\n",
"return VAR_1.system_settings.get(VAR_46)\n"
] | [
"def get_system_settings(key):...\n",
"if key not in local.system_settings:\n",
"local.system_settings.update({key: db.get_single_value('System Settings', key)}\n )\n",
"return local.system_settings.get(key)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"\"\"\"Reading/writing Beancount files.\"\"\"\n",
"from __future__ import annotations\n",
"import datetime\n",
"import re\n",
"import threading\n",
"from codecs import decode\n",
"from codecs import encode\n",
"from hashlib import sha256\n",
"from operator import attrgetter\n",
"from typing import Generator\n",
"from typing import TYPE_CHECKING\n",
"from beancount.core.data import Balance\n",
"from beancount.core.data import Directive\n",
"from beancount.core.data import Entries\n",
"from beancount.core.data import SORT_ORDER\n",
"from beancount.core.data import Transaction\n",
"from beancount.core.flags import FLAG_CONVERSIONS\n",
"from beancount.core.flags import FLAG_MERGING\n",
"from beancount.core.flags import FLAG_PADDING\n",
"from beancount.core.flags import FLAG_SUMMARIZE\n",
"from beancount.core.flags import FLAG_TRANSFER\n",
"from beancount.parser.printer import format_entry\n",
"from fava.core._compat import FLAG_RETURNS\n",
"from fava.core._compat import FLAG_UNREALIZED\n",
"from fava.core.accounts import get_entry_accounts\n",
"from fava.core.fava_options import InsertEntryOption\n",
"from fava.core.misc import align\n",
"from fava.core.module_base import FavaModule\n",
"from fava.helpers import FavaAPIException\n",
"from fava.util import next_key\n",
"if TYPE_CHECKING:\n",
"from fava.core import FavaLedger\n",
"VAR_0 = {FLAG_PADDING, FLAG_SUMMARIZE, FLAG_TRANSFER, FLAG_CONVERSIONS,\n FLAG_UNREALIZED, FLAG_RETURNS, FLAG_MERGING}\n",
"def FUNC_0(VAR_1: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"return sha256(encode(VAR_1, encoding='utf-8')).hexdigest()\n"
] | [
"\"\"\"Reading/writing Beancount files.\"\"\"\n",
"from __future__ import annotations\n",
"import datetime\n",
"import re\n",
"import threading\n",
"from codecs import decode\n",
"from codecs import encode\n",
"from hashlib import sha256\n",
"from operator import attrgetter\n",
"from typing import Generator\n",
"from typing import TYPE_CHECKING\n",
"from beancount.core.data import Balance\n",
"from beancount.core.data import Directive\n",
"from beancount.core.data import Entries\n",
"from beancount.core.data import SORT_ORDER\n",
"from beancount.core.data import Transaction\n",
"from beancount.core.flags import FLAG_CONVERSIONS\n",
"from beancount.core.flags import FLAG_MERGING\n",
"from beancount.core.flags import FLAG_PADDING\n",
"from beancount.core.flags import FLAG_SUMMARIZE\n",
"from beancount.core.flags import FLAG_TRANSFER\n",
"from beancount.parser.printer import format_entry\n",
"from fava.core._compat import FLAG_RETURNS\n",
"from fava.core._compat import FLAG_UNREALIZED\n",
"from fava.core.accounts import get_entry_accounts\n",
"from fava.core.fava_options import InsertEntryOption\n",
"from fava.core.misc import align\n",
"from fava.core.module_base import FavaModule\n",
"from fava.helpers import FavaAPIException\n",
"from fava.util import next_key\n",
"if TYPE_CHECKING:\n",
"from fava.core import FavaLedger\n",
"EXCL_FLAGS = {FLAG_PADDING, FLAG_SUMMARIZE, FLAG_TRANSFER, FLAG_CONVERSIONS,\n FLAG_UNREALIZED, FLAG_RETURNS, FLAG_MERGING}\n",
"def sha256_str(val: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"return sha256(encode(val, encoding='utf-8')).hexdigest()\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
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_84(VAR_206):...\n",
"VAR_317 = []\n",
"for VAR_3, VAR_375 in VAR_206.items():\n",
"if isinstance(VAR_375, dict):\n",
"VAR_317.sort(VAR_310=lambda x: x['name'].lower())\n",
"VAR_317.append({'name': VAR_3, 'ul': FUNC_84(VAR_375)})\n",
"VAR_317.append({'name': VAR_3, 'id': VAR_375})\n",
"return VAR_317\n"
] | [
"def ul_to_list(ul):...\n",
"dir_list = []\n",
"for name, value in ul.items():\n",
"if isinstance(value, dict):\n",
"dir_list.sort(key=lambda x: x['name'].lower())\n",
"dir_list.append({'name': name, 'ul': ul_to_list(value)})\n",
"dir_list.append({'name': name, 'id': value})\n",
"return dir_list\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_73(self):...\n",
"return self.renderer.newline()\n"
] | [
"def output_newline(self):...\n",
"return self.renderer.newline()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self, VAR_13):...\n",
"VAR_28 = self._floatToString(VAR_13.real)\n",
"VAR_29 = self._floatToString(VAR_13.imag)\n",
"if VAR_29 == '0':\n",
"return VAR_28\n",
"if VAR_29 == '1':\n",
"VAR_29 = '+i'\n",
"if VAR_29 == '-1':\n",
"if VAR_28 == '0' and VAR_29 == '0':\n",
"VAR_29 = '-i'\n",
"if VAR_13.imag < 0:\n",
"return '0'\n",
"if VAR_28 == '0':\n",
"VAR_29 = '%si' % VAR_29\n",
"VAR_29 = '+%si' % VAR_29\n",
"return VAR_29.lstrip('+')\n",
"if VAR_29 == '0':\n",
"return VAR_28\n",
"return '%s%s' % (VAR_28, VAR_29)\n"
] | [
"def _complexToString(self, x):...\n",
"realS = self._floatToString(x.real)\n",
"imagS = self._floatToString(x.imag)\n",
"if imagS == '0':\n",
"return realS\n",
"if imagS == '1':\n",
"imagS = '+i'\n",
"if imagS == '-1':\n",
"if realS == '0' and imagS == '0':\n",
"imagS = '-i'\n",
"if x.imag < 0:\n",
"return '0'\n",
"if realS == '0':\n",
"imagS = '%si' % imagS\n",
"imagS = '+%si' % imagS\n",
"return imagS.lstrip('+')\n",
"if imagS == '0':\n",
"return realS\n",
"return '%s%s' % (realS, imagS)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(VAR_6, VAR_7='utf-8'):...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(VAR_6, text_type):\n",
"return VAR_6\n",
"if VAR_6 == None:\n",
"return ''\n",
"if isinstance(VAR_6, binary_type):\n",
"return text_type(VAR_6, VAR_7)\n",
"return text_type(VAR_6)\n"
] | [
"def as_unicode(text, encoding='utf-8'):...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(text, text_type):\n",
"return text\n",
"if text == None:\n",
"return ''\n",
"if isinstance(text, binary_type):\n",
"return text_type(text, encoding)\n",
"return text_type(text)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"@login_required()...\n",
""
] | [
"@login_required()...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"@transaction.non_atomic_requests...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n",
"VAR_65 = get_course_with_access(VAR_9.user, 'staff', VAR_10, depth=None)\n",
"VAR_127 = strip_if_string(VAR_9.GET.get('problem_to_reset'))\n",
"VAR_128 = VAR_9.GET.get('unique_student_identifier', None)\n",
"VAR_40 = None\n",
"if VAR_128 is not None:\n",
"VAR_40 = get_student_from_identifier(VAR_128)\n",
"VAR_129 = VAR_9.GET.get('all_students', False) in ['true', 'True', True]\n",
"VAR_130 = VAR_9.GET.get('delete_module', False) in ['true', 'True', True]\n",
"if VAR_129 and VAR_40:\n",
"return HttpResponseBadRequest(\n 'all_students and unique_student_identifier are mutually exclusive.')\n",
"if VAR_129 and VAR_130:\n",
"return HttpResponseBadRequest(\n 'all_students and delete_module are mutually exclusive.')\n",
"if VAR_129 or VAR_130:\n",
"if not has_access(VAR_9.user, 'instructor', VAR_65):\n",
"VAR_188 = VAR_10.make_usage_key_from_deprecated_string(VAR_127)\n",
"return HttpResponseBadRequest()\n",
"VAR_63 = {}\n",
"return HttpResponseForbidden('Requires instructor access.')\n",
"VAR_63['problem_to_reset'] = VAR_127\n",
"if VAR_40:\n",
"if VAR_129:\n",
"enrollment.reset_student_attempts(VAR_10, VAR_40, VAR_188, requesting_user=\n request.user, VAR_130=delete_module)\n",
"return HttpResponseBadRequest(_('Module does not exist.'))\n",
"VAR_63['student'] = VAR_128\n",
"instructor_task.api.submit_reset_problem_attempts_for_all_students(VAR_9,\n VAR_188)\n",
"return HttpResponseBadRequest()\n",
"return JsonResponse(VAR_63)\n",
"VAR_63['task'] = 'created'\n",
"VAR_63['student'] = 'All Students'\n"
] | [
"@transaction.non_atomic_requests...\n",
"\"\"\"docstring\"\"\"\n",
"course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n",
"course = get_course_with_access(request.user, 'staff', course_id, depth=None)\n",
"problem_to_reset = strip_if_string(request.GET.get('problem_to_reset'))\n",
"student_identifier = request.GET.get('unique_student_identifier', None)\n",
"student = None\n",
"if student_identifier is not None:\n",
"student = get_student_from_identifier(student_identifier)\n",
"all_students = request.GET.get('all_students', False) in ['true', 'True', True]\n",
"delete_module = request.GET.get('delete_module', False) in ['true', 'True',\n True]\n",
"if all_students and student:\n",
"return HttpResponseBadRequest(\n 'all_students and unique_student_identifier are mutually exclusive.')\n",
"if all_students and delete_module:\n",
"return HttpResponseBadRequest(\n 'all_students and delete_module are mutually exclusive.')\n",
"if all_students or delete_module:\n",
"if not has_access(request.user, 'instructor', course):\n",
"module_state_key = course_id.make_usage_key_from_deprecated_string(\n problem_to_reset)\n",
"return HttpResponseBadRequest()\n",
"response_payload = {}\n",
"return HttpResponseForbidden('Requires instructor access.')\n",
"response_payload['problem_to_reset'] = problem_to_reset\n",
"if student:\n",
"if all_students:\n",
"enrollment.reset_student_attempts(course_id, student, module_state_key,\n requesting_user=request.user, delete_module=delete_module)\n",
"return HttpResponseBadRequest(_('Module does not exist.'))\n",
"response_payload['student'] = student_identifier\n",
"instructor_task.api.submit_reset_problem_attempts_for_all_students(request,\n module_state_key)\n",
"return HttpResponseBadRequest()\n",
"return JsonResponse(response_payload)\n",
"response_payload['task'] = 'created'\n",
"response_payload['student'] = 'All Students'\n"
] | [
0,
0,
0,
0,
3,
3,
0,
0,
0,
3,
3,
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'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Return'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_23 = 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_23.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(signature_def_map.keys()):\n",
"print('SignatureDef key: \"%s\"' % signature_def_key)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"For",
"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_11 = self.parser.parse_args(['run', '--dir', VAR_10, '--tag_set',\n 'serve', '--signature_def', 'serving_default'] + (['--use_tfrt'] if\n VAR_5 else []))\n",
"saved_model_cli.run(VAR_11)\n"
] | [
"@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",
"args = self.parser.parse_args(['run', '--dir', base_path, '--tag_set',\n 'serve', '--signature_def', 'serving_default'] + (['--use_tfrt'] if\n use_tfrt else []))\n",
"saved_model_cli.run(args)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(VAR_1):...\n",
"return FUNC_1(VAR_1, VAR_3=User.objects.all(), VAR_4=\n 'spirit/user/admin/index.html')\n"
] | [
"def index(request):...\n",
"return _index(request, queryset=User.objects.all(), template=\n 'spirit/user/admin/index.html')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_16(self):...\n",
"VAR_32 = {'a': 5, 'b': np.array(range(4))}\n",
"VAR_33 = np.array([1])\n",
"VAR_34 = np.array([[1], [3]])\n",
"VAR_35 = os.path.join(test.get_temp_dir(), 'pickle0.pkl')\n",
"VAR_36 = os.path.join(test.get_temp_dir(), 'pickle1.pkl')\n",
"VAR_37 = os.path.join(test.get_temp_dir(), 'pickle2.pkl')\n",
"pickle.dump(VAR_32, f)\n",
"pickle.dump(VAR_33, f)\n",
"pickle.dump(VAR_34, f)\n",
"VAR_20 = 'x=' + VAR_35 + '[b];y=' + VAR_36 + '[c];'\n",
"VAR_20 += 'z=' + VAR_37\n",
"VAR_30 = saved_model_cli.load_inputs_from_input_arg_string(VAR_20, '', '')\n",
"self.assertTrue(np.all(VAR_30['x'] == VAR_32['b']))\n",
"self.assertTrue(np.all(VAR_30['y'] == VAR_33))\n",
"self.assertTrue(np.all(VAR_30['z'] == VAR_34))\n"
] | [
"def testInputParserPickle(self):...\n",
"pkl0 = {'a': 5, 'b': np.array(range(4))}\n",
"pkl1 = np.array([1])\n",
"pkl2 = np.array([[1], [3]])\n",
"input_path0 = os.path.join(test.get_temp_dir(), 'pickle0.pkl')\n",
"input_path1 = os.path.join(test.get_temp_dir(), 'pickle1.pkl')\n",
"input_path2 = os.path.join(test.get_temp_dir(), 'pickle2.pkl')\n",
"pickle.dump(pkl0, f)\n",
"pickle.dump(pkl1, f)\n",
"pickle.dump(pkl2, f)\n",
"input_str = 'x=' + input_path0 + '[b];y=' + input_path1 + '[c];'\n",
"input_str += 'z=' + input_path2\n",
"feed_dict = saved_model_cli.load_inputs_from_input_arg_string(input_str, '', ''\n )\n",
"self.assertTrue(np.all(feed_dict['x'] == pkl0['b']))\n",
"self.assertTrue(np.all(feed_dict['y'] == pkl1))\n",
"self.assertTrue(np.all(feed_dict['z'] == pkl2))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"AugAssign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_16, VAR_17=VAR_12, VAR_18=VAR_13, VAR_19=VAR_14, VAR_20=VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_16.tag in VAR_18:\n",
"return\n",
"VAR_63 = VAR_16.get('class')\n",
"if VAR_63:\n",
"VAR_63 = VAR_63.split()\n",
"for child in list(VAR_16):\n",
"for match_class in VAR_20:\n",
"FUNC_1(child, VAR_17=link_regexes, VAR_18=avoid_elements, VAR_19=\n avoid_hosts, VAR_20=avoid_classes)\n",
"if VAR_16.text:\n",
"if match_class in VAR_63:\n",
"if child.tail:\n",
"VAR_21, VAR_85 = FUNC_2(VAR_16.text, VAR_17, VAR_19, VAR_22=el.makeelement)\n",
"return\n",
"VAR_21, VAR_96 = FUNC_2(child.tail, VAR_17, VAR_19, VAR_22=el.makeelement)\n",
"if VAR_85:\n",
"if VAR_96:\n",
"VAR_16.text = VAR_21\n",
"child.tail = VAR_21\n",
"VAR_16[:0] = VAR_85\n",
"VAR_102 = VAR_16.index(child)\n",
"VAR_16[VAR_102 + 1:VAR_102 + 1] = VAR_96\n"
] | [
"def autolink(el, link_regexes=_link_regexes, avoid_elements=_avoid_elements,...\n",
"\"\"\"docstring\"\"\"\n",
"if el.tag in avoid_elements:\n",
"return\n",
"class_name = el.get('class')\n",
"if class_name:\n",
"class_name = class_name.split()\n",
"for child in list(el):\n",
"for match_class in avoid_classes:\n",
"autolink(child, link_regexes=link_regexes, avoid_elements=avoid_elements,\n avoid_hosts=avoid_hosts, avoid_classes=avoid_classes)\n",
"if el.text:\n",
"if match_class in class_name:\n",
"if child.tail:\n",
"text, pre_children = _link_text(el.text, link_regexes, avoid_hosts, factory\n =el.makeelement)\n",
"return\n",
"text, tail_children = _link_text(child.tail, link_regexes, avoid_hosts,\n factory=el.makeelement)\n",
"if pre_children:\n",
"if tail_children:\n",
"el.text = text\n",
"child.tail = text\n",
"el[:0] = pre_children\n",
"index = el.index(child)\n",
"el[index + 1:index + 1] = tail_children\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"For",
"For",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_15(VAR_13):...\n",
"VAR_1.query(CLASS_14).filter(VAR_13 == CLASS_14.book_id).delete()\n",
"VAR_1.commit()\n",
"VAR_1.rollback()\n"
] | [
"def delete_download(book_id):...\n",
"session.query(Downloads).filter(book_id == Downloads.book_id).delete()\n",
"session.commit()\n",
"session.rollback()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_17(self):...\n",
"VAR_33 = {'a': 5, 'b': np.array(range(4))}\n",
"VAR_34 = np.array([1])\n",
"VAR_35 = np.array([[1], [3]])\n",
"VAR_36 = os.path.join(test.get_temp_dir(), 'pickle0.pkl')\n",
"VAR_37 = os.path.join(test.get_temp_dir(), 'pickle1.pkl')\n",
"VAR_38 = os.path.join(test.get_temp_dir(), 'pickle2.pkl')\n",
"pickle.dump(VAR_33, f)\n",
"pickle.dump(VAR_34, f)\n",
"pickle.dump(VAR_35, f)\n",
"VAR_21 = 'x=' + VAR_36 + '[b];y=' + VAR_37 + '[c];'\n",
"VAR_21 += 'z=' + VAR_38\n",
"VAR_31 = saved_model_cli.load_inputs_from_input_arg_string(VAR_21, '', '')\n",
"self.assertTrue(np.all(VAR_31['x'] == VAR_33['b']))\n",
"self.assertTrue(np.all(VAR_31['y'] == VAR_34))\n",
"self.assertTrue(np.all(VAR_31['z'] == VAR_35))\n"
] | [
"def testInputParserPickle(self):...\n",
"pkl0 = {'a': 5, 'b': np.array(range(4))}\n",
"pkl1 = np.array([1])\n",
"pkl2 = np.array([[1], [3]])\n",
"input_path0 = os.path.join(test.get_temp_dir(), 'pickle0.pkl')\n",
"input_path1 = os.path.join(test.get_temp_dir(), 'pickle1.pkl')\n",
"input_path2 = os.path.join(test.get_temp_dir(), 'pickle2.pkl')\n",
"pickle.dump(pkl0, f)\n",
"pickle.dump(pkl1, f)\n",
"pickle.dump(pkl2, f)\n",
"input_str = 'x=' + input_path0 + '[b];y=' + input_path1 + '[c];'\n",
"input_str += 'z=' + input_path2\n",
"feed_dict = saved_model_cli.load_inputs_from_input_arg_string(input_str, '', ''\n )\n",
"self.assertTrue(np.all(feed_dict['x'] == pkl0['b']))\n",
"self.assertTrue(np.all(feed_dict['y'] == pkl1))\n",
"self.assertTrue(np.all(feed_dict['z'] == pkl2))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"AugAssign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from django.views.decorators.http import require_POST\n",
"from django.contrib import messages\n",
"from django.contrib.auth.views import redirect_to_login\n",
"from django.utils import timezone\n",
"from django.core.exceptions import PermissionDenied\n",
"from djconfig import config\n",
"from ...core import utils\n",
"from ...core.utils.paginator import yt_paginate\n",
"from .models import CommentPoll, CommentPollChoice, CommentPollVote\n",
"from .forms import PollVoteManyForm\n",
"@login_required...\n",
"VAR_3 = get_object_or_404(CommentPoll, VAR_1=pk, comment__user=request.user)\n",
"if VAR_2:\n",
"VAR_8 = timezone.now()\n",
"VAR_8 = None\n",
"CommentPoll.objects.filter(VAR_1=poll.pk).update(VAR_8=close_at)\n",
"return redirect(VAR_0.GET.get('next', VAR_3.get_absolute_url()))\n"
] | [
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from django.views.decorators.http import require_POST\n",
"from django.contrib import messages\n",
"from django.contrib.auth.views import redirect_to_login\n",
"from django.utils import timezone\n",
"from django.core.exceptions import PermissionDenied\n",
"from djconfig import config\n",
"from ...core import utils\n",
"from ...core.utils.paginator import yt_paginate\n",
"from .models import CommentPoll, CommentPollChoice, CommentPollVote\n",
"from .forms import PollVoteManyForm\n",
"@login_required...\n",
"poll = get_object_or_404(CommentPoll, pk=pk, comment__user=request.user)\n",
"if close:\n",
"close_at = timezone.now()\n",
"close_at = None\n",
"CommentPoll.objects.filter(pk=poll.pk).update(close_at=close_at)\n",
"return redirect(request.GET.get('next', poll.get_absolute_url()))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(VAR_24=None, VAR_28=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_177 = {}\n",
"VAR_24 = VAR_24 or getattr(VAR_1, 'sites_path', None)\n",
"VAR_28 = VAR_28 or getattr(VAR_1, 'site_path', None)\n",
"if VAR_24:\n",
"VAR_207 = os.path.join(VAR_24, 'common_site_config.json')\n",
"if VAR_28:\n",
"if os.path.exists(VAR_207):\n",
"VAR_208 = os.path.join(VAR_28, 'site_config.json')\n",
"return CLASS_0(VAR_177)\n",
"VAR_177.update(FUNC_70(VAR_207))\n",
"click.secho('common_site_config.json is invalid', fg='red')\n",
"if os.path.exists(VAR_208):\n",
"print(VAR_215)\n",
"if VAR_1.site and not VAR_1.flags.new_site:\n",
"VAR_177.update(FUNC_70(VAR_208))\n",
"click.secho('{0}/site_config.json is invalid'.format(VAR_1.site), fg='red')\n",
"print(VAR_215)\n"
] | [
"def get_site_config(sites_path=None, site_path=None):...\n",
"\"\"\"docstring\"\"\"\n",
"config = {}\n",
"sites_path = sites_path or getattr(local, 'sites_path', None)\n",
"site_path = site_path or getattr(local, 'site_path', None)\n",
"if sites_path:\n",
"common_site_config = os.path.join(sites_path, 'common_site_config.json')\n",
"if site_path:\n",
"if os.path.exists(common_site_config):\n",
"site_config = os.path.join(site_path, 'site_config.json')\n",
"return _dict(config)\n",
"config.update(get_file_json(common_site_config))\n",
"click.secho('common_site_config.json is invalid', fg='red')\n",
"if os.path.exists(site_config):\n",
"print(error)\n",
"if local.site and not local.flags.new_site:\n",
"config.update(get_file_json(site_config))\n",
"click.secho('{0}/site_config.json is invalid'.format(local.site), fg='red')\n",
"print(error)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_14='', **VAR_4):...\n",
"if self.current_cell:\n",
"if not VAR_14:\n",
"VAR_14 = None\n",
"self.current_cell.plugin_identifier = VAR_14\n",
"self.save_layout()\n"
] | [
"def dispatch_change_plugin(self, plugin='', **kwargs):...\n",
"if self.current_cell:\n",
"if not plugin:\n",
"plugin = None\n",
"self.current_cell.plugin_identifier = plugin\n",
"self.save_layout()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.desk.form.load import get_attachments\n",
"for attach_item in get_attachments(self.doctype, self.amended_from):\n",
"VAR_82 = frappe.get_doc({'doctype': 'File', 'file_url': attach_item.\n file_url, 'file_name': attach_item.file_name, 'attached_to_name': self.\n name, 'attached_to_doctype': self.doctype, 'folder': 'Home/Attachments'})\n",
"VAR_82.save()\n"
] | [
"def copy_attachments_from_amended_from(self):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.desk.form.load import get_attachments\n",
"for attach_item in get_attachments(self.doctype, self.amended_from):\n",
"_file = frappe.get_doc({'doctype': 'File', 'file_url': attach_item.file_url,\n 'file_name': attach_item.file_name, 'attached_to_name': self.name,\n 'attached_to_doctype': self.doctype, 'folder': 'Home/Attachments'})\n",
"_file.save()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_15(VAR_3, **VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"self.fail(\"shouldn't ever get here\")\n",
"VAR_5 = JsonResource(self.homeserver)\n",
"VAR_5.register_paths('GET', [re.compile('^/_matrix/foo$')], FUNC_15,\n 'test_servlet')\n",
"VAR_7, VAR_6 = make_request(self.reactor, FakeSite(VAR_5), b'GET',\n b'/_matrix/foobar')\n",
"self.assertEqual(VAR_6.result['code'], b'400')\n",
"self.assertEqual(VAR_6.json_body['error'], 'Unrecognized request')\n",
"self.assertEqual(VAR_6.json_body['errcode'], 'M_UNRECOGNIZED')\n"
] | [
"def test_no_handler(self):...\n",
"\"\"\"docstring\"\"\"\n",
"def _callback(request, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"self.fail(\"shouldn't ever get here\")\n",
"res = JsonResource(self.homeserver)\n",
"res.register_paths('GET', [re.compile('^/_matrix/foo$')], _callback,\n 'test_servlet')\n",
"_, channel = make_request(self.reactor, FakeSite(res), b'GET',\n b'/_matrix/foobar')\n",
"self.assertEqual(channel.result['code'], b'400')\n",
"self.assertEqual(channel.json_body['error'], 'Unrecognized request')\n",
"self.assertEqual(channel.json_body['errcode'], 'M_UNRECOGNIZED')\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_4, VAR_5, *VAR_6, **VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_4.has_perm('upload.authorship', VAR_5):\n",
"VAR_114 = CLASS_18\n",
"if VAR_4.has_perm('upload.overwrite', VAR_5):\n",
"VAR_7['initial'] = {'author_name': VAR_4.full_name, 'author_email': VAR_4.email\n }\n",
"VAR_114 = CLASS_17\n",
"VAR_114 = CLASS_16\n",
"VAR_43 = VAR_114(*VAR_6, **kwargs)\n",
"for VAR_38 in [x[0] for x in VAR_43.fields['method'].choices]:\n",
"if not check_upload_method_permissions(VAR_4, VAR_5, VAR_38):\n",
"if not VAR_4.has_perm('unit.review', VAR_5) and not VAR_114 == CLASS_16:\n",
"VAR_43.remove_translation_choice(VAR_38)\n",
"VAR_43.fields['conflicts'].choices = [choice for choice in VAR_43.fields[\n 'conflicts'].choices if choice[0] != 'approved']\n",
"return VAR_43\n"
] | [
"def get_upload_form(user, translation, *args, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"if user.has_perm('upload.authorship', translation):\n",
"form = ExtraUploadForm\n",
"if user.has_perm('upload.overwrite', translation):\n",
"kwargs['initial'] = {'author_name': user.full_name, 'author_email': user.email}\n",
"form = UploadForm\n",
"form = SimpleUploadForm\n",
"result = form(*args, **kwargs)\n",
"for method in [x[0] for x in result.fields['method'].choices]:\n",
"if not check_upload_method_permissions(user, translation, method):\n",
"if not user.has_perm('unit.review', translation\n",
"result.remove_translation_choice(method)\n",
"result.fields['conflicts'].choices = [choice for choice in result.fields[\n 'conflicts'].choices if choice[0] != 'approved']\n",
"return result\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Return'"
] |
[
"@FUNC_27(VAR_87=True)...\n",
"return 'pong'\n"
] | [
"@whitelist(allow_guest=True)...\n",
"return 'pong'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"VAR_9, VAR_15 = self.make_request('PUT', '/profile/%s/displayname' % (self.\n owner,), content=json.dumps({'displayname': 'test'}), VAR_7=self.owner_tok)\n",
"self.assertEqual(VAR_15.code, 200, VAR_15.result)\n",
"VAR_16 = self.get_displayname()\n",
"self.assertEqual(VAR_16, 'test')\n"
] | [
"def test_set_displayname(self):...\n",
"request, channel = self.make_request('PUT', '/profile/%s/displayname' % (\n self.owner,), content=json.dumps({'displayname': 'test'}), access_token\n =self.owner_tok)\n",
"self.assertEqual(channel.code, 200, channel.result)\n",
"res = self.get_displayname()\n",
"self.assertEqual(res, 'test')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = CLASS_1()\n",
"VAR_1.visit(ast.parse(VAR_0))\n",
"VAR_8 = CLASS_0(VAR_8)\n",
"return VAR_1.mongo_query\n",
"VAR_8.__traceback__ = sys.exc_info()[2]\n"
] | [
"def parse(expression):...\n",
"\"\"\"docstring\"\"\"\n",
"v = MongoVisitor()\n",
"v.visit(ast.parse(expression))\n",
"e = ParseError(e)\n",
"return v.mongo_query\n",
"e.__traceback__ = sys.exc_info()[2]\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Assign'"
] |
[
"@pytest.mark.django_db...\n",
"VAR_0.DEBUG = True\n",
"VAR_6 = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentKwargs' parent=view model=model\"\n )\n",
"VAR_7 = unicorn(None, VAR_6)\n",
"VAR_10 = CLASS_0(component_name='test', component_id='asdf')\n",
"VAR_11 = Flavor(pk=187)\n",
"VAR_8 = {'view': VAR_10, 'model': VAR_11}\n",
"VAR_7.render(VAR_8)\n",
"assert VAR_7.component_id == 'asdf:tests.templatetags.test_unicorn_render.FakeComponentKwargs:187'\n"
] | [
"@pytest.mark.django_db...\n",
"settings.DEBUG = True\n",
"token = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentKwargs' parent=view model=model\"\n )\n",
"unicorn_node = unicorn(None, token)\n",
"view = FakeComponentParent(component_name='test', component_id='asdf')\n",
"flavor = Flavor(pk=187)\n",
"context = {'view': view, 'model': flavor}\n",
"unicorn_node.render(context)\n",
"assert unicorn_node.component_id == 'asdf:tests.templatetags.test_unicorn_render.FakeComponentKwargs:187'\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assert'"
] |
[
"def FUNC_97(VAR_62):...\n",
"def FUNC_120():...\n",
"VAR_214 = VAR_1.db.get_value('DocType', VAR_62, 'module')\n",
"return VAR_1.module_app[FUNC_56(VAR_214)]\n"
] | [
"def get_doctype_app(doctype):...\n",
"def _get_doctype_app():...\n",
"doctype_module = local.db.get_value('DocType', doctype, 'module')\n",
"return local.module_app[scrub(doctype_module)]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_21(self):...\n",
"VAR_3 = self.client.post('/password_reset/', {'email':\n '[email protected]'})\n",
"self.assertEqual(VAR_3.status_code, 302)\n",
"self.assertURLEqual(VAR_3.url, '/password_reset/done/')\n"
] | [
"def test_reset_redirect_default(self):...\n",
"response = self.client.post('/password_reset/', {'email':\n '[email protected]'})\n",
"self.assertEqual(response.status_code, 302)\n",
"self.assertURLEqual(response.url, '/password_reset/done/')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/groups/local/%s/users/%s/remove', VAR_30, VAR_16)\n",
"return self.client.post_json(VAR_5=destination, VAR_2=path, VAR_39=content,\n VAR_15=True)\n"
] | [
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/groups/local/%s/users/%s/remove', group_id, user_id)\n",
"return self.client.post_json(destination=destination, path=path, data=\n content, ignore_backoff=True)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_9(VAR_20):...\n",
"return VAR_20.replace(VAR_4 + '/', '')\n"
] | [
"def _get_obj_path(obj_path):...\n",
"return obj_path.replace(DATAROOT + '/', '')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_64(self, VAR_112=VAR_3, VAR_134=VAR_3, VAR_135=VAR_3, VAR_136=VAR_3):...\n",
"if self.settings.reset_password_requires_verification:\n",
"return self.request_reset_password(VAR_112, VAR_134, VAR_135, VAR_136)\n",
"return self.reset_password_deprecated(VAR_112, VAR_134, VAR_135, VAR_136)\n"
] | [
"def retrieve_password(self, next=DEFAULT, onvalidation=DEFAULT, onaccept=...\n",
"if self.settings.reset_password_requires_verification:\n",
"return self.request_reset_password(next, onvalidation, onaccept, log)\n",
"return self.reset_password_deprecated(next, onvalidation, onaccept, log)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"from flask_login import current_user, logout_user\n",
"from flask_restful import Resource\n",
"from security_monkey import rbac\n",
"VAR_0 = [rbac.exempt]\n",
"def FUNC_0(self):...\n",
"if not current_user.is_authenticated():\n",
"return 'Must be logged in to log out', 200\n",
"logout_user()\n",
"return 'Logged Out', 200\n"
] | [
"from flask_login import current_user, logout_user\n",
"from flask_restful import Resource\n",
"from security_monkey import rbac\n",
"decorators = [rbac.exempt]\n",
"def get(self):...\n",
"if not current_user.is_authenticated():\n",
"return 'Must be logged in to log out', 200\n",
"logout_user()\n",
"return 'Logged Out', 200\n"
] | [
0,
0,
0,
0,
0,
4,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"@VAR_12.route('/scope/<dataset>')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = 'SELECT sequence_no, rel_path, download_link FROM ' + VAR_13\n",
"VAR_21 = []\n",
"VAR_22 = []\n",
"if VAR_14:\n",
"VAR_21.append('MATCH (title, keywords, description) AGAINST(%s)')\n",
"if VAR_15:\n",
"VAR_22.append(VAR_14)\n",
"VAR_21.append('(sequence_no % %s) ' + VAR_16)\n",
"if VAR_21:\n",
"VAR_22.extend([VAR_15])\n",
"VAR_20 += ' WHERE ' + ' AND '.join(VAR_21)\n",
"VAR_9.debug('Query used: %s, substitutes: %s', VAR_20, VAR_22)\n",
"def FUNC_6():...\n",
"VAR_26 = mysql.connector.connect(user=DB_USER, password=DB_PASSWORD, host=\n DB_HOST, database=DB_DBNAME, port=DB_PORT)\n",
"VAR_27 = VAR_26.cursor()\n",
"VAR_27.execute(VAR_20, VAR_22)\n",
"yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n",
"if VAR_1:\n",
"yield '<?xml-stylesheet type=\"text/xsl\" href=\"/scopelist.xsl\" ?>\\n'\n",
"yield '<objectlist>\\n'\n",
"for VAR_17, VAR_18, VAR_19 in VAR_27:\n",
"yield '<count adjust=\"1\"/>\\n'\n",
"yield '</objectlist>\\n'\n",
"yield FUNC_5(VAR_13, VAR_17, VAR_18, VAR_19) + '\\n'\n",
"VAR_23 = Headers([('Content-Type', 'text/xml')])\n",
"return Response(stream_with_context(FUNC_6()), status='200 OK', VAR_23=headers)\n"
] | [
"@scope_blueprint.route('/scope/<dataset>')...\n",
"\"\"\"docstring\"\"\"\n",
"query = 'SELECT sequence_no, rel_path, download_link FROM ' + dataset\n",
"conditions = []\n",
"substitutes = []\n",
"if keywords:\n",
"conditions.append('MATCH (title, keywords, description) AGAINST(%s)')\n",
"if divisor:\n",
"substitutes.append(keywords)\n",
"conditions.append('(sequence_no % %s) ' + expression)\n",
"if conditions:\n",
"substitutes.extend([divisor])\n",
"query += ' WHERE ' + ' AND '.join(conditions)\n",
"_log.debug('Query used: %s, substitutes: %s', query, substitutes)\n",
"def generate():...\n",
"cnx = mysql.connector.connect(user=DB_USER, password=DB_PASSWORD, host=\n DB_HOST, database=DB_DBNAME, port=DB_PORT)\n",
"cursor = cnx.cursor()\n",
"cursor.execute(query, substitutes)\n",
"yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n",
"if STYLE:\n",
"yield '<?xml-stylesheet type=\"text/xsl\" href=\"/scopelist.xsl\" ?>\\n'\n",
"yield '<objectlist>\\n'\n",
"for seq_no, rel_path, download_link in cursor:\n",
"yield '<count adjust=\"1\"/>\\n'\n",
"yield '</objectlist>\\n'\n",
"yield _get_object_element(dataset, seq_no, rel_path, download_link) + '\\n'\n",
"headers = Headers([('Content-Type', 'text/xml')])\n",
"return Response(stream_with_context(generate()), status='200 OK', headers=\n headers)\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
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"AugAssign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_104(self, VAR_148=None, VAR_188=None, VAR_11=None, VAR_189=None,...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_163(VAR_10):...\n",
"self.soap_procedures[VAR_148 or VAR_10.__name__\n ] = VAR_10, VAR_188, VAR_11, VAR_189, VAR_190\n",
"return VAR_10\n"
] | [
"def soap(self, name=None, returns=None, args=None, doc=None,...\n",
"\"\"\"docstring\"\"\"\n",
"def _soap(f):...\n",
"self.soap_procedures[name or f.__name__\n ] = f, returns, args, doc, response_element_name\n",
"return f\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"return '`tab{0}`.`{1}`'.format(*VAR_11)\n"
] | [
"@staticmethod...\n",
"return '`tab{0}`.`{1}`'.format(*parts)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_32 = self._req(None)\n",
"VAR_33 = VAR_32.headers\n",
"self.assertEqual(VAR_33.getRawHeaders(b'Content-Type'), [self.test_image.\n content_type])\n",
"self.assertEqual(VAR_33.getRawHeaders(b'Content-Disposition'), None)\n"
] | [
"def test_disposition_none(self):...\n",
"\"\"\"docstring\"\"\"\n",
"channel = self._req(None)\n",
"headers = channel.headers\n",
"self.assertEqual(headers.getRawHeaders(b'Content-Type'), [self.test_image.\n content_type])\n",
"self.assertEqual(headers.getRawHeaders(b'Content-Disposition'), None)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@transaction.non_atomic_requests...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n",
"VAR_65 = get_course_with_access(VAR_9.user, 'staff', VAR_10, depth=None)\n",
"if not VAR_65.entrance_exam_id:\n",
"return HttpResponseBadRequest(_('Course has no entrance exam section.'))\n",
"VAR_128 = VAR_9.GET.get('unique_student_identifier', None)\n",
"VAR_40 = None\n",
"if VAR_128 is not None:\n",
"VAR_40 = get_student_from_identifier(VAR_128)\n",
"VAR_129 = VAR_9.GET.get('all_students', False) in ['true', 'True', True]\n",
"VAR_130 = VAR_9.GET.get('delete_module', False) in ['true', 'True', True]\n",
"if VAR_129 and VAR_40:\n",
"return HttpResponseBadRequest(_(\n 'all_students and unique_student_identifier are mutually exclusive.'))\n",
"if VAR_129 and VAR_130:\n",
"return HttpResponseBadRequest(_(\n 'all_students and delete_module are mutually exclusive.'))\n",
"if VAR_129 or VAR_130:\n",
"if not has_access(VAR_9.user, 'instructor', VAR_65):\n",
"VAR_189 = VAR_10.make_usage_key_from_deprecated_string(VAR_65.entrance_exam_id)\n",
"return HttpResponseBadRequest(_('Course has no valid entrance exam section.'))\n",
"VAR_63 = {'student': VAR_128 or _('All Students'), 'task': 'created'}\n",
"return HttpResponseForbidden(_('Requires instructor access.'))\n",
"if VAR_130:\n",
"return JsonResponse(VAR_63)\n",
"instructor_task.api.submit_delete_entrance_exam_state_for_student(VAR_9,\n VAR_189, VAR_40)\n",
"instructor_task.api.submit_reset_problem_attempts_in_entrance_exam(VAR_9,\n VAR_189, VAR_40)\n"
] | [
"@transaction.non_atomic_requests...\n",
"\"\"\"docstring\"\"\"\n",
"course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n",
"course = get_course_with_access(request.user, 'staff', course_id, depth=None)\n",
"if not course.entrance_exam_id:\n",
"return HttpResponseBadRequest(_('Course has no entrance exam section.'))\n",
"student_identifier = request.GET.get('unique_student_identifier', None)\n",
"student = None\n",
"if student_identifier is not None:\n",
"student = get_student_from_identifier(student_identifier)\n",
"all_students = request.GET.get('all_students', False) in ['true', 'True', True]\n",
"delete_module = request.GET.get('delete_module', False) in ['true', 'True',\n True]\n",
"if all_students and student:\n",
"return HttpResponseBadRequest(_(\n 'all_students and unique_student_identifier are mutually exclusive.'))\n",
"if all_students and delete_module:\n",
"return HttpResponseBadRequest(_(\n 'all_students and delete_module are mutually exclusive.'))\n",
"if all_students or delete_module:\n",
"if not has_access(request.user, 'instructor', course):\n",
"entrance_exam_key = course_id.make_usage_key_from_deprecated_string(course.\n entrance_exam_id)\n",
"return HttpResponseBadRequest(_('Course has no valid entrance exam section.'))\n",
"response_payload = {'student': student_identifier or _('All Students'),\n 'task': 'created'}\n",
"return HttpResponseForbidden(_('Requires instructor access.'))\n",
"if delete_module:\n",
"return JsonResponse(response_payload)\n",
"instructor_task.api.submit_delete_entrance_exam_state_for_student(request,\n entrance_exam_key, student)\n",
"instructor_task.api.submit_reset_problem_attempts_in_entrance_exam(request,\n entrance_exam_key, student)\n"
] | [
0,
0,
0,
0,
0,
0,
3,
0,
0,
0,
3,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Expr'",
"Expr'"
] |
[
"@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2, 2),...\n",
"return VAR_44 + 2\n"
] | [
"@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2, 2),...\n",
"return x + 2\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_82(VAR_67):...\n",
"if not VAR_67.name in self.flags.notifications_executed:\n",
"evaluate_alert(self, VAR_67.name, VAR_67.event)\n",
"self.flags.notifications_executed.append(VAR_67.name)\n"
] | [
"def _evaluate_alert(alert):...\n",
"if not alert.name in self.flags.notifications_executed:\n",
"evaluate_alert(self, alert.name, alert.event)\n",
"self.flags.notifications_executed.append(alert.name)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@CLASS_4('settings')...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_3.path() == '/set':\n",
"return FUNC_14(VAR_3)\n",
"VAR_20 = jinja.render('settings.html', title='settings', configdata=\n configdata, confget=config.instance.get_str)\n",
"return 'text/html', VAR_20\n"
] | [
"@add_handler('settings')...\n",
"\"\"\"docstring\"\"\"\n",
"if url.path() == '/set':\n",
"return _qute_settings_set(url)\n",
"html = jinja.render('settings.html', title='settings', configdata=\n configdata, confget=config.instance.get_str)\n",
"return 'text/html', html\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_25(self):...\n",
"\"\"\"docstring\"\"\"\n",
"from django.contrib.sites.models import Site\n",
"from django.core.exceptions import ImproperlyConfigured\n",
"from django.urls import reverse\n",
"VAR_162 = Site.objects.get_current()\n",
"VAR_162 = Site(domain='configure-django-sites.com')\n",
"if helpdesk_settings.HELPDESK_USE_HTTPS_IN_EMAIL_LINK:\n",
"VAR_163 = 'https'\n",
"VAR_163 = 'http'\n",
"return u'%s://%s%s' % (VAR_163, VAR_162.domain, reverse('helpdesk:view',\n VAR_40=[self.id]))\n"
] | [
"def _get_staff_url(self):...\n",
"\"\"\"docstring\"\"\"\n",
"from django.contrib.sites.models import Site\n",
"from django.core.exceptions import ImproperlyConfigured\n",
"from django.urls import reverse\n",
"site = Site.objects.get_current()\n",
"site = Site(domain='configure-django-sites.com')\n",
"if helpdesk_settings.HELPDESK_USE_HTTPS_IN_EMAIL_LINK:\n",
"protocol = 'https'\n",
"protocol = 'http'\n",
"return u'%s://%s%s' % (protocol, site.domain, reverse('helpdesk:view', args\n =[self.id]))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_6: str) ->jinja2.Markup:...\n",
"return jinja2.Markup(bleach.linkify(bleach.clean(VAR_6, tags=ALLOWED_TAGS,\n attributes=ALLOWED_ATTRS, strip=True)))\n"
] | [
"def safe_markup(raw_html: str) ->jinja2.Markup:...\n",
"return jinja2.Markup(bleach.linkify(bleach.clean(raw_html, tags=\n ALLOWED_TAGS, attributes=ALLOWED_ATTRS, strip=True)))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"self.assert_expected(self.folder.t, 'CheckWithXMLHeader.html')\n"
] | [
"def testWithXMLHeader(self):...\n",
"self.assert_expected(self.folder.t, 'CheckWithXMLHeader.html')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = FUNC_1(VAR_3)\n",
"if not VAR_16 or not 'cmd' in VAR_1.form_dict or VAR_13.developer_mode:\n",
"print(VAR_3)\n",
"VAR_20.append({'exc': VAR_3})\n"
] | [
"def errprint(msg):...\n",
"\"\"\"docstring\"\"\"\n",
"msg = as_unicode(msg)\n",
"if not request or not 'cmd' in local.form_dict or conf.developer_mode:\n",
"print(msg)\n",
"error_log.append({'exc': msg})\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'"
] |
[
"async def FUNC_8(self, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = ((VAR_2, VAR_43) for VAR_2, VAR_47 in VAR_16.items() for VAR_43 in\n VAR_47.keys())\n",
"VAR_30 = await self.store.get_server_verify_keys(VAR_16)\n",
"VAR_31 = {}\n",
"for (VAR_2, VAR_43), VAR_49 in VAR_30.items():\n",
"VAR_31.setdefault(VAR_2, {})[VAR_43] = VAR_49\n",
"return VAR_31\n"
] | [
"async def get_keys(self, keys_to_fetch):...\n",
"\"\"\"docstring\"\"\"\n",
"keys_to_fetch = ((server_name, key_id) for server_name, keys_for_server in\n keys_to_fetch.items() for key_id in keys_for_server.keys())\n",
"res = await self.store.get_server_verify_keys(keys_to_fetch)\n",
"keys = {}\n",
"for (server_name, key_id), key in res.items():\n",
"keys.setdefault(server_name, {})[key_id] = key\n",
"return keys\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_2):...\n",
"if not VAR_2.config.can_load_media_repo:\n",
"super().__init__()\n",
"VAR_41 = VAR_2.get_media_repository()\n",
"self.putChild(b'upload', UploadResource(VAR_2, VAR_41))\n",
"self.putChild(b'download', DownloadResource(VAR_2, VAR_41))\n",
"self.putChild(b'thumbnail', ThumbnailResource(VAR_2, VAR_41, VAR_41.\n media_storage))\n",
"if VAR_2.config.url_preview_enabled:\n",
"self.putChild(b'preview_url', PreviewUrlResource(VAR_2, VAR_41, VAR_41.\n media_storage))\n",
"self.putChild(b'config', MediaConfigResource(VAR_2))\n"
] | [
"def __init__(self, hs):...\n",
"if not hs.config.can_load_media_repo:\n",
"super().__init__()\n",
"media_repo = hs.get_media_repository()\n",
"self.putChild(b'upload', UploadResource(hs, media_repo))\n",
"self.putChild(b'download', DownloadResource(hs, media_repo))\n",
"self.putChild(b'thumbnail', ThumbnailResource(hs, media_repo, media_repo.\n media_storage))\n",
"if hs.config.url_preview_enabled:\n",
"self.putChild(b'preview_url', PreviewUrlResource(hs, media_repo, media_repo\n .media_storage))\n",
"self.putChild(b'config', MediaConfigResource(hs))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@login_required(setGroupContext=True)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_54 = 'webclient/history/calendar.html'\n",
"VAR_192 = VAR_2.session.get('user_id')\n",
"if VAR_35 is not None and VAR_36 is not None:\n",
"VAR_193 = BaseCalendar(VAR_5=conn, VAR_35=year, VAR_36=month, eid=\n filter_user_id)\n",
"VAR_307 = datetime.datetime.today()\n",
"VAR_193.create_calendar()\n",
"VAR_193 = BaseCalendar(VAR_5=conn, VAR_35=today.year, VAR_36=today.month,\n eid=filter_user_id)\n",
"VAR_53 = {'controller': VAR_193}\n",
"VAR_53['template'] = VAR_54\n",
"return VAR_53\n"
] | [
"@login_required(setGroupContext=True)...\n",
"\"\"\"docstring\"\"\"\n",
"template = 'webclient/history/calendar.html'\n",
"filter_user_id = request.session.get('user_id')\n",
"if year is not None and month is not None:\n",
"controller = BaseCalendar(conn=conn, year=year, month=month, eid=filter_user_id\n )\n",
"today = datetime.datetime.today()\n",
"controller.create_calendar()\n",
"controller = BaseCalendar(conn=conn, year=today.year, month=today.month,\n eid=filter_user_id)\n",
"context = {'controller': controller}\n",
"context['template'] = template\n",
"return context\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"import asyncio\n",
"import enum\n",
"import inspect\n",
"import json\n",
"from typing import Any, Callable, Coroutine, Dict, List, Optional, Sequence, Set, Type, Union\n",
"from fastapi import params\n",
"from fastapi.datastructures import Default, DefaultPlaceholder\n",
"from fastapi.dependencies.models import Dependant\n",
"from fastapi.dependencies.utils import get_body_field, get_dependant, get_parameterless_sub_dependant, solve_dependencies\n",
"from fastapi.encoders import DictIntStrAny, SetIntStr, jsonable_encoder\n",
"from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError\n",
"from fastapi.openapi.constants import STATUS_CODES_WITH_NO_BODY\n",
"from fastapi.types import DecoratedCallable\n",
"from fastapi.utils import create_cloned_field, create_response_field, generate_operation_id_for_path, get_value_or_default\n",
"from pydantic import BaseModel\n",
"from pydantic.error_wrappers import ErrorWrapper, ValidationError\n",
"from pydantic.fields import ModelField\n",
"from starlette import routing\n",
"from starlette.concurrency import run_in_threadpool\n",
"from starlette.exceptions import HTTPException\n",
"from starlette.requests import Request\n",
"from starlette.responses import JSONResponse, Response\n",
"from starlette.routing import BaseRoute\n",
"from starlette.routing import Mount as Mount\n",
"from starlette.routing import compile_path, get_name, request_response, websocket_session\n",
"from starlette.status import WS_1008_POLICY_VIOLATION\n",
"from starlette.types import ASGIApp\n",
"from starlette.websockets import WebSocket\n",
"def FUNC_0(VAR_0: Any, *, VAR_1: bool, VAR_2: bool=False, VAR_3: bool=False...\n",
"if isinstance(VAR_0, BaseModel):\n",
"return VAR_0.dict(VAR_8=True, VAR_1=exclude_unset, VAR_2=exclude_defaults,\n VAR_3=exclude_none)\n",
"if isinstance(VAR_0, list):\n",
"return [FUNC_0(item, VAR_1=exclude_unset, VAR_2=exclude_defaults, VAR_3=\n exclude_none) for item in VAR_0]\n",
"if isinstance(VAR_0, dict):\n",
"return {k: FUNC_0(v, VAR_1=exclude_unset, VAR_2=exclude_defaults, VAR_3=\n exclude_none) for k, v in VAR_0.items()}\n",
"return VAR_0\n"
] | [
"import asyncio\n",
"import enum\n",
"import inspect\n",
"import json\n",
"from typing import Any, Callable, Coroutine, Dict, List, Optional, Sequence, Set, Type, Union\n",
"from fastapi import params\n",
"from fastapi.datastructures import Default, DefaultPlaceholder\n",
"from fastapi.dependencies.models import Dependant\n",
"from fastapi.dependencies.utils import get_body_field, get_dependant, get_parameterless_sub_dependant, solve_dependencies\n",
"from fastapi.encoders import DictIntStrAny, SetIntStr, jsonable_encoder\n",
"from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError\n",
"from fastapi.openapi.constants import STATUS_CODES_WITH_NO_BODY\n",
"from fastapi.types import DecoratedCallable\n",
"from fastapi.utils import create_cloned_field, create_response_field, generate_operation_id_for_path, get_value_or_default\n",
"from pydantic import BaseModel\n",
"from pydantic.error_wrappers import ErrorWrapper, ValidationError\n",
"from pydantic.fields import ModelField\n",
"from starlette import routing\n",
"from starlette.concurrency import run_in_threadpool\n",
"from starlette.exceptions import HTTPException\n",
"from starlette.requests import Request\n",
"from starlette.responses import JSONResponse, Response\n",
"from starlette.routing import BaseRoute\n",
"from starlette.routing import Mount as Mount\n",
"from starlette.routing import compile_path, get_name, request_response, websocket_session\n",
"from starlette.status import WS_1008_POLICY_VIOLATION\n",
"from starlette.types import ASGIApp\n",
"from starlette.websockets import WebSocket\n",
"def _prepare_response_content(res: Any, *, exclude_unset: bool,...\n",
"if isinstance(res, BaseModel):\n",
"return res.dict(by_alias=True, exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults, exclude_none=exclude_none)\n",
"if isinstance(res, list):\n",
"return [_prepare_response_content(item, exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults, exclude_none=exclude_none) for item in\n res]\n",
"if isinstance(res, dict):\n",
"return {k: _prepare_response_content(v, exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults, exclude_none=exclude_none) for k, v in\n res.items()}\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.