lines listlengths 1 383 | raw_lines listlengths 1 383 | label listlengths 1 383 | type listlengths 1 383 |
|---|---|---|---|
[
"def FUNC_14(self, VAR_6):...\n",
"if not self.query:\n",
"frappe.throw(_('Must specify a Query to run'), title=_('Report Document Error')\n )\n",
"if not self.query.lower().startswith('select'):\n",
"frappe.throw(_('Query must be a SELECT'), title=_('Report Document Error'))\n",
"VAR_15 = [list(t) for... | [
"def execute_query_report(self, filters):...\n",
"if not self.query:\n",
"frappe.throw(_('Must specify a Query to run'), title=_('Report Document Error')\n )\n",
"if not self.query.lower().startswith('select'):\n",
"frappe.throw(_('Query must be a SELECT'), title=_('Report Document Error'))\n",
"result... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@pytest.fixture...\n",
"VAR_3 = tempfile.mkdtemp()\n",
"VAR_4 = os.path.join(VAR_3, 'another_%s.txt' % VAR_0.node.name)\n",
"f.write(VAR_0.node.name)\n",
"return VAR_4\n"
] | [
"@pytest.fixture...\n",
"path = tempfile.mkdtemp()\n",
"file_name = os.path.join(path, 'another_%s.txt' % request.node.name)\n",
"f.write(request.node.name)\n",
"return file_name\n"
] | [
1,
1,
1,
0,
1
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@FUNC_0...\n",
"return ApplicationServiceScheduler(self)\n"
] | [
"@cache_in_self...\n",
"return ApplicationServiceScheduler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_25(VAR_9, VAR_5, VAR_10):...\n",
"VAR_13 = calibre_db.session.query(db.Tags).filter(db.Tags.id == VAR_5).first()\n",
"if VAR_13:\n",
"VAR_63, VAR_68, VAR_65 = calibre_db.fill_indexpage(VAR_9, 0, db.Books, db.\n Books.tags.any(db.Tags.id == VAR_5), [VAR_10[0][0], db.Series.name, db.\n Books.ser... | [
"def render_category_books(page, book_id, order):...\n",
"name = calibre_db.session.query(db.Tags).filter(db.Tags.id == book_id).first()\n",
"if name:\n",
"entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books,\n db.Books.tags.any(db.Tags.id == book_id), [order[0][0], db.Series.name,\n ... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"@VAR_0.route('/api/jobs/<int:job_id>/unpin', methods=['PUT'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_72 = current_user\n",
"VAR_40 = json.loads(VAR_72.pinned_jobs\n ) if VAR_72.pinned_jobs is not None else []\n",
"if VAR_9 in VAR_40:\n",
"VAR_40.remove(VAR_9)\n",
"VAR_72.pinned_jobs = json.dumps(VAR... | [
"@gui.route('/api/jobs/<int:job_id>/unpin', methods=['PUT'])...\n",
"\"\"\"docstring\"\"\"\n",
"u = current_user\n",
"pinned_jobs = json.loads(u.pinned_jobs) if u.pinned_jobs is not None else []\n",
"if job_id in pinned_jobs:\n",
"pinned_jobs.remove(job_id)\n",
"u.pinned_jobs = json.dumps(pinned_jobs)\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_44(VAR_121, VAR_8, VAR_122=None):...\n",
"if isinstance(VAR_121, dict) and VAR_8 in VAR_121:\n",
"return VAR_121[VAR_8] if VAR_8 in VAR_121 else VAR_122\n",
"if isinstance(VAR_121, tuple) and len(VAR_121) > 1 and isinstance(VAR_121[1\n",
"return VAR_121[1][VAR_8] if VAR_8 in VAR_121[1] else VAR_12... | [
"def config_extractor(item, key, default_value=None):...\n",
"if isinstance(item, dict) and key in item:\n",
"return item[key] if key in item else default_value\n",
"if isinstance(item, tuple) and len(item) > 1 and isinstance(item[1], dict\n",
"return item[1][key] if key in item[1] else default_value\n",
... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"VAR_0 = True\n",
"VAR_1 = 1000\n",
"if VAR_0:\n",
"if is_mobile:\n",
"import re\n",
"VAR_43.view = VAR_43.view.replace('default/', 'default.mobile/')\n",
"from gluon.admin import *\n",
"VAR_43.menu = []\n",
"from gluon.fileutils import abspath, read_file, write_file\n",
"from gluon.utils import w... | [
"EXPERIMENTAL_STUFF = True\n",
"MAXNFILES = 1000\n",
"if EXPERIMENTAL_STUFF:\n",
"if is_mobile:\n",
"import re\n",
"response.view = response.view.replace('default/', 'default.mobile/')\n",
"from gluon.admin import *\n",
"response.menu = []\n",
"from gluon.fileutils import abspath, read_file, write_f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Condition",
"Condition",
"Import'",
"Assign'",
"ImportFrom'",
"Assign'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"ImportFrom'",
"Condition",
"Assi... |
[
"def FUNC_65(self):...\n",
""
] | [
"def close(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_68(self, VAR_42=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_42:\n",
"VAR_42 = frappe.session.user\n",
"if hasattr(self.meta, 'track_views') and self.meta.track_views:\n",
"frappe.get_doc({'doctype': 'View Log', 'viewed_by': frappe.session.user,\n 'reference_doctype': self.doctype, 'r... | [
"def add_viewed(self, user=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not user:\n",
"user = frappe.session.user\n",
"if hasattr(self.meta, 'track_views') and self.meta.track_views:\n",
"frappe.get_doc({'doctype': 'View Log', 'viewed_by': frappe.session.user,\n 'reference_doctype': self.doctype, 'refe... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_40():...\n",
"VAR_90 = util.flask.check_lastmodified(VAR_103)\n",
"VAR_89 = util.flask.check_etag(VAR_104)\n",
"return VAR_90 and VAR_89\n"
] | [
"def check_etag_and_lastmodified():...\n",
"lastmodified_ok = util.flask.check_lastmodified(current_lastmodified)\n",
"etag_ok = util.flask.check_etag(current_etag)\n",
"return lastmodified_ok and etag_ok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"VAR_11, VAR_12, VAR_13, VAR_14 = self._makeTree()\n",
"VAR_16 = CLASS_1()\n",
"VAR_19 = 'http://test'\n",
"VAR_17 = FauxRequest(RESPONSE=response, URL=testURL, ACTUAL_URL=testURL)\n",
"VAR_12.REQUEST = VAR_17\n",
"VAR_15 = self._makeOne().__of__(VAR_12)\n",
"VAR_15.challeng... | [
"def test_challenge(self):...\n",
"rc, root, folder, object = self._makeTree()\n",
"response = FauxCookieResponse()\n",
"testURL = 'http://test'\n",
"request = FauxRequest(RESPONSE=response, URL=testURL, ACTUAL_URL=testURL)\n",
"root.REQUEST = request\n",
"helper = self._makeOne().__of__(root)\n",
"he... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_24(VAR_9, VAR_5, VAR_10):...\n",
"VAR_13 = calibre_db.session.query(db.Data).filter(db.Data.format == VAR_5.\n upper()).first()\n",
"if VAR_13:\n",
"VAR_63, VAR_68, VAR_65 = calibre_db.fill_indexpage(VAR_9, 0, db.Books, db.\n Books.data.any(db.Data.format == VAR_5.upper()), [VAR_10[0][0]])\n",... | [
"def render_formats_books(page, book_id, order):...\n",
"name = calibre_db.session.query(db.Data).filter(db.Data.format == book_id.\n upper()).first()\n",
"if name:\n",
"entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books,\n db.Books.data.any(db.Data.format == book_id.upper()), [or... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_16(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24 = ['asdf.com', 'asdf.net', 'www.as_df.org', 'as.d8f.ghj8.gov']\n",
"for i in VAR_24:\n",
"VAR_32 = urlize_quoted_links(i)\n",
"VAR_25 = ['mailto://asdf@fdf.com', 'asdf.netnet']\n",
"self.assertNotEqual(VAR_32, i)\n",
"for i in VAR_25:\n",
... | [
"def test_issue_1386(self):...\n",
"\"\"\"docstring\"\"\"\n",
"correct_urls = ['asdf.com', 'asdf.net', 'www.as_df.org', 'as.d8f.ghj8.gov']\n",
"for i in correct_urls:\n",
"res = urlize_quoted_links(i)\n",
"incorrect_urls = ['mailto://asdf@fdf.com', 'asdf.netnet']\n",
"self.assertNotEqual(res, i)\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_0: str) ->str:...\n",
"return stringcase.snakecase(FUNC_1(FUNC_0(VAR_0)))\n"
] | [
"def snake_case(value: str) ->str:...\n",
"return stringcase.snakecase(group_title(_sanitize(value)))\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = {}\n",
"if VAR_0 and hasattr(VAR_0, 'items'):\n",
"VAR_30 = []\n",
"return VAR_12\n",
"for k, VAR_39 in VAR_0.items():\n",
"if callable(VAR_39):\n",
"VAR_12.update(dict(VAR_30))\n",
"VAR_39 = VAR_39()\n",
"if isinstance(VAR_39, (tup... | [
"def url_params_from_lookup_dict(lookups):...\n",
"\"\"\"docstring\"\"\"\n",
"params = {}\n",
"if lookups and hasattr(lookups, 'items'):\n",
"items = []\n",
"return params\n",
"for k, v in lookups.items():\n",
"if callable(v):\n",
"params.update(dict(items))\n",
"v = v()\n",
"if isinstance(v, (t... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(VAR_0, VAR_1):...\n",
"return FUNC_0(VAR_0=request, VAR_1=pk, VAR_2='is_closed', VAR_3=False,\n VAR_4=Comment.UNCLOSED, VAR_5=_('The topic has been unlocked'))\n"
] | [
"def unlock(request, pk):...\n",
"return _moderate(request=request, pk=pk, field_name='is_closed', to_value=\n False, action=Comment.UNCLOSED, message=_('The topic has been unlocked'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@VAR_0.filter...\n",
"if isinstance(VAR_17, dict):\n",
"return 'class=nested'\n",
"if isinstance(VAR_17, list) and any([isinstance(item, (list, dict)) for\n",
"return 'class=nested'\n",
"return ''\n"
] | [
"@register.filter...\n",
"if isinstance(value, dict):\n",
"return 'class=nested'\n",
"if isinstance(value, list) and any([isinstance(item, (list, dict)) for item in\n",
"return 'class=nested'\n",
"return ''\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"For",
"Return'",
"Return'"
] |
[
"def FUNC_9(self, VAR_8, **VAR_4):...\n",
"self.layout.delete_row(VAR_8)\n",
"self.save_layout()\n"
] | [
"def dispatch_del_row(self, y, **kwargs):...\n",
"self.layout.delete_row(y)\n",
"self.save_layout()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/api/templates/<int:template_id>/full-print', methods=['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_95 = FUNC_58(f'/internal/templates/{VAR_19}/full-print', 'get')\n",
"return jsonify({'success': False, 'message': str(err)}), 400\n",
"return jsonify(VAR_95)\n"
] | [
"@gui.route('/api/templates/<int:template_id>/full-print', methods=['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"full_print_info = query_internal_api(\n f'/internal/templates/{template_id}/full-print', 'get')\n",
"return jsonify({'success': False, 'message': str(err)}), 400\n",
"return jsonify(full_print_i... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'",
"Return'"
] |
[
"@VAR_2.route('/cover/<int:book_id>')...\n",
"return get_book_cover(VAR_5)\n"
] | [
"@web.route('/cover/<int:book_id>')...\n",
"return get_book_cover(book_id)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_9(self, VAR_11=None, VAR_12=None, VAR_13=False, VAR_14=None,...\n",
"\"\"\"docstring\"\"\"\n",
"if self.flags.in_print:\n",
"return\n",
"self.flags.notifications_executed = []\n",
"if VAR_11 != None:\n",
"self.flags.ignore_permissions = VAR_11\n",
"if VAR_12 != None:\n",
"self.flags.ignore... | [
"def insert(self, ignore_permissions=None, ignore_links=None,...\n",
"\"\"\"docstring\"\"\"\n",
"if self.flags.in_print:\n",
"return\n",
"self.flags.notifications_executed = []\n",
"if ignore_permissions != None:\n",
"self.flags.ignore_permissions = ignore_permissions\n",
"if ignore_links != None:\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,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr... |
[
"def FUNC_76(VAR_43):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.core.doctype.data_import.data_import import import_doc\n",
"FUNC_76(VAR_43)\n"
] | [
"def import_doc(path):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.core.doctype.data_import.data_import import import_doc\n",
"import_doc(path)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Expr'"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_195 = 0\n",
"VAR_196 = 0\n",
"VAR_197 = []\n",
"_purgeCallback(VAR_2)\n",
"VAR_198 = VAR_2.GET.get('jobId', None)\n",
"if VAR_198 is not None:\n",
"VAR_198 = VAR_345(VAR_198)\n",
"if VAR_2.method == 'DELETE':\n",
"VAR_367 = omero.cmd.Hand... | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"in_progress = 0\n",
"failure = 0\n",
"new_results = []\n",
"_purgeCallback(request)\n",
"jobId = request.GET.get('jobId', None)\n",
"if jobId is not None:\n",
"jobId = str(jobId)\n",
"if request.method == 'DELETE':\n",
"prx = omero.cmd.Handle... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"A... |
[
"def FUNC_0(self):...\n",
"from zope.component import provideAdapter\n",
"from zope.traversing.adapters import DefaultTraversable\n",
"PlacelessSetup.setUp(self)\n",
"provideAdapter(DefaultTraversable, (None,))\n"
] | [
"def setUp(self):...\n",
"from zope.component import provideAdapter\n",
"from zope.traversing.adapters import DefaultTraversable\n",
"PlacelessSetup.setUp(self)\n",
"provideAdapter(DefaultTraversable, (None,))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Expr'"
] |
[
"@FUNC_0...\n",
"return StateResolutionHandler(self)\n"
] | [
"@cache_in_self...\n",
"return StateResolutionHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(VAR_2, VAR_3):...\n",
"warnings.warn('Deprecated. Use omeroweb.webgateway.util.get_longs()',\n DeprecationWarning)\n",
"return webgateway_get_longs(VAR_2, VAR_3)\n"
] | [
"def get_longs(request, name):...\n",
"warnings.warn('Deprecated. Use omeroweb.webgateway.util.get_longs()',\n DeprecationWarning)\n",
"return webgateway_get_longs(request, name)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_25(VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_52 = 'string'\n",
"VAR_53 = VAR_21.add_parser('scan', description=scan_msg, formatter_class=\n argparse.RawTextHelpFormatter)\n",
"VAR_53.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to execute'... | [
"def add_scan_subparser(subparsers):...\n",
"\"\"\"docstring\"\"\"\n",
"scan_msg = \"\"\"Usage example:\nTo scan for denylisted ops in SavedModel:\n$saved_model_cli scan --dir /tmp/saved_model\nTo scan a specific MetaGraph, pass in --tag_set\n\"\"\"\n",
"parser_scan = subparsers.add_parser('scan', description... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_1.route('/<bfile>/extension/<report_name>/')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_41, VAR_42 = g.ledger.extensions.template_and_extension(VAR_19)\n",
"return abort(404)\n",
"VAR_43 = render_template_string(VAR_41, VAR_42=extension)\n",
"return render_template('_layout.html', VAR_43=content, page_t... | [
"@app.route('/<bfile>/extension/<report_name>/')...\n",
"\"\"\"docstring\"\"\"\n",
"template, extension = g.ledger.extensions.template_and_extension(report_name)\n",
"return abort(404)\n",
"content = render_template_string(template, extension=extension)\n",
"return render_template('_layout.html', content=... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"VAR_5 = self._makeContext()\n",
"self.assertEqual(VAR_5.evaluate('x | python:int'), int)\n"
] | [
"def test_hybrid_with_python_expression_type_value_not_called(self):...\n",
"ec = self._makeContext()\n",
"self.assertEqual(ec.evaluate('x | python:int'), int)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = QSslSocket.defaultCiphers()\n",
"log.init.debug('Default Qt ciphers: {}'.format(', '.join(c.name() for c in\n VAR_7)))\n",
"VAR_8 = []\n",
"VAR_9 = []\n",
"for VAR_2 in VAR_7:\n",
"if FUNC_0(VAR_2):\n",
"log.init.debug('Disabling bad ciphe... | [
"def init():...\n",
"\"\"\"docstring\"\"\"\n",
"default_ciphers = QSslSocket.defaultCiphers()\n",
"log.init.debug('Default Qt ciphers: {}'.format(', '.join(c.name() for c in\n default_ciphers)))\n",
"good_ciphers = []\n",
"bad_ciphers = []\n",
"for cipher in default_ciphers:\n",
"if _is_secure_ciph... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(VAR_0, VAR_7, VAR_3=False):...\n",
"if VAR_3:\n",
"VAR_22 = ub.Shelf.id != VAR_3\n",
"VAR_22 = true()\n",
"if VAR_0.is_public == 1:\n",
"VAR_23 = ub.session.query(ub.Shelf).filter((ub.Shelf.name == VAR_7) & (ub.\n Shelf.is_public == 1)).filter(VAR_22).first() is None\n",
"VAR_23 = ub.sess... | [
"def check_shelf_is_unique(shelf, title, shelf_id=False):...\n",
"if shelf_id:\n",
"ident = ub.Shelf.id != shelf_id\n",
"ident = true()\n",
"if shelf.is_public == 1:\n",
"is_shelf_name_unique = ub.session.query(ub.Shelf).filter((ub.Shelf.name ==\n title) & (ub.Shelf.is_public == 1)).filter(ident).first... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(VAR_19, VAR_10, VAR_20, VAR_21, VAR_22, VAR_23):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_55 = CourseEnrollment.enroll(VAR_19, VAR_10, VAR_20=mode)\n",
"ManualEnrollmentAudit.create_manual_enrollment_audit(VAR_21, VAR_19.email,\n VAR_23, VAR_22, VAR_55)\n",
"VAR_0.info(u'user %s enrolled in th... | [
"def create_manual_course_enrollment(user, course_id, mode, enrolled_by,...\n",
"\"\"\"docstring\"\"\"\n",
"enrollment_obj = CourseEnrollment.enroll(user, course_id, mode=mode)\n",
"ManualEnrollmentAudit.create_manual_enrollment_audit(enrolled_by, user.\n email, state_transition, reason, enrollment_obj)\n"... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"async def FUNC_7(VAR_1, VAR_4):...\n",
"async def FUNC_6(VAR_6):...\n",
"VAR_7 = await VAR_4(VAR_6)\n",
"VAR_11 = VAR_5.get(ex.status)\n",
"return FUNC_6\n",
"VAR_11 = VAR_5.get(VAR_7.status)\n",
"if VAR_11 is None:\n",
"if VAR_11 is None:\n",
"return await FUNC_3(VAR_6, ex)\n",
"return await VAR... | [
"async def middleware(app, handler):...\n",
"async def middleware_handler(request):...\n",
"response = await handler(request)\n",
"override = overrides.get(ex.status)\n",
"return middleware_handler\n",
"override = overrides.get(response.status)\n",
"if override is None:\n",
"if override is None:\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"AsyncFunctionDef'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_27(self):...\n",
"if self.file_to_run:\n",
"return os.path.dirname(os.path.abspath(self.file_to_run))\n",
"return py3compat.getcwd()\n"
] | [
"def _notebook_dir_default(self):...\n",
"if self.file_to_run:\n",
"return os.path.dirname(os.path.abspath(self.file_to_run))\n",
"return py3compat.getcwd()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.get_success(self.inject_room_member(self.room1, self.u_alice,\n Membership.JOIN))\n",
"VAR_16 = self.get_success(self.inject_message(self.room1, self.u_alice, 't'))\n",
"VAR_14 = self.get_success(self.store.get_event(VAR_16.event_id))\n",
"self... | [
"def test_redact_censor(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.get_success(self.inject_room_member(self.room1, self.u_alice,\n Membership.JOIN))\n",
"msg_event = self.get_success(self.inject_message(self.room1, self.u_alice, 't')\n )\n",
"event = self.get_success(self.store.get_event(msg_event... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_39(VAR_16, VAR_17):...\n",
"return config.set_from_dictionary(VAR_16, VAR_17, lambda y: y == 'on', False)\n"
] | [
"def _config_checkbox(to_save, x):...\n",
"return config.set_from_dictionary(to_save, x, lambda y: y == 'on', False)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12(self, VAR_13, VAR_8, **VAR_4):...\n",
"self.layout.delete_cell(VAR_13, VAR_8)\n",
"self.save_layout()\n"
] | [
"def dispatch_del_cell(self, x, y, **kwargs):...\n",
"self.layout.delete_cell(x, y)\n",
"self.save_layout()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_85(VAR_144, VAR_145=1):...\n",
"from frappe.utils.response import json_handler\n",
"return json.dumps(VAR_144, VAR_145=indent, sort_keys=True, VAR_47=\n json_handler, separators=(',', ': '))\n"
] | [
"def as_json(obj, indent=1):...\n",
"from frappe.utils.response import json_handler\n",
"return json.dumps(obj, indent=indent, sort_keys=True, default=json_handler,\n separators=(',', ': '))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Return'"
] |
[
"def FUNC_153(VAR_114):...\n",
"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... | [
"def decorator(action):...\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 c... | [
0,
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'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Return'",
"Return'",
"Expr'",
"Assign'",
"Ret... |
[
"def FUNC_29(self):...\n",
"self.called = True\n"
] | [
"def to_html(self):...\n",
"self.called = True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_115(VAR_129):...\n",
"VAR_83.append(VAR_129)\n",
"VAR_86[VAR_129] = VAR_89\n",
"if VAR_87:\n",
"VAR_84.append(VAR_129)\n",
"return VAR_129\n",
"if VAR_88:\n",
"VAR_85.append(VAR_129)\n"
] | [
"def innerfn(fn):...\n",
"whitelisted.append(fn)\n",
"allowed_http_methods_for_whitelisted_func[fn] = methods\n",
"if allow_guest:\n",
"guest_methods.append(fn)\n",
"return fn\n",
"if xss_safe:\n",
"xss_safe_methods.append(fn)\n"
] | [
0,
2,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_22(self):...\n",
"self.parser = saved_model_cli.create_parser()\n",
"VAR_9 = test.test_src_dir_path(VAR_0)\n",
"VAR_41 = os.path.join(test.get_temp_dir(), 'new_dir')\n",
"VAR_10 = self.parser.parse_args(['run', '--dir', VAR_9, '--tag_set',\n 'serve', '--signature_def', 'regress_x_to_y', '--inpu... | [
"def testRunCommandInputExamples(self):...\n",
"self.parser = saved_model_cli.create_parser()\n",
"base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n",
"output_dir = os.path.join(test.get_temp_dir(), 'new_dir')\n",
"args = self.parser.parse_args(['run', '--dir', base_path, '--tag_set',\n 'serve', '--... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"VAR_5 = {'senders': ['@flibble:wibble']}\n",
"VAR_6 = FUNC_0(sender='@flibble:wibble', type='com.nom.nom.nom', room_id=\n '!foo:bar')\n",
"self.assertTrue(Filter(VAR_5).check(VAR_6))\n"
] | [
"def test_definition_senders_works_with_literals(self):...\n",
"definition = {'senders': ['@flibble:wibble']}\n",
"event = MockEvent(sender='@flibble:wibble', type='com.nom.nom.nom', room_id\n ='!foo:bar')\n",
"self.assertTrue(Filter(definition).check(event))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_54(self, VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"return '<strong>%s</strong>' % VAR_14\n"
] | [
"def double_emphasis(self, text):...\n",
"\"\"\"docstring\"\"\"\n",
"return '<strong>%s</strong>' % text\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_15(self, VAR_24: str) ->str:...\n",
"if self.hs.config.email_riot_base_url:\n",
"VAR_70 = '%s/#/room' % self.hs.config.email_riot_base_url\n",
"if self.app_name == 'Vector':\n",
"return '%s/%s' % (VAR_70, VAR_24)\n",
"VAR_70 = 'https://vector.im/beta/#/room'\n",
"VAR_70 = 'https://matrix.to/#'... | [
"def make_room_link(self, room_id: str) ->str:...\n",
"if self.hs.config.email_riot_base_url:\n",
"base_url = '%s/#/room' % self.hs.config.email_riot_base_url\n",
"if self.app_name == 'Vector':\n",
"return '%s/%s' % (base_url, room_id)\n",
"base_url = 'https://vector.im/beta/#/room'\n",
"base_url = 'htt... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"async def FUNC_3(self):...\n",
"VAR_17 = await push_tools.get_badge_count(self.hs.get_datastore(), self.\n user_id, group_by_room=self._group_unread_count_by_room)\n",
"await self._send_badge(VAR_17)\n"
] | [
"async def _update_badge(self):...\n",
"badge = await push_tools.get_badge_count(self.hs.get_datastore(), self.\n user_id, group_by_room=self._group_unread_count_by_room)\n",
"await self._send_badge(badge)\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_114(self, VAR_137='1.1'):...\n",
""
] | [
"def serve_soap(self, version='1.1'):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_68():...\n",
"VAR_54 = []\n",
"if VAR_136['grabData'] and VAR_136['ctx'] == 'imgs':\n",
"VAR_284 = min(VAR_136['start'], len(VAR_283) - 1)\n",
"return [VAR_30.simpleMarshal(VAR_121=xtra, parents=opts['parents']) for\n VAR_30 in VAR_283]\n",
"if VAR_136['limit'] == 0:\n",
"VAR_317 = len(VAR_... | [
"def marshal():...\n",
"rv = []\n",
"if opts['grabData'] and opts['ctx'] == 'imgs':\n",
"bottom = min(opts['start'], len(sr) - 1)\n",
"return [x.simpleMarshal(xtra=xtra, parents=opts['parents']) for x in sr]\n",
"if opts['limit'] == 0:\n",
"top = len(sr)\n",
"top = min(len(sr), bottom + opts['limit'])... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_2.route('/admin/ajaxconfig', methods=['POST'])...\n",
"return FUNC_49()\n"
] | [
"@admi.route('/admin/ajaxconfig', methods=['POST'])...\n",
"return _configuration_update_helper()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_1(VAR_3, VAR_4='EDIT', VAR_5=None, VAR_6=0):...\n",
"VAR_20 = os.path.join(apath(VAR_3, VAR_122=request), 'progress.log')\n",
"VAR_21 = str(request.now)[:19]\n",
"if not os.path.exists(VAR_20):\n",
"FUNC_2(VAR_20, 'w').write('[%s] START\\n' % VAR_21)\n",
"if VAR_5:\n",
"FUNC_2(VAR_20, 'a').wri... | [
"def log_progress(app, mode='EDIT', filename=None, progress=0):...\n",
"progress_file = os.path.join(apath(app, r=request), 'progress.log')\n",
"now = str(request.now)[:19]\n",
"if not os.path.exists(progress_file):\n",
"safe_open(progress_file, 'w').write('[%s] START\\n' % now)\n",
"if filename:\n",
"s... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_28(VAR_10, VAR_11):...\n",
"VAR_69 = VAR_11()\n",
"if VAR_10['Element'] in VAR_69:\n",
"VAR_69.remove(VAR_10['Element'])\n",
"return ','.join(VAR_69)\n"
] | [
"def restriction_deletion(element, list_func):...\n",
"elementlist = list_func()\n",
"if element['Element'] in elementlist:\n",
"elementlist.remove(element['Element'])\n",
"return ','.join(elementlist)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_4(VAR_7, VAR_6, VAR_8=False, VAR_9='', VAR_10=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return FUNC_14(VAR_7, VAR_8, VAR_9, VAR_10)\n",
"import pwd\n",
"VAR_38 = pwd.getpwnam(VAR_6)\n",
"VAR_49 = (\n 'Failed to prepare the Salt environment for user {0}. The... | [
"def verify_env(dirs, user, permissive=False, pki_dir='', skip_extra=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return win_verify_env(dirs, permissive, pki_dir, skip_extra)\n",
"import pwd\n",
"pwnam = pwd.getpwnam(user)\n",
"err = (\n 'Failed to prepare the Salt envi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Import'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"... |
[
"def FUNC_5():...\n",
"yield FUNC_2(VAR_4)\n",
"yield from FUNC_1(VAR_2, VAR_3)\n",
"yield f\"\"\"\nERROR: Got exception when reading output from script: {type(e)}\n\"\"\"\n",
"yield traceback.format_exc()\n"
] | [
"def _generate_output():...\n",
"yield _create_cmd_header(commands)\n",
"yield from _run_script_and_generate_stream(req_to_args, cmd)\n",
"yield f\"\"\"\nERROR: Got exception when reading output from script: {type(e)}\n\"\"\"\n",
"yield traceback.format_exc()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/run/<int:qrun_id>/meta')...\n",
"VAR_27 = g.conn.session.query(QueryRun).get(VAR_7)\n",
"if not VAR_27:\n",
"return Response('No such query run id', status=404)\n",
"return Response(json.dumps({'run': VAR_27, 'rev': VAR_27.rev, 'query':\n VAR_27.rev.query}, default=json_formatter), mimety... | [
"@app.route('/run/<int:qrun_id>/meta')...\n",
"qrun = g.conn.session.query(QueryRun).get(qrun_id)\n",
"if not qrun:\n",
"return Response('No such query run id', status=404)\n",
"return Response(json.dumps({'run': qrun, 'rev': qrun.rev, 'query': qrun.rev\n .query}, default=json_formatter), mimetype='appli... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_68(self, VAR_42=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_42:\n",
"VAR_42 = frappe.session.user\n",
"if hasattr(self.meta, 'track_views') and self.meta.track_views:\n",
"frappe.get_doc({'doctype': 'View Log', 'viewed_by': frappe.session.user,\n 'reference_doctype': self.doctype, 'r... | [
"def add_viewed(self, user=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not user:\n",
"user = frappe.session.user\n",
"if hasattr(self.meta, 'track_views') and self.meta.track_views:\n",
"frappe.get_doc({'doctype': 'View Log', 'viewed_by': frappe.session.user,\n 'reference_doctype': self.doctype, 'refe... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.streamer.on_notifier_poke()\n",
"self.pump()\n"
] | [
"def replicate(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.streamer.on_notifier_poke()\n",
"self.pump()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_47(VAR_136, VAR_38):...\n",
""
] | [
"def f(x, k):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(VAR_7: Any, VAR_8: Text='', VAR_9: Text='w+') ->Text:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = None if 'b' in VAR_9 else rasa.shared.utils.io.DEFAULT_ENCODING\n",
"VAR_18 = tempfile.NamedTemporaryFile(VAR_9=mode, VAR_8=suffix, delete=False,\n VAR_17=encoding)\n",
"VAR_18.write(VAR_7)\n",
... | [
"def create_temporary_file(data: Any, suffix: Text='', mode: Text='w+') ->Text:...\n",
"\"\"\"docstring\"\"\"\n",
"encoding = None if 'b' in mode else rasa.shared.utils.io.DEFAULT_ENCODING\n",
"f = tempfile.NamedTemporaryFile(mode=mode, suffix=suffix, delete=False,\n encoding=encoding)\n",
"f.write(data)... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_118():...\n",
"VAR_14 = CLASS_6()\n",
"VAR_194.acquire()\n",
"VAR_195.acquire()\n",
"VAR_14.x = 7\n",
"VAR_194.release()\n",
"VAR_195.release()\n"
] | [
"def f():...\n",
"c = PluginManager()\n",
"lock1.acquire()\n",
"lock2.acquire()\n",
"c.x = 7\n",
"lock1.release()\n",
"lock2.release()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_47(VAR_136, VAR_38):...\n",
""
] | [
"def f(x, k):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_13():...\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 count=\"{:d}\">\\n'.format(VAR_43)\n",
"VAR_44 = 0\n",
"VAR_45 = 0\n",
"if VAR_27:\n",
"VAR_44 = int(VAR... | [
"def generate():...\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 count=\"{:d}\">\\n'.format(total_entries)\n",
"mix_per_iteration = 0\n",
"iteration_count = 0\n",
"if mak... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@VAR_2.route('/get_matching_tags', methods=['GET'])...\n",
"VAR_60 = {'tags': []}\n",
"VAR_21 = calibre_db.session.query(db.Books).filter(calibre_db.\n common_filters(True))\n",
"calibre_db.session.connection().connection.connection.create_function('lower',\n 1, db.lcase)\n",
"VAR_61 = request.args.g... | [
"@web.route('/get_matching_tags', methods=['GET'])...\n",
"tag_dict = {'tags': []}\n",
"q = calibre_db.session.query(db.Books).filter(calibre_db.common_filters(True))\n",
"calibre_db.session.connection().connection.connection.create_function('lower',\n 1, db.lcase)\n",
"author_input = request.args.get('a... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"For",
"For",
"Assign'",
"For",
"Assign'",
"Condition",
"Return'",
"Expr'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_65 = VAR_15()\n",
"VAR_67 = VAR_42.parse_args(VAR_40)\n",
"VAR_8 = FUNC_4(VAR_9=config_args.config_path)\n",
"if not VAR_8:\n",
"VAR_42.error('Must supply a config file.')\n",
"if VAR_67.keys_directory:\n",
"VAR_29 = VAR_67.keys_directory\n",
"V... | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"obj = cls()\n",
"config_args = parser.parse_args(argv)\n",
"config_files = find_config_files(search_paths=config_args.config_path)\n",
"if not config_files:\n",
"parser.error('Must supply a config file.')\n",
"if config_args.keys_directory:\n",
"confi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_11, VAR_12='/'):...\n",
"\"\"\"docstring\"\"\"\n",
"return force_text(urllib_parse.quote(force_str(VAR_11), force_str(VAR_12)))\n"
] | [
"def urlquote(url, safe='/'):...\n",
"\"\"\"docstring\"\"\"\n",
"return force_text(urllib_parse.quote(force_str(url), force_str(safe)))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_32(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.tornado_settings['allow_origin'] = self.allow_origin\n",
"if self.allow_origin_pat:\n",
"self.tornado_settings['allow_origin_pat'] = re.compile(self.allow_origin_pat)\n",
"self.tornado_settings['allow_credentials'] = self.allow_credentials\n",
... | [
"def init_webapp(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.tornado_settings['allow_origin'] = self.allow_origin\n",
"if self.allow_origin_pat:\n",
"self.tornado_settings['allow_origin_pat'] = re.compile(self.allow_origin_pat)\n",
"self.tornado_settings['allow_credentials'] = self.allow_credentials\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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Condi... |
[
"def FUNC_32(VAR_87):...\n",
"VAR_86.update(to_bytes(VAR_87, encoding='utf-8', errors='replace'))\n"
] | [
"def hash_update(value):...\n",
"hash.update(to_bytes(value, encoding='utf-8', errors='replace'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_1, VAR_2, *VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_1 + VAR_2 % tuple(urllib.parse.quote(arg, '') for arg in VAR_3)\n"
] | [
"def _create_path(federation_prefix, path, *args):...\n",
"\"\"\"docstring\"\"\"\n",
"return federation_prefix + path % tuple(urllib.parse.quote(arg, '') for arg in\n args)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_119(VAR_174):...\n",
"for df in VAR_174.meta.get('fields', {'no_copy': 1}):\n",
"if hasattr(VAR_174, df.fieldname):\n",
"VAR_174.set(df.fieldname, None)\n"
] | [
"def remove_no_copy_fields(d):...\n",
"for df in d.meta.get('fields', {'no_copy': 1}):\n",
"if hasattr(d, df.fieldname):\n",
"d.set(df.fieldname, None)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_2):...\n",
"if not VAR_2.is_public and not VAR_2.user_id == int(current_user.id):\n",
"VAR_1.error('User %s not allowed to edit shelf %s', current_user, VAR_2)\n",
"if VAR_2.is_public and not current_user.role_edit_shelfs():\n",
"return False\n",
"VAR_1.info('User %s not allowed to edit pu... | [
"def check_shelf_edit_permissions(cur_shelf):...\n",
"if not cur_shelf.is_public and not cur_shelf.user_id == int(current_user.id):\n",
"log.error('User %s not allowed to edit shelf %s', current_user, cur_shelf)\n",
"if cur_shelf.is_public and not current_user.role_edit_shelfs():\n",
"return False\n",
"lo... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"import json\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.http import Http404, HttpResponse\n",
"from django.contrib import messages\n",
"fr... | [
"import json\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.http import Http404, HttpResponse\n",
"from django.contrib import messages\n",
"fr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
... |
[
"async def FUNC_8(self, VAR_23: str, VAR_16: Optional[Mapping[str, Union[str,...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0.debug('post_urlencoded_get_json args: %s', VAR_16)\n",
"VAR_45 = FUNC_4(VAR_16)\n",
"VAR_46 = {b'Content-Type': [b'application/x-www-form-urlencoded'],\n b'User-Agent': [self.user_agent]... | [
"async def post_urlencoded_get_json(self, uri: str, args: Optional[Mapping[...\n",
"\"\"\"docstring\"\"\"\n",
"logger.debug('post_urlencoded_get_json args: %s', args)\n",
"query_bytes = encode_query_args(args)\n",
"actual_headers = {b'Content-Type': [b'application/x-www-form-urlencoded'],\n b'User-Agent'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"if self.docstatus == None:\n",
"self.docstatus = 0\n",
"for VAR_21 in self.get_all_children():\n",
"VAR_21.docstatus = self.docstatus\n"
] | [
"def set_docstatus(self):...\n",
"if self.docstatus == None:\n",
"self.docstatus = 0\n",
"for d in self.get_all_children():\n",
"d.docstatus = self.docstatus\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"For",
"Assign'"
] |
[
"@FUNC_0...\n",
"return SyncHandler(self)\n"
] | [
"@cache_in_self...\n",
"return SyncHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self._make_request(b'OPTIONS', b'/res/')\n",
"self.assertEqual(VAR_6.result['code'], b'204')\n",
"self.assertNotIn('body', VAR_6.result)\n",
"self.assertTrue(VAR_6.headers.hasHeader(b'Access-Control-Allow-Origin'),\n 'has CORS Origin header'... | [
"def test_known_options_request(self):...\n",
"\"\"\"docstring\"\"\"\n",
"channel = self._make_request(b'OPTIONS', b'/res/')\n",
"self.assertEqual(channel.result['code'], b'204')\n",
"self.assertNotIn('body', channel.result)\n",
"self.assertTrue(channel.headers.hasHeader(b'Access-Control-Allow-Origin'),\n... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_19(VAR_5):...\n",
"if VAR_5 != '0':\n",
"if not calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns\n",
"return True\n",
"return False\n"
] | [
"def check_valid_restricted_column(column):...\n",
"if column != '0':\n",
"if not calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_38(self):...\n",
"if self.project != self.cleaned_data['project']:\n",
"return self.cleaned_data['project']\n"
] | [
"def clean_project(self):...\n",
"if self.project != self.cleaned_data['project']:\n",
"return self.cleaned_data['project']\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"@staticmethod...\n",
"if VAR_10.startswith('/private/'):\n",
"VAR_10 = VAR_10[8:]\n",
"return 'private' in VAR_10 or VAR_10.startswith('.') or VAR_10.endswith('~')\n"
] | [
"@staticmethod...\n",
"if f.startswith('/private/'):\n",
"f = f[8:]\n",
"return 'private' in f or f.startswith('.') or f.endswith('~')\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_6(VAR_2, VAR_6, VAR_10=size, **kwargs)\n"
] | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"return render_thumbnail(request, iid, w=size, **kwargs)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_27(self, VAR_44):...\n",
"VAR_14 = VAR_44.group(1)\n",
"return self.renderer.escape(VAR_14)\n"
] | [
"def output_escape(self, m):...\n",
"text = m.group(1)\n",
"return self.renderer.escape(text)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"return self.cleaned_data['q']\n"
] | [
"def get_search_query(self):...\n",
"return self.cleaned_data['q']\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"VAR_5 = self.get_credits('json')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"self.assertJSONEqual(VAR_5.content.decode(), [{'Czech': [[\n 'weblate@example.org', 'Weblate Test', 1]]}])\n"
] | [
"def test_credits_view_json(self):...\n",
"response = self.get_credits('json')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertJSONEqual(response.content.decode(), [{'Czech': [[\n 'weblate@example.org', 'Weblate Test', 1]]}])\n"
] | [
0,
0,
0,
2
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_4, *VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"@defer.inlineCallbacks...\n",
"VAR_50 = yield VAR_4.verify_json_for_server(*VAR_2)\n",
"return VAR_50\n"
] | [
"def _verify_json_for_server(kr, *args):...\n",
"\"\"\"docstring\"\"\"\n",
"@defer.inlineCallbacks...\n",
"rv1 = yield kr.verify_json_for_server(*args)\n",
"return rv1\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'"
] |
[
"@transaction.non_atomic_requests...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_38 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n",
"instructor_task.api.submit_executive_summary_report(VAR_9, VAR_38)\n",
"VAR_178 = _('string')\n",
"return JsonResponse({'status': VAR_178})\n",
"VAR_178 = _('string')... | [
"@transaction.non_atomic_requests...\n",
"\"\"\"docstring\"\"\"\n",
"course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n",
"instructor_task.api.submit_executive_summary_report(request, course_key)\n",
"status_response = _(\n 'The executive summary report is currently being created. T... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_18(self, VAR_2, VAR_22, *VAR_23, **VAR_24):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def prepare_context(self, request, context, *args, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_28(VAR_0, VAR_1):...\n",
"VAR_8 = VAR_1.get('/config')\n",
"assert VAR_8.status_code == 200\n",
"assert b'Edit Config' in VAR_8.data\n"
] | [
"def test_get_config_page(test_app, client):...\n",
"resp = client.get('/config')\n",
"assert resp.status_code == 200\n",
"assert b'Edit Config' in resp.data\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_39(VAR_62, VAR_101=None, VAR_102=None, VAR_103=False):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.model.create_new import get_new_doc\n",
"return get_new_doc(VAR_62, VAR_101, VAR_102, VAR_103=as_dict)\n"
] | [
"def new_doc(doctype, parent_doc=None, parentfield=None, as_dict=False):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.model.create_new import get_new_doc\n",
"return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Return'"
] |
[
"@VAR_0.route('/api/jobs/<int:job_id>/subjobs/<int:subjob_id>/copy', methods...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_98 = FUNC_58(f'/internal/jobs/{VAR_9}/subjobs/{VAR_11}/copy', 'put')\n",
"return jsonify({'success': False, 'message': str(err)}), 400\n",
"return jsonify(VAR_98)\n"
] | [
"@gui.route('/api/jobs/<int:job_id>/subjobs/<int:subjob_id>/copy', methods=[...\n",
"\"\"\"docstring\"\"\"\n",
"response_info = query_internal_api(\n f'/internal/jobs/{job_id}/subjobs/{subjob_id}/copy', 'put')\n",
"return jsonify({'success': False, 'message': str(err)}), 400\n",
"return jsonify(response_... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'",
"Return'"
] |
[
"@VAR_0.filter(needs_autoescape=True)...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_23(VAR_48, VAR_49=VAR_29):...\n",
"return VAR_49 is not None and (len(VAR_48) > VAR_49 and '%s...' % VAR_48[:\n max(0, VAR_49 - 3)]) or VAR_48\n"
] | [
"@register.filter(needs_autoescape=True)...\n",
"\"\"\"docstring\"\"\"\n",
"def trim_url(x, limit=trim_url_limit):...\n",
"return limit is not None and (len(x) > limit and '%s...' % x[:max(0, limit -\n 3)]) or x\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_28(VAR_24):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to convert')\n",
"VAR_24.add_argument('--output_prefix', type=str, required=True, help=\n 'output directory + filename prefix for the resulting head... | [
"def _parse_common_freeze_and_aot(parser_compile):...\n",
"\"\"\"docstring\"\"\"\n",
"parser_compile.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to convert')\n",
"parser_compile.add_argument('--output_prefix', type=str, required=True,\n help=\n 'output ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_81(VAR_62, VAR_143=True):...\n",
"\"\"\"docstring\"\"\"\n",
"import frappe.desk.reportview\n",
"return frappe.desk.reportview.build_match_conditions(VAR_62, VAR_143=\n as_condition)\n"
] | [
"def build_match_conditions(doctype, as_condition=True):...\n",
"\"\"\"docstring\"\"\"\n",
"import frappe.desk.reportview\n",
"return frappe.desk.reportview.build_match_conditions(doctype, as_condition=\n as_condition)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Import'",
"Return'"
] |
[
"def FUNC_45(self, VAR_54, VAR_55):...\n",
"return VAR_54 * VAR_55\n"
] | [
"def multiply(self, a, b):...\n",
"return a * b\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_53.session.save()\n",
"VAR_40 = VAR_53.serving.request.hooks['before_finalize']\n",
"VAR_41 = VAR_53.lib.sessions.save\n",
"VAR_40[:] = [h for h in VAR_40 if h.callback is not VAR_41]\n"
] | [
"def _save_and_release_session():...\n",
"\"\"\"docstring\"\"\"\n",
"cherrypy.session.save()\n",
"hooks = cherrypy.serving.request.hooks['before_finalize']\n",
"forbidden = cherrypy.lib.sessions.save\n",
"hooks[:] = [h for h in hooks if h.callback is not forbidden]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_64(VAR_37):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_146 = re.split('[\\\\n\\\\r\\\\s,]', VAR_37)\n",
"VAR_146 = [s.strip() for s in VAR_146]\n",
"VAR_146 = [s for s in VAR_146 if s != '']\n",
"return VAR_146\n"
] | [
"def _split_input_list(str_list):...\n",
"\"\"\"docstring\"\"\"\n",
"new_list = re.split('[\\\\n\\\\r\\\\s,]', str_list)\n",
"new_list = [s.strip() for s in new_list]\n",
"new_list = [s for s in new_list if s != '']\n",
"return new_list\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_30(self):...\n",
"VAR_22 = models.Band.objects.create(name='Linkin Park')\n",
"VAR_36 = models.Member.objects.create(name='Chester')\n",
"VAR_37 = models.Member.objects.create(name='Mike')\n",
"VAR_22.members.add(VAR_36, VAR_37)\n",
"VAR_29 = models.Band._meta.get_field('members').rel\n",
"VAR... | [
"def test_render(self):...\n",
"band = models.Band.objects.create(name='Linkin Park')\n",
"m1 = models.Member.objects.create(name='Chester')\n",
"m2 = models.Member.objects.create(name='Mike')\n",
"band.members.add(m1, m2)\n",
"rel = models.Band._meta.get_field('members').rel\n",
"w = widgets.ManyToMany... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"__version__ = '4.6.2'\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"import os\n",
"VAR_0 = __path__[0]\n",
"VAR_1 = os.path.join(VAR_0, 'includes')\n",
"VAR_2 = [VAR_1, VAR_0]\n",
"for name in os.listdir(VAR_1):\n",
"VAR_3 = os.path.join(VAR_1, name)\n",
"return VAR_2\n",
"if os.path.is... | [
"__version__ = '4.6.2'\n",
"def get_include():...\n",
"\"\"\"docstring\"\"\"\n",
"import os\n",
"lxml_path = __path__[0]\n",
"include_path = os.path.join(lxml_path, 'includes')\n",
"includes = [include_path, lxml_path]\n",
"for name in os.listdir(include_path):\n",
"path = os.path.join(include_path,... | [
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"FunctionDef'",
"Docstring",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"@FUNC_0...\n",
"return ReplicationCommandHandler(self)\n"
] | [
"@cache_in_self...\n",
"return ReplicationCommandHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/groups/%s/roles/%s', VAR_30, VAR_34)\n",
"return self.client.delete_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'requester_user_id': requester_user_id}, VAR_15=True)\n"
] | [
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/groups/%s/roles/%s', group_id, role_id)\n",
"return self.client.delete_json(destination=destination, path=path, args={\n 'requester_user_id': requester_user_id}, ignore_backoff=True)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from django.http import HttpResponsePermanentRedirect\n",
"from djconfig import config\n",
"from spirit.core.utils.views import is_post, post_data\n",
"from spirit.core.uti... | [
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from django.http import HttpResponsePermanentRedirect\n",
"from djconfig import config\n",
"from spirit.core.utils.views import is_post, post_data\n",
"from spirit.core.uti... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"async def FUNC_27(VAR_40, VAR_41, **VAR_3):...\n",
"self.assertEqual(VAR_40, VAR_34)\n",
"self.assertEqual(VAR_41, '/_matrix/key/v2/server/key1')\n",
"return VAR_16\n"
] | [
"async def get_json(destination, path, **kwargs):...\n",
"self.assertEqual(destination, SERVER_NAME)\n",
"self.assertEqual(path, '/_matrix/key/v2/server/key1')\n",
"return response\n"
] | [
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __init__(self):...\n",
"VAR_56 = def_function.function(self.multiply, input_signature=[tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.TensorSpec(\n shape=(), dtype=dtypes.float32)])\n",
"self.pure_concrete_function = VAR_56.get_concrete_function()\n",
"super(CLASS_2, self)._... | [
"def __init__(self):...\n",
"function = def_function.function(self.multiply, input_signature=[\n tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32)])\n",
"self.pure_concrete_function = function.get_concrete_function()\n",
"super(DummyModel, ... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.