lines listlengths 1 383 | raw_lines listlengths 1 383 | label listlengths 1 383 | type listlengths 1 383 |
|---|---|---|---|
[
"def FUNC_12(VAR_0):...\n",
"VAR_0.DEBUG = True\n",
"VAR_6 = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentCalls'\")\n",
"VAR_7 = unicorn(None, VAR_6)\n",
"VAR_8 = {}\n",
"VAR_12 = VAR_7.render(VAR_8)\n",
"assert '<script type=\"module\"' in VAR_12\n",
"asse... | [
"def test_unicorn_render_calls(settings):...\n",
"settings.DEBUG = True\n",
"token = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentCalls'\")\n",
"unicorn_node = unicorn(None, token)\n",
"context = {}\n",
"html = unicorn_node.render(context)\n",
"assert '<scrip... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Assert'",
"Assert'"
] |
[
"def __init__(self, VAR_4, VAR_17, *VAR_6, **VAR_7):...\n",
"super().__init__(VAR_4, VAR_17, *VAR_6, **kwargs)\n",
"self.helper.form_action = reverse('save_zen', VAR_7=unit.translation.\n get_reverse_url_kwargs())\n",
"self.helper.form_tag = True\n",
"self.helper.disable_csrf = False\n",
"self.helper.l... | [
"def __init__(self, user, unit, *args, **kwargs):...\n",
"super().__init__(user, unit, *args, **kwargs)\n",
"self.helper.form_action = reverse('save_zen', kwargs=unit.translation.\n get_reverse_url_kwargs())\n",
"self.helper.form_tag = True\n",
"self.helper.disable_csrf = False\n",
"self.helper.layout.... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_42(VAR_62, VAR_9):...\n",
"return '{0}::{1}'.format(VAR_62, VAR_9)\n"
] | [
"def get_document_cache_key(doctype, name):...\n",
"return '{0}::{1}'.format(doctype, name)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(self) ->str:...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def directory(self) ->str:...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_148(self):...\n",
"VAR_101 = self.auth.db\n",
"VAR_343 = VAR_101.wiki_tag.wiki_page.count(distinct=True)\n",
"VAR_344 = VAR_101(VAR_101.wiki_tag).select(VAR_101.wiki_tag.name, VAR_343,\n distinct=True, groupby=db.wiki_tag.name, VAR_174=~count, VAR_175=(0, 20))\n",
"if VAR_344:\n",
"VAR_9, VAR... | [
"def cloud(self):...\n",
"db = self.auth.db\n",
"count = db.wiki_tag.wiki_page.count(distinct=True)\n",
"ids = db(db.wiki_tag).select(db.wiki_tag.name, count, distinct=True,\n groupby=db.wiki_tag.name, orderby=~count, limitby=(0, 20))\n",
"if ids:\n",
"a, b = ids[0](count), ids[-1](count)\n",
"def st... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_1: str, VAR_2: Optional[str]=None, VAR_3: Optional[...\n",
"if VAR_2 is None and VAR_3 is None or VAR_2 is not None and VAR_3 is not None:\n",
"self.name = VAR_1\n",
"self.path = VAR_2\n",
"self.url = VAR_3\n"
] | [
"def __init__(self, name: str, path: Optional[str]=None, url: Optional[str]=None...\n",
"if path is None and url is None or path is not None and url is not None:\n",
"self.name = name\n",
"self.path = path\n",
"self.url = url\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_23(VAR_9, VAR_5, VAR_10):...\n",
"VAR_13 = calibre_db.session.query(db.Ratings).filter(db.Ratings.id == VAR_5\n ).first()\n",
"VAR_63, VAR_68, VAR_65 = calibre_db.fill_indexpage(VAR_9, 0, db.Books, db.\n Books.ratings.any(db.Ratings.id == VAR_5), [VAR_10[0]])\n",
"if VAR_13 and VAR_13.rating <... | [
"def render_ratings_books(page, book_id, order):...\n",
"name = calibre_db.session.query(db.Ratings).filter(db.Ratings.id == book_id\n ).first()\n",
"entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books,\n db.Books.ratings.any(db.Ratings.id == book_id), [order[0]])\n",
"if name and ... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Expr'"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_81 = {'image': 'dataset', 'dataset': 'project', 'plate': 'screen'}\n",
"VAR_82 = []\n",
"for VAR_14, VAR_12 in VAR_81.items():\n",
"VAR_187 = VAR_2.GET.getlist(VAR_14)\n",
"return JsonResponse({'data': VAR_82})\n",
"if len(VAR_187) == 0:\n",
... | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"parent_types = {'image': 'dataset', 'dataset': 'project', 'plate': 'screen'}\n",
"parents = []\n",
"for child_type, parent_type in parent_types.items():\n",
"ids = request.GET.getlist(child_type)\n",
"return JsonResponse({'data': parents})\n",
"if ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"For",
"For",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"VAR_5 = self._makeContext()\n",
"self.assertEqual(VAR_5.evaluate('dummy'), 'dummy')\n"
] | [
"def test_evaluate_with_render_simple_callable(self):...\n",
"ec = self._makeContext()\n",
"self.assertEqual(ec.evaluate('dummy'), 'dummy')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_30(self):...\n",
"VAR_5 = self._makeContext()\n",
"self.assertIs(VAR_5.evaluate('nocall: list'), list)\n"
] | [
"def test_list_in_path_expr(self):...\n",
"ec = self._makeContext()\n",
"self.assertIs(ec.evaluate('nocall: list'), list)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_57(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.login()\n",
"VAR_3 = self.client.get('/logout/next_page/')\n",
"self.assertEqual(VAR_3.status_code, 302)\n",
"self.assertURLEqual(VAR_3.url, '/somewhere/')\n",
"self.confirm_logged_out()\n"
] | [
"def test_logout_with_next_page_specified(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.login()\n",
"response = self.client.get('/logout/next_page/')\n",
"self.assertEqual(response.status_code, 302)\n",
"self.assertURLEqual(response.url, '/somewhere/')\n",
"self.confirm_logged_out()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_2.route('/admin/mailsettings', methods=['POST'])...\n",
"VAR_16 = request.form.to_dict()\n",
"FUNC_38(VAR_16, 'mail_server_type')\n",
"if VAR_16.get('invalidate'):\n",
"config.mail_gmail_token = {}\n",
"if VAR_16.get('gmail'):\n",
"flag_modified(config, 'mail_gmail_token')\n",
"config.save()\n",... | [
"@admi.route('/admin/mailsettings', methods=['POST'])...\n",
"to_save = request.form.to_dict()\n",
"_config_int(to_save, 'mail_server_type')\n",
"if to_save.get('invalidate'):\n",
"config.mail_gmail_token = {}\n",
"if to_save.get('gmail'):\n",
"flag_modified(config, 'mail_gmail_token')\n",
"config.sav... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Expr'",
"Return'",
"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'"
] |
[
"@VAR_0.simple_tag...\n",
"VAR_40 = VAR_12.get('renderer', HTMLFormRenderer())\n",
"return VAR_40.render_field(VAR_11, VAR_12)\n"
] | [
"@register.simple_tag...\n",
"renderer = style.get('renderer', HTMLFormRenderer())\n",
"return renderer.render_field(field, style)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"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():...\n",
"doctype_module = local.db.get_value('DocType', doctype, 'module')\n",
"return local.module_app[scrub(doctype_module)]\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_1, VAR_2, VAR_3=None, VAR_4=None, VAR_5=True):...\n",
"if VAR_3 is None and VAR_1.md.group is not None:\n",
"VAR_3 = VAR_1.md.group.lower()\n",
"if VAR_4 is None:\n",
"if VAR_1.md.status is not None:\n",
"VAR_14, VAR_4 = splitStatus(VAR_4)\n",
"VAR_4 = VAR_1.md.status\n",
"if VAR_1.md.... | [
"def retrieveBoilerplateFile(doc, name, group=None, status=None, error=True):...\n",
"if group is None and doc.md.group is not None:\n",
"group = doc.md.group.lower()\n",
"if status is None:\n",
"if doc.md.status is not None:\n",
"megaGroup, status = splitStatus(status)\n",
"status = doc.md.status\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(VAR_23, VAR_24, VAR_25, VAR_26):...\n",
"from jinja2.exceptions import TemplateNotFound\n",
"VAR_80 = defaultdict(lambda : 1)\n",
"VAR_81 = defaultdict(list)\n",
"for VAR_28 in VAR_25:\n",
"if not isinstance(VAR_28, dict):\n",
"for VAR_57 in VAR_26:\n",
"if 'type' not in VAR_28:\n",
"if... | [
"def _process_template_configs(name, implementation, configs, rules):...\n",
"from jinja2.exceptions import TemplateNotFound\n",
"counters = defaultdict(lambda : 1)\n",
"includes = defaultdict(list)\n",
"for config in configs:\n",
"if not isinstance(config, dict):\n",
"for template_type in rules:\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'",
"ImportFrom'",
"Assign'",
"Assign'",
"For",
"Condition",
"For",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"AugAssign'"
] |
[
"async def FUNC_0(*, VAR_0: Client, VAR_1: List[AnEnum], VAR_2: Union[date,...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = '{}/tests/'.format(VAR_0.base_url)\n",
"VAR_12: Dict[str, Any] = VAR_0.get_headers()\n",
"VAR_7 = []\n",
"for an_enum_value_item_data in VAR_1:\n",
"VAR_9 = an_enum_value_item_data.valu... | [
"async def get_user_list(*, client: Client, an_enum_value: List[AnEnum],...\n",
"\"\"\"docstring\"\"\"\n",
"url = '{}/tests/'.format(client.base_url)\n",
"headers: Dict[str, Any] = client.get_headers()\n",
"json_an_enum_value = []\n",
"for an_enum_value_item_data in an_enum_value:\n",
"an_enum_value_ite... | [
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"AnnAssign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"AnnAssign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"from mock import Mock, call\n",
"from signedjson.key import generate_signing_key\n",
"from synapse.api.constants import EventTypes, Membership, PresenceState\n",
"from synapse.api.presence import UserPresenceState\n",
"from synapse.api.room_versions import KNOWN_ROOM_VERSIONS\n",
"from synapse.events.bui... | [
"from mock import Mock, call\n",
"from signedjson.key import generate_signing_key\n",
"from synapse.api.constants import EventTypes, Membership, PresenceState\n",
"from synapse.api.presence import UserPresenceState\n",
"from synapse.api.room_versions import KNOWN_ROOM_VERSIONS\n",
"from synapse.events.bui... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'... |
[
"def FUNC_67(VAR_10):...\n",
"VAR_213 = {}\n",
"for VAR_30, VAR_108 in (['x', VAR_10.getPosX()], ['y', VAR_10.getPosY()]):\n",
"if VAR_108 is not None:\n",
"return VAR_213\n",
"VAR_213[VAR_30] = {'value': VAR_108.getValue(), 'unit': str(VAR_108.getUnit())}\n"
] | [
"def marshal_pos(w):...\n",
"d = {}\n",
"for x, p in (['x', w.getPosX()], ['y', w.getPosY()]):\n",
"if p is not None:\n",
"return d\n",
"d[x] = {'value': p.getValue(), 'unit': str(p.getUnit())}\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_0(VAR_3, VAR_4=None, VAR_5=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.translate import get_full_dict\n",
"from frappe.utils import strip_html_tags, is_html\n",
"if not hasattr(VAR_1, 'lang'):\n",
"VAR_1.lang = VAR_4 or 'en'\n",
"if not VAR_4:\n",
"VAR_4 = VAR_1.lang\n",
"VAR_175... | [
"def _(msg, lang=None, context=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.translate import get_full_dict\n",
"from frappe.utils import strip_html_tags, is_html\n",
"if not hasattr(local, 'lang'):\n",
"local.lang = lang or 'en'\n",
"if not lang:\n",
"lang = local.lang\n",
"non_translated_s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"@FUNC_0...\n",
"return MessageHandler(self)\n"
] | [
"@cache_in_self...\n",
"return MessageHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_14(VAR_24):...\n",
"\"\"\"docstring\"\"\"\n",
"return '\"%s\"' % VAR_24.replace('\\\\', '\\\\\\\\').replace('\"', '\\\\\"')\n"
] | [
"def quote_etag(etag):...\n",
"\"\"\"docstring\"\"\"\n",
"return '\"%s\"' % etag.replace('\\\\', '\\\\\\\\').replace('\"', '\\\\\"')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_11(self, VAR_20):...\n",
"VAR_43 = self.evaluate(VAR_20)\n",
"if VAR_43 is self.getDefault():\n",
"return VAR_43\n",
"return bool(VAR_43)\n"
] | [
"def evaluateBoolean(self, expr):...\n",
"value = self.evaluate(expr)\n",
"if value is self.getDefault():\n",
"return value\n",
"return bool(value)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@event.listens_for(VAR_83, 'before_flush')...\n",
"for change in itertools.chain(VAR_1.new, VAR_1.dirty):\n",
"if isinstance(change, (CLASS_8, CLASS_13, CLASS_12)):\n",
"for change in itertools.chain(VAR_1.new, VAR_1.deleted):\n",
"if change.kobo_reading_state:\n",
"if isinstance(change, CLASS_6):\n",
... | [
"@event.listens_for(Session, 'before_flush')...\n",
"for change in itertools.chain(session.new, session.dirty):\n",
"if isinstance(change, (ReadBook, KoboStatistics, KoboBookmark)):\n",
"for change in itertools.chain(session.new, session.deleted):\n",
"if change.kobo_reading_state:\n",
"if isinstance(chan... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"For",
"For",
"Condition",
"For",
"Condition",
"Condition",
"Assign'",
"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_12(self):...\n",
"assert url_for('/foobar') == '/foobar'\n"
] | [
"def test_it_works_with_already_formed_path(self):...\n",
"assert url_for('/foobar') == '/foobar'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assert'"
] |
[
"def FUNC_2() ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = [FavaLedger(filepath) for filepath in VAR_1.config['BEANCOUNT_FILES']]\n",
"FUNC_1(VAR_6)\n"
] | [
"def _load_file() ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"ledgers = [FavaLedger(filepath) for filepath in app.config['BEANCOUNT_FILES']]\n",
"update_ledger_slugs(ledgers)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_42: bool=True, VAR_41: bool=True, VAR_48: bool=True,...\n",
"\"\"\"docstring\"\"\"\n",
"self.nlu = VAR_42\n",
"self.core = VAR_41\n",
"self.nlg = VAR_48\n",
"self.force_training = VAR_39\n"
] | [
"def __init__(self, nlu: bool=True, core: bool=True, nlg: bool=True,...\n",
"\"\"\"docstring\"\"\"\n",
"self.nlu = nlu\n",
"self.core = core\n",
"self.nlg = nlg\n",
"self.force_training = force_training\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_18(VAR_141, VAR_142):...\n",
"if VAR_142 and VAR_142 not in VAR_140 and VAR_141 in VAR_62:\n",
"VAR_165, VAR_166 = VAR_62[VAR_141]\n",
"send_templated_mail(VAR_165, VAR_166, VAR_142, VAR_5=self.queue.\n from_address, **kwargs)\n",
"VAR_140.add(VAR_142)\n"
] | [
"def send(role, recipient):...\n",
"if recipient and recipient not in recipients and role in roles:\n",
"template, context = roles[role]\n",
"send_templated_mail(template, context, recipient, sender=self.queue.\n from_address, **kwargs)\n",
"recipients.add(recipient)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"if 'google' not in VAR_1.remote_apps:\n",
"VAR_1.remote_app('google', base_url='https://www.google.com/accounts/',\n authorize_url=\n 'https://accounts.google.com/o/oauth2/auth?prompt=select_account+consent',\n request_token_url=None, request_token_params={'scope':\n 'https://... | [
"def google_remote_app():...\n",
"if 'google' not in oauth.remote_apps:\n",
"oauth.remote_app('google', base_url='https://www.google.com/accounts/',\n authorize_url=\n 'https://accounts.google.com/o/oauth2/auth?prompt=select_account+consent',\n request_token_url=None, request_token_params={'scope':\n ... | [
0,
4,
4,
4
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"@VAR_0.filter...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_46 = '%s > %s'\n",
"VAR_47 = VAR_19.links\n",
"if VAR_19.data:\n",
"VAR_56 = VAR_19.data.items()\n",
"if VAR_20 is not None:\n",
"for sub_section_key, sub_section in VAR_56:\n",
"VAR_57 = OrderedDict()\n",
"return VAR_47\n",
"VAR_57 = FUNC_17... | [
"@register.filter...\n",
"\"\"\"docstring\"\"\"\n",
"NESTED_FORMAT = '%s > %s'\n",
"links = section.links\n",
"if section.data:\n",
"data = section.data.items()\n",
"if sec_key is not None:\n",
"for sub_section_key, sub_section in data:\n",
"new_links = OrderedDict()\n",
"return links\n",
"new_l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"For",
"Assign'",
"Return'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Return'",
"Expr'"
] |
[
"@VAR_0.route('/config', methods=['GET', 'POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_47 = []\n",
"VAR_48 = []\n",
"VAR_18 = None\n",
"if request.method == 'POST':\n",
"VAR_18 = request.form.get('section')\n",
"VAR_47 = FUNC_58('/internal/config', 'get')\n",
"flash(str(err), 'danger')\n",
"retu... | [
"@gui.route('/config', methods=['GET', 'POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"full_config_info = []\n",
"config_info = []\n",
"section = None\n",
"if request.method == 'POST':\n",
"section = request.form.get('section')\n",
"full_config_info = query_internal_api('/internal/config', 'get')\n",
"f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_32(self, VAR_8, VAR_7):...\n",
"if 'data' in VAR_7 and 'create_discovery' in VAR_8.session:\n",
"VAR_141 = []\n",
"self.clean_instance(VAR_7['initial'])\n",
"VAR_141 = []\n",
"VAR_8.session['create_discovery'] = VAR_141\n",
"for i, VAR_10 in enumerate(VAR_8.session['create_discovery']):\n",
... | [
"def perform_discovery(self, request, kwargs):...\n",
"if 'data' in kwargs and 'create_discovery' in request.session:\n",
"discovered = []\n",
"self.clean_instance(kwargs['initial'])\n",
"discovered = []\n",
"request.session['create_discovery'] = discovered\n",
"for i, data in enumerate(request.session[... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_171(VAR_14):...\n",
"VAR_415 = 'padding:0 0.2em;line-height:%.2fem;font-size:%.2fem'\n",
"VAR_416 = 1.5 * (VAR_14 - VAR_13) / max(VAR_9 - VAR_13, 1) + 1.3\n",
"return VAR_415 % (1.3, VAR_416)\n"
] | [
"def style(c):...\n",
"STYLE = 'padding:0 0.2em;line-height:%.2fem;font-size:%.2fem'\n",
"size = 1.5 * (c - b) / max(a - b, 1) + 1.3\n",
"return STYLE % (1.3, size)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_10, VAR_11=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.translate import get_user_lang\n",
"VAR_1.lang = get_user_lang(VAR_10)\n"
] | [
"def set_user_lang(user, user_language=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.translate import get_user_lang\n",
"local.lang = get_user_lang(user)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Assign'"
] |
[
"def FUNC_0(self, VAR_4, VAR_5):...\n",
"VAR_6 = self.setup_test_homeserver('red', http_client=None,\n federation_client=Mock())\n",
"self.event_source = VAR_6.get_event_sources().sources['typing']\n",
"VAR_6.get_federation_handler = Mock()\n",
"async def FUNC_5(VAR_7=None, VAR_8=False):...\n",
"return... | [
"def make_homeserver(self, reactor, clock):...\n",
"hs = self.setup_test_homeserver('red', http_client=None, federation_client=\n Mock())\n",
"self.event_source = hs.get_event_sources().sources['typing']\n",
"hs.get_federation_handler = Mock()\n",
"async def get_user_by_access_token(token=None, allow_gue... | [
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"AsyncFunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_2: Directive, VAR_9: str, VAR_10: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = file.readlines()\n",
"VAR_22 = VAR_2.meta['lineno'] - 1\n",
"VAR_20 = FUNC_3(VAR_8, VAR_22)\n",
"VAR_21 = ''.join(VAR_20).rstrip('\\n')\n",
"if FUNC_0(VAR_21) != VAR_10:\n",
"VAR_8 = VAR_8[:VAR_22]... | [
"def save_entry_slice(entry: Directive, source_slice: str, sha256sum: str...\n",
"\"\"\"docstring\"\"\"\n",
"lines = file.readlines()\n",
"first_entry_line = entry.meta['lineno'] - 1\n",
"entry_lines = find_entry_lines(lines, first_entry_line)\n",
"entry_source = ''.join(entry_lines).rstrip('\\n')\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_34(self, VAR_44):...\n",
"VAR_13 = FUNC_1(VAR_44.group(1))\n",
"if VAR_13 not in self.links:\n",
"return None\n",
"VAR_84 = self.links[VAR_13]\n",
"return self._process_link(VAR_44, VAR_84['link'], VAR_84['title'])\n"
] | [
"def output_nolink(self, m):...\n",
"key = _keyify(m.group(1))\n",
"if key not in self.links:\n",
"return None\n",
"ret = self.links[key]\n",
"return self._process_link(m, ret['link'], ret['title'])\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"if not VAR_1.match(VAR_13):\n"
] | [
"@staticmethod...\n",
"if not SHA1_PATTERN.match(sha1):\n"
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_3(self, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"for basket_command_middleware in get_provide_objects(\n",
"if not issubclass(basket_command_middleware, BaseBasketCommandMiddleware):\n",
"return VAR_5\n",
"VAR_5 = dict(basket_command_middleware().postprocess_response(VAR_2=self.\... | [
"def postprocess_response(self, command, kwargs, response):...\n",
"\"\"\"docstring\"\"\"\n",
"for basket_command_middleware in get_provide_objects(\n",
"if not issubclass(basket_command_middleware, BaseBasketCommandMiddleware):\n",
"return response\n",
"response = dict(basket_command_middleware().postpro... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_20(VAR_66: DecoratedCallable) ->DecoratedCallable:...\n",
"self.add_api_websocket_route(VAR_26, VAR_66, VAR_28=name)\n",
"return VAR_66\n"
] | [
"def decorator(func: DecoratedCallable) ->DecoratedCallable:...\n",
"self.add_api_websocket_route(path, func, name=name)\n",
"return func\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18: Dict[str, str] = {}\n",
"for i, value in enumerate(VAR_6):\n",
"if value[0].isalpha():\n",
"return VAR_18\n",
"VAR_19 = value.upper()\n",
"VAR_19 = f'VALUE_{i}'\n",
"if VAR_19 in VAR_18:\n",
"VAR_18[VAR_19] = value\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"output: Dict[str, str] = {}\n",
"for i, value in enumerate(values):\n",
"if value[0].isalpha():\n",
"return output\n",
"key = value.upper()\n",
"key = f'VALUE_{i}'\n",
"if key in output:\n",
"output[key] = value\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
5
] | [
"Condition",
"Docstring",
"AnnAssign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"@wraps(VAR_28)...\n",
"VAR_1.debug('jsonp')\n",
"VAR_19 = VAR_9.get('server_id', None)\n",
"VAR_315 = 500\n",
"if VAR_19 is None and VAR_2.session.get('connector'):\n",
"if isinstance(ex, omero.SecurityViolation):\n",
"VAR_19 = VAR_2.session['connector'].server_id\n",
"VAR_9['server_id'] = VAR_19\n",... | [
"@wraps(f)...\n",
"logger.debug('jsonp')\n",
"server_id = kwargs.get('server_id', None)\n",
"status = 500\n",
"if server_id is None and request.session.get('connector'):\n",
"if isinstance(ex, omero.SecurityViolation):\n",
"server_id = request.session['connector'].server_id\n",
"kwargs['server_id'] = ... | [
0,
0,
0,
0,
0,
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",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Cond... |
[
"def FUNC_42(VAR_2, VAR_5=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_71 = VAR_2.GET or VAR_2.POST\n",
"VAR_106 = len(VAR_71.getlist('image')) > 0 and list(VAR_5.getObjects(\n 'Image', VAR_71.getlist('image'))) or list()\n",
"VAR_107 = len(VAR_71.getlist('dataset')) > 0 and list(VAR_5.getObjects(\n ... | [
"def getObjects(request, conn=None):...\n",
"\"\"\"docstring\"\"\"\n",
"r = request.GET or request.POST\n",
"images = len(r.getlist('image')) > 0 and list(conn.getObjects('Image', r.\n getlist('image'))) or list()\n",
"datasets = len(r.getlist('dataset')) > 0 and list(conn.getObjects('Dataset',\n r.ge... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(VAR_2, VAR_6, VAR_19=None, VAR_8=None, VAR_20=False, VAR_21=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_53 = VAR_2.GET\n",
"VAR_1.debug('Preparing Image:%r saveDefs=%r retry=%r request=%r conn=%s' %\n (VAR_6, VAR_20, VAR_21, VAR_53, str(VAR_8)))\n",
"VAR_92 = VAR_8.getObject('Image', VAR_6... | [
"def _get_prepared_image(request, iid, server_id=None, conn=None, saveDefs=...\n",
"\"\"\"docstring\"\"\"\n",
"r = request.GET\n",
"logger.debug('Preparing Image:%r saveDefs=%r retry=%r request=%r conn=%s' %\n (iid, saveDefs, retry, r, str(conn)))\n",
"img = conn.getObject('Image', iid)\n",
"if img is ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'... |
[
"def FUNC_13(self):...\n",
"VAR_5 = self.get_counts('json', period='30days')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"self.assertJSONEqual(VAR_5.content.decode(), VAR_0)\n"
] | [
"def test_counts_view_30days(self):...\n",
"response = self.get_counts('json', period='30days')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertJSONEqual(response.content.decode(), COUNTS_DATA)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, *VAR_3, **VAR_4):...\n",
"super().__init__(**kwargs)\n",
"self.model_id = VAR_4.get('model_id')\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super().__init__(**kwargs)\n",
"self.model_id = kwargs.get('model_id')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_26(VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_54 = 'string'\n",
"VAR_55 = VAR_21.add_parser('convert', description=convert_msg,\n formatter_class=argparse.RawTextHelpFormatter)\n",
"VAR_55.add_argument('--dir', type=str, required=True, help=\n 'directory containing the SavedModel to con... | [
"def add_convert_subparser(subparsers):...\n",
"\"\"\"docstring\"\"\"\n",
"convert_msg = \"\"\"Usage example:\nTo convert the SavedModel to one that have TensorRT ops:\n$saved_model_cli convert \\\\\n --dir /tmp/saved_model \\\\\n --tag_set serve \\\\\n --output_dir /tmp/saved_model_trt \\\\\n tensorrt ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_5):...\n",
"VAR_8 = self.service.index(VAR_5, sort_dir='asc')\n",
"return self._translate_uuids_to_ids(VAR_5, VAR_8)\n"
] | [
"def index(self, context):...\n",
"images = self.service.index(context, sort_dir='asc')\n",
"return self._translate_uuids_to_ids(context, images)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.op_mapper[VAR_3.op.__class__]\n",
"self.ops.append([])\n",
"for VAR_10 in VAR_3.values:\n",
"self.visit(VAR_10)\n",
"VAR_7 = self.ops.pop()\n",
"if self.ops:\n",
"self.ops[-1].append({VAR_6: VAR_7})\n",
"self.mongo_query[VAR... | [
"def visit_BoolOp(self, node):...\n",
"\"\"\"docstring\"\"\"\n",
"op = self.op_mapper[node.op.__class__]\n",
"self.ops.append([])\n",
"for value in node.values:\n",
"self.visit(value)\n",
"c = self.ops.pop()\n",
"if self.ops:\n",
"self.ops[-1].append({op: c})\n",
"self.mongo_query[op] = c\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"For",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_168(*VAR_9, **VAR_13):...\n",
"VAR_27 = None\n",
"VAR_27 = VAR_10(*VAR_9, **b)\n",
"thread.start_new_thread(VAR_26, (VAR_27,))\n",
"return VAR_27\n"
] | [
"def __completion(*a, **b):...\n",
"d = None\n",
"d = f(*a, **b)\n",
"thread.start_new_thread(callback, (d,))\n",
"return d\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_12(self, VAR_5, VAR_6):...\n",
"VAR_7 = self.get_image_uuid(VAR_5, VAR_6)\n",
"return self.get(self, VAR_5, VAR_7)\n"
] | [
"def get(self, context, image_id):...\n",
"image_uuid = self.get_image_uuid(context, image_id)\n",
"return self.get(self, context, image_uuid)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __init__(self):...\n",
"self.id = 178\n"
] | [
"def __init__(self):...\n",
"self.id = 178\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_47(VAR_136, VAR_38):...\n",
""
] | [
"def f(x, k):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_82(self):...\n",
"VAR_14 = self.token['text']\n",
"VAR_82 = self.token['tag']\n",
"if self._parse_block_html and VAR_82 not in VAR_7:\n",
"VAR_14 = self.inline(VAR_14, VAR_43=self.inline.inline_html_rules)\n",
"VAR_93 = self.token.get('extra') or ''\n",
"VAR_64 = '<%s%s>%s</%s>' % (VAR_82, VAR... | [
"def output_open_html(self):...\n",
"text = self.token['text']\n",
"tag = self.token['tag']\n",
"if self._parse_block_html and tag not in _pre_tags:\n",
"text = self.inline(text, rules=self.inline.inline_html_rules)\n",
"extra = self.token.get('extra') or ''\n",
"html = '<%s%s>%s</%s>' % (tag, extra, te... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_11 = self.mock_handler.get_displayname\n",
"VAR_11.return_value = defer.succeed('Bob')\n",
"VAR_12, VAR_13 = yield self.mock_resource.trigger('GET', \n '/profile/%s/displayname' % '@opaque:elsewhere', None)\n",
"self.assertEquals(200, VAR_12)\n",
"self.assertEquals({... | [
"@defer.inlineCallbacks...\n",
"mocked_get = self.mock_handler.get_displayname\n",
"mocked_get.return_value = defer.succeed('Bob')\n",
"code, response = yield self.mock_resource.trigger('GET', \n '/profile/%s/displayname' % '@opaque:elsewhere', None)\n",
"self.assertEquals(200, code)\n",
"self.assertEq... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@wraps(VAR_4)...\n",
"if VAR_87.role_viewer():\n",
"return VAR_4(*VAR_49, **kwargs)\n",
"abort(403)\n"
] | [
"@wraps(f)...\n",
"if current_user.role_viewer():\n",
"return f(*args, **kwargs)\n",
"abort(403)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_40(self):...\n",
"VAR_14 = self._makeOne()\n",
"VAR_15 = VAR_14.createErrorInfo(AttributeError('nonesuch'), (12, 3))\n",
"self.assertTrue(VAR_15.type is AttributeError)\n",
"self.assertEqual(VAR_15.__allow_access_to_unprotected_subobjects__, 1)\n"
] | [
"def test_createErrorInfo_returns_unrestricted_object(self):...\n",
"context = self._makeOne()\n",
"info = context.createErrorInfo(AttributeError('nonesuch'), (12, 3))\n",
"self.assertTrue(info.type is AttributeError)\n",
"self.assertEqual(info.__allow_access_to_unprotected_subobjects__, 1)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_38(VAR_16, VAR_17, VAR_18=VAR_119):...\n",
"return config.set_from_dictionary(VAR_16, VAR_17, VAR_18)\n"
] | [
"def _config_int(to_save, x, func=int):...\n",
"return config.set_from_dictionary(to_save, x, func)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_24(self, VAR_22):...\n",
"if not VAR_22.strip():\n",
"VAR_102 = '[]'\n",
"VAR_114 = self.model.search(VAR_22.strip())\n",
"return VAR_102\n",
"VAR_102 = [entry.to_dict() for entry in VAR_114]\n"
] | [
"def api_search(self, searchstring):...\n",
"if not searchstring.strip():\n",
"jsonresults = '[]'\n",
"searchresults = self.model.search(searchstring.strip())\n",
"return jsonresults\n",
"jsonresults = [entry.to_dict() for entry in searchresults]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_152(VAR_213):...\n",
"if VAR_43:\n",
"VAR_213 = FUNC_151(VAR_213)\n",
"return VAR_213\n"
] | [
"def encoded_or_raw(text):...\n",
"if raw:\n",
"text = encode_header(text)\n",
"return text\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_38(self, VAR_33='created', VAR_34=''):...\n",
"VAR_77 = self.playlistdb.showPlaylists(self.getUserId(), VAR_34)\n",
"VAR_78 = int(time.time())\n",
"VAR_79 = False\n",
"for VAR_110 in VAR_77:\n",
"VAR_110['username'] = self.userdb.getNameById(VAR_110['userid'])\n",
"if VAR_33[0] == '-':\n",
"... | [
"def api_showplaylists(self, sortby='created', filterby=''):...\n",
"playlists = self.playlistdb.showPlaylists(self.getUserId(), filterby)\n",
"curr_time = int(time.time())\n",
"is_reverse = False\n",
"for pl in playlists:\n",
"pl['username'] = self.userdb.getNameById(pl['userid'])\n",
"if sortby[0] == ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __call__(self):...\n",
"VAR_11 = VAR_263.request.args\n",
"if len(VAR_11) < 1:\n",
"if VAR_11[0] == 'tables':\n",
"VAR_153 = self.db[VAR_11(1)]\n",
"return self.tables()\n",
"if len(VAR_11) > 1 and not VAR_11(1) in self.db.tables:\n",
"if VAR_11[0] == 'create':\n",
"return self.create(VAR_153)\... | [
"def __call__(self):...\n",
"args = current.request.args\n",
"if len(args) < 1:\n",
"if args[0] == 'tables':\n",
"table = self.db[args(1)]\n",
"return self.tables()\n",
"if len(args) > 1 and not args(1) in self.db.tables:\n",
"if args[0] == 'create':\n",
"return self.create(table)\n",
"if args[0] ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_158(VAR_7, VAR_135=VAR_135):...\n",
"if VAR_135 is not VAR_3:\n",
"VAR_135(VAR_7)\n",
"return FUNC_157(VAR_262=True)\n"
] | [
"def cas_onaccept(form, onaccept=onaccept):...\n",
"if onaccept is not DEFAULT:\n",
"onaccept(form)\n",
"return allow_access(interactivelogin=True)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_27(self, VAR_90=None):...\n",
"if not self.jwt_handler:\n",
"return self.jwt_handler.allows_jwt(VAR_90=otherwise)\n"
] | [
"def allows_jwt(self, otherwise=None):...\n",
"if not self.jwt_handler:\n",
"return self.jwt_handler.allows_jwt(otherwise=otherwise)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_25(self):...\n",
"assert _validate_redirect_url(None) is False\n",
"assert _validate_redirect_url(' ') is False\n"
] | [
"def test_it_fails_on_garbage(self):...\n",
"assert _validate_redirect_url(None) is False\n",
"assert _validate_redirect_url(' ') is False\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Assert'"
] |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/groups/%s/rooms', VAR_30)\n",
"return self.client.get_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/rooms', group_id)\n",
"return self.client.get_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'"
] |
[
"def FUNC_14(VAR_0, VAR_1: FlaskClient):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_13 = 'new_halcyon'\n",
"VAR_14 = 'password2'\n",
"VAR_8 = VAR_1.post('/user/edit', data={'username': new_user, 'password':\n new_pass}, follow_redirects=True)\n",
"assert request.path == '/'\n",
"VAR_1.delete('/logout')\n... | [
"def test_edit_user(test_app, client: FlaskClient):...\n",
"\"\"\"docstring\"\"\"\n",
"new_user = 'new_halcyon'\n",
"new_pass = 'password2'\n",
"resp = client.post('/user/edit', data={'username': new_user, 'password':\n new_pass}, follow_redirects=True)\n",
"assert request.path == '/'\n",
"client.del... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Expr'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def __init__(self, VAR_3=None):...\n",
"VAR_28 = {'class': 'vTextField'}\n",
"if VAR_3 is not None:\n",
"VAR_28.update(VAR_3)\n",
"super(CLASS_12, self).__init__(VAR_3=final_attrs)\n"
] | [
"def __init__(self, attrs=None):...\n",
"final_attrs = {'class': 'vTextField'}\n",
"if attrs is not None:\n",
"final_attrs.update(attrs)\n",
"super(AdminEmailInputWidget, self).__init__(attrs=final_attrs)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_80(VAR_9, VAR_44, VAR_45):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(CertificateInvalidation.get_certificate_invalidations(VAR_44.\n",
"if not VAR_44.is_valid():\n",
"VAR_46, VAR_72 = CertificateInvalidation.objects.update_or_create(VAR_44=\n generated_certificate, defaults={'invalidated_by': r... | [
"def invalidate_certificate(request, generated_certificate,...\n",
"\"\"\"docstring\"\"\"\n",
"if len(CertificateInvalidation.get_certificate_invalidations(\n",
"if not generated_certificate.is_valid():\n",
"certificate_invalidation, __ = (CertificateInvalidation.objects.\n update_or_create(generated_cer... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"async def FUNC_10(self, VAR_16, VAR_20):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_37 = VAR_20.server_name\n",
"VAR_0.info('Requesting keys %s from notary server %s', VAR_16.items(), VAR_37)\n",
"VAR_50 = await self.client.post_json(destination=perspective_name, path=\n '/_matrix/key/v2/query', data={'serv... | [
"async def get_server_verify_key_v2_indirect(self, keys_to_fetch, key_server):...\n",
"\"\"\"docstring\"\"\"\n",
"perspective_name = key_server.server_name\n",
"logger.info('Requesting keys %s from notary server %s', keys_to_fetch.items\n (), perspective_name)\n",
"query_response = await self.client.post... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(VAR_0, VAR_1: FlaskClient, VAR_2):...\n",
"VAR_5 = VAR_1.get('/dataobj/1')\n",
"assert VAR_5.status_code == 200\n"
] | [
"def test_get_dataobj(test_app, client: FlaskClient, note_fixture):...\n",
"response = client.get('/dataobj/1')\n",
"assert response.status_code == 200\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assert'"
] |
[
"def FUNC_9(self, *VAR_4, **VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_54 = VAR_4[0] if VAR_4 else ''\n",
"if not VAR_54 in self.handlers:\n",
"return \"Error: no such action. '%s'\" % VAR_54\n",
"VAR_55 = self.handlers[VAR_54]\n",
"VAR_56 = not ('noauth' in dir(VAR_55) and VAR_55.noauth)\n",
"if ... | [
"def api(self, *args, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"action = args[0] if args else ''\n",
"if not action in self.handlers:\n",
"return \"Error: no such action. '%s'\" % action\n",
"handler = self.handlers[action]\n",
"needsAuth = not ('noauth' in dir(handler) and handler.noauth)\n",
"if... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_26(self):...\n",
"self.assert_expected(self.folder.t, 'BooleanAttributesAndDefault.html')\n"
] | [
"def testBooleanAttributesAndDefault(self):...\n",
"self.assert_expected(self.folder.t, 'BooleanAttributesAndDefault.html')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_18(self):...\n",
"VAR_5 = self.get_counts('rst')\n",
"self.assertEqual(VAR_5.status_code, 200)\n",
"self.assertContains(VAR_5, 'weblate@example.org')\n"
] | [
"def test_counts_view_rst(self):...\n",
"response = self.get_counts('rst')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertContains(response, 'weblate@example.org')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __str__(self):...\n",
"return '%s' % self.name\n"
] | [
"def __str__(self):...\n",
"return '%s' % self.name\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@handle_dashboard_error...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_65 = get_course_by_id(SlashSeparatedCourseKey.from_deprecated_string(\n VAR_10))\n",
"VAR_40 = require_student_from_identifier(VAR_9.GET.get('student'))\n",
"VAR_36 = find_unit(VAR_65, VAR_9.GET.get('url'))\n",
"set_due_date_extension(VAR_... | [
"@handle_dashboard_error...\n",
"\"\"\"docstring\"\"\"\n",
"course = get_course_by_id(SlashSeparatedCourseKey.from_deprecated_string(\n course_id))\n",
"student = require_student_from_identifier(request.GET.get('student'))\n",
"unit = find_unit(course, request.GET.get('url'))\n",
"set_due_date_extensio... | [
0,
0,
0,
3,
3,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"self.client.login(username='super', password='secret')\n"
] | [
"def setUp(self):...\n",
"self.client.login(username='super', password='secret')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@abstractmethod...\n",
""
] | [
"@abstractmethod...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_55 = VAR_2.session.get('server_settings', {}).get('browser', {})\n",
"VAR_56 = VAR_55.get('thumb_default_size', 96)\n",
"if VAR_10 is None:\n",
"VAR_10 = VAR_56\n",
"VAR_126 = get_longs(VAR_2, 'id')\n",
"VAR_126 = list(set(VAR_126))\n",
"if l... | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"server_settings = request.session.get('server_settings', {}).get('browser', {})\n",
"defaultSize = server_settings.get('thumb_default_size', 96)\n",
"if w is None:\n",
"w = defaultSize\n",
"image_ids = get_longs(request, 'id')\n",
"image_ids = list... | [
0,
0,
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'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Return'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Condition",
... |
[
"def FUNC_4(self, VAR_24, VAR_25=None):...\n",
"self.encoding = VAR_25\n",
"VAR_27 = False\n",
"self.errors = []\n",
"if VAR_25 and self.inject_meta_charset:\n",
"from ..filters.inject_meta_charset import Filter\n",
"if self.strip_whitespace:\n",
"VAR_24 = Filter(VAR_24, VAR_25)\n",
"from ..filters.... | [
"def serialize(self, treewalker, encoding=None):...\n",
"self.encoding = encoding\n",
"in_cdata = False\n",
"self.errors = []\n",
"if encoding and self.inject_meta_charset:\n",
"from ..filters.inject_meta_charset import Filter\n",
"if self.strip_whitespace:\n",
"treewalker = Filter(treewalker, encodin... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"ImportFrom'",
"Condition",
"Assign'",
"ImportFrom'",
"Condition",
"Assign'",
"ImportFrom'",
"Condition",
"Assign'",
"ImportFrom'",
"Condition",
"Assign'",
"ImportFrom'",
"For",
"Assign'",
"Assign'",
"Condition",... |
[
"def FUNC_10(self):...\n",
"VAR_5 = {'not_types': ['m.*', 'org.*']}\n",
"VAR_6 = FUNC_0(sender='@foo:bar', type='com.nom.nom.nom', room_id='!foo:bar')\n",
"self.assertTrue(Filter(VAR_5).check(VAR_6))\n"
] | [
"def test_definition_not_types_works_with_unknowns(self):...\n",
"definition = {'not_types': ['m.*', 'org.*']}\n",
"event = MockEvent(sender='@foo:bar', type='com.nom.nom.nom', room_id='!foo:bar'\n )\n",
"self.assertTrue(Filter(definition).check(event))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_2, VAR_3, VAR_4, **VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = []\n",
"VAR_11 = Change.objects.content()\n",
"if VAR_2:\n",
"VAR_11 = VAR_11.filter(author=user)\n",
"for language in Language.objects.filter(**kwargs).distinct().iterator():\n",
"VAR_17 = VAR_11.filter(language=la... | [
"def generate_credits(user, start_date, end_date, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"result = []\n",
"base = Change.objects.content()\n",
"if user:\n",
"base = base.filter(author=user)\n",
"for language in Language.objects.filter(**kwargs).distinct().iterator():\n",
"authors = base.filter(l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_35(self, VAR_44, VAR_49, VAR_62=None):...\n",
"VAR_85 = VAR_44.group(0)\n",
"VAR_14 = VAR_44.group(1)\n",
"if VAR_85[0] == '!':\n",
"return self.renderer.image(VAR_49, VAR_62, VAR_14)\n",
"self._in_link = True\n",
"VAR_14 = self.output(VAR_14)\n",
"self._in_link = False\n",
"return self.re... | [
"def _process_link(self, m, link, title=None):...\n",
"line = m.group(0)\n",
"text = m.group(1)\n",
"if line[0] == '!':\n",
"return self.renderer.image(link, title, text)\n",
"self._in_link = True\n",
"text = self.output(text)\n",
"self._in_link = False\n",
"return self.renderer.link(link, title, te... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/last_pid/<pid_id>/<input_period>')...\n",
"\"\"\"docstring\"\"\"\n",
"if not str_is_float(VAR_31):\n",
"return '', 204\n",
"VAR_70 = PID.query.filter(PID.unique_id == VAR_30).first()\n",
"VAR_1.debug('No Data returned form influxdb')\n",
"if len(VAR_70.measurement.split(',')) == 2:\n",
... | [
"@blueprint.route('/last_pid/<pid_id>/<input_period>')...\n",
"\"\"\"docstring\"\"\"\n",
"if not str_is_float(input_period):\n",
"return '', 204\n",
"pid = PID.query.filter(PID.unique_id == pid_id).first()\n",
"logger.debug('No Data returned form influxdb')\n",
"if len(pid.measurement.split(',')) == 2:\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condit... |
[
"def FUNC_63(VAR_79):...\n",
""
] | [
"def getConfigValue(key):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_169(VAR_212, VAR_215, VAR_101=VAR_101):...\n",
"for VAR_440 in (VAR_212.tags or []):\n",
"VAR_440 = VAR_440.strip().lower()\n",
"if VAR_440:\n",
"VAR_101.wiki_tag.insert(VAR_148=tag, wiki_page=id)\n"
] | [
"def update_tags_insert(page, id, db=db):...\n",
"for tag in (page.tags or []):\n",
"tag = tag.strip().lower()\n",
"if tag:\n",
"db.wiki_tag.insert(name=tag, wiki_page=id)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_8(self, VAR_3, VAR_4):...\n",
"VAR_17 = self.default_config()\n",
"VAR_17['require_auth_for_profile_requests'] = True\n",
"VAR_17['limit_profile_requests_to_users_who_share_rooms'] = True\n",
"self.hs = self.setup_test_homeserver(VAR_17=config)\n",
"return self.hs\n"
] | [
"def make_homeserver(self, reactor, clock):...\n",
"config = self.default_config()\n",
"config['require_auth_for_profile_requests'] = True\n",
"config['limit_profile_requests_to_users_who_share_rooms'] = True\n",
"self.hs = self.setup_test_homeserver(config=config)\n",
"return self.hs\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.hs.config.use_presence = True\n",
"VAR_7 = {'presence': 'here', 'status_msg': 'beep boop'}\n",
"VAR_8, VAR_9 = self.make_request('PUT', '/presence/%s/status' % (self.\n user_id,), VAR_7)\n",
"self.assertEqual(VAR_9.code, 200)\n",
"self.assert... | [
"def test_put_presence(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.hs.config.use_presence = True\n",
"body = {'presence': 'here', 'status_msg': 'beep boop'}\n",
"request, channel = self.make_request('PUT', '/presence/%s/status' % (self.\n user_id,), body)\n",
"self.assertEqual(channel.code, 200)\n",... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5.SERVICE_OPTS.setOmeroGroup(int(VAR_20))\n",
"VAR_103 = getIntOrDefault(VAR_2, 'owner', None)\n",
"VAR_104 = BaseContainer(VAR_5)\n",
"VAR_104.listContainerHierarchy(VAR_103)\n",
"VAR_54 = 'webclient/data/chgrp_target_tree.html'\n",
"VAR_53 = ... | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"conn.SERVICE_OPTS.setOmeroGroup(int(group_id))\n",
"owner = getIntOrDefault(request, 'owner', None)\n",
"manager = BaseContainer(conn)\n",
"manager.listContainerHierarchy(owner)\n",
"template = 'webclient/data/chgrp_target_tree.html'\n",
"context =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"async def FUNC_43(self, VAR_1: EventBase, VAR_49: RoomStreamToken) ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_152 = []\n",
"if VAR_1.type == VAR_188.Member:\n",
"VAR_43 = VAR_1.state_key\n",
"if VAR_1.internal_metadata.is_outlier():\n",
"if VAR_1.internal_metadata.is_outlier():\n",
"return\n",
... | [
"async def _notify_persisted_event(self, event: EventBase, max_stream_token:...\n",
"\"\"\"docstring\"\"\"\n",
"extra_users = []\n",
"if event.type == EventTypes.Member:\n",
"target_user_id = event.state_key\n",
"if event.internal_metadata.is_outlier():\n",
"if event.internal_metadata.is_outlier():\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assert'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"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'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_42 = argparse.ArgumentParser(VAR_39=description)\n",
"VAR_42.add_argument('-c', '--config-path', action='append', metavar=\n 'CONFIG_FILE', help=\n 'Specify config file. Can be given multiple times and may specify directories containing *.yaml files.'... | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"parser = argparse.ArgumentParser(description=description)\n",
"parser.add_argument('-c', '--config-path', action='append', metavar=\n 'CONFIG_FILE', help=\n 'Specify config file. Can be given multiple times and may specify directories containing *.yaml fi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"... |
[
"def FUNC_8(self):...\n",
"VAR_4 = keyring.Keyring(self.hs)\n",
"VAR_20 = signedjson.key.generate_signing_key(1)\n",
"VAR_27 = self.hs.get_datastore().store_server_verify_keys('server9', time.\n time() * 1000, [('server9', FUNC_0(VAR_20), FetchKeyResult(\n get_verify_key(VAR_20), 1000))])\n",
"self.ge... | [
"def test_verify_json_for_server(self):...\n",
"kr = keyring.Keyring(self.hs)\n",
"key1 = signedjson.key.generate_signing_key(1)\n",
"r = self.hs.get_datastore().store_server_verify_keys('server9', time.time() *\n 1000, [('server9', get_key_id(key1), FetchKeyResult(get_verify_key(key1\n ), 1000))])\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = self.register_user('user', 'pass')\n",
"VAR_10 = self.login('user', 'pass')\n",
"VAR_11 = self.register_user('otheruser', 'pass')\n",
"VAR_12 = self.login('otheruser', 'pass')\n",
"VAR_18 = self.register_user('yetanotheruser', 'pass')\n",
"... | [
"def test_sends_high_priority_for_one_to_one_only(self):...\n",
"\"\"\"docstring\"\"\"\n",
"user_id = self.register_user('user', 'pass')\n",
"access_token = self.login('user', 'pass')\n",
"other_user_id = self.register_user('otheruser', 'pass')\n",
"other_access_token = self.login('otheruser', 'pass')\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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"... |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = signedjson.key.generate_signing_key(random_string(5))\n",
"self.expect_outgoing_key_request(self.hs.hostname, VAR_14)\n",
"VAR_21 = 'ed25519:%s' % (VAR_14.version,)\n",
"VAR_22 = PerspectivesKeyFetcher(self.hs2)\n",
"VAR_23 = VAR_22.get_keys... | [
"def test_get_notary_key(self):...\n",
"\"\"\"docstring\"\"\"\n",
"testkey = signedjson.key.generate_signing_key(random_string(5))\n",
"self.expect_outgoing_key_request(self.hs.hostname, testkey)\n",
"keyid = 'ed25519:%s' % (testkey.version,)\n",
"fetcher = PerspectivesKeyFetcher(self.hs2)\n",
"d = fetc... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assert'",
"Expr'"
] |
[
"@staticmethod...\n",
"VAR_7 = deepcopy(VAR_7)\n",
"for code, response_data in VAR_5.items():\n",
"VAR_24 = response_from_data(status_code=int(code), VAR_5=response_data)\n",
"return VAR_7\n",
"if isinstance(VAR_24, ParseError):\n",
"return ParseError(detail=\n f'cannot parse response of endpoint {en... | [
"@staticmethod...\n",
"endpoint = deepcopy(endpoint)\n",
"for code, response_data in data.items():\n",
"response = response_from_data(status_code=int(code), data=response_data)\n",
"return endpoint\n",
"if isinstance(response, ParseError):\n",
"return ParseError(detail=\n f'cannot parse response of e... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Return'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(VAR_4, VAR_13, VAR_3):...\n",
"if '%(key)s' in VAR_4:\n",
"VAR_4 = VAR_4.replace('%(key)s', VAR_13)\n",
"if '%s' in VAR_4:\n",
"VAR_4 = VAR_4.replace('%s', (VAR_3 or '') + '%')\n",
"return VAR_4\n"
] | [
"def scrub_custom_query(query, key, txt):...\n",
"if '%(key)s' in query:\n",
"query = query.replace('%(key)s', key)\n",
"if '%s' in query:\n",
"query = query.replace('%s', (txt or '') + '%')\n",
"return query\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"@login_required(ignore_login_fail=True)...\n",
"\"\"\"docstring\"\"\"\n",
"return HttpResponse('OK')\n"
] | [
"@login_required(ignore_login_fail=True)...\n",
"\"\"\"docstring\"\"\"\n",
"return HttpResponse('OK')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.