lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "def FUNC_34(VAR_9, VAR_14, VAR_31):...\n", "VAR_83 = {}\n", "VAR_85 = read_po(FUNC_47, VAR_14=locale, VAR_31=domain)\n", "for message in VAR_85:\n", "VAR_141 = message.id\n", "return VAR_83, VAR_85.plural_expr\n", "if isinstance(VAR_141, (list, tuple)):\n", "VAR_141 = VAR_141[0]\n", "if message.str...
[ "def messages_from_po(path, locale, domain):...\n", "messages = {}\n", "catalog = read_po(f, locale=locale, domain=domain)\n", "for message in catalog:\n", "message_id = message.id\n", "return messages, catalog.plural_expr\n", "if isinstance(message_id, (list, tuple)):\n", "message_id = message_id[0]\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Condition", "Assign'" ]
[ "@internationalizeDocstring...\n", "\"\"\"docstring\"\"\"\n", "if self._calc_match_forbidden_chars.match(VAR_18):\n", "VAR_3.error(VAR_0('string'))\n", "VAR_18 = self._calc_remover(VAR_18)\n", "return\n", "if 'lambda' in VAR_18:\n", "VAR_3.error(VAR_0(\"You can't use lambda in this command.\"))\n", ...
[ "@internationalizeDocstring...\n", "\"\"\"docstring\"\"\"\n", "if self._calc_match_forbidden_chars.match(text):\n", "irc.error(_(\n \"There's really no reason why you should have underscores or brackets in your mathematical expression. Please remove them.\"\n ))\n", "text = self._calc_remover(text)\n...
[ 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5, 0, 5, 0, 0 ]
[ "Condition", "Docstring", "For", "Expr'", "Assign'", "Return'", "Condition", "Expr'", "Assign'", "Return'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_1(VAR_0, VAR_3='djangojs'):...\n", "from shuup.utils.i18n import javascript_catalog_all\n", "return javascript_catalog_all(VAR_0, VAR_3)\n" ]
[ "def front_javascript_catalog_all(request, domain='djangojs'):...\n", "from shuup.utils.i18n import javascript_catalog_all\n", "return javascript_catalog_all(request, domain)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "def FUNC_12(VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "VAR_33 = 'import', ';', 'subprocess', 'eval', 'open', 'file', 'exec', 'input'\n", "for bad in VAR_33:\n", "if VAR_17.count(bad):\n", "return True\n", "return False\n" ]
[ "def safe_py_code(code):...\n", "\"\"\"docstring\"\"\"\n", "bads = 'import', ';', 'subprocess', 'eval', 'open', 'file', 'exec', 'input'\n", "for bad in bads:\n", "if code.count(bad):\n", "return True\n", "return False\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Return'" ]
[ "def FUNC_43(VAR_62, VAR_9):...\n", "FUNC_10().hdel('last_modified', VAR_62)\n", "VAR_46 = FUNC_42(VAR_62, VAR_9)\n", "if VAR_46 in VAR_1.document_cache:\n", "FUNC_10().hdel('document_cache', VAR_46)\n" ]
[ "def clear_document_cache(doctype, name):...\n", "cache().hdel('last_modified', doctype)\n", "key = get_document_cache_key(doctype, name)\n", "if key in local.document_cache:\n", "cache().hdel('document_cache', key)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_7(self, VAR_22):...\n", "VAR_29 = VAR_22.encode('utf-8')\n", "VAR_18 = FUNC_7(VAR_29, mode='eval')\n", "self.restricted_python_transformer.visit(VAR_18)\n", "self.page_templates_expression_transformer.visit(VAR_18)\n", "return VAR_18\n" ]
[ "def parse(self, string):...\n", "encoded = string.encode('utf-8')\n", "node = parse(encoded, mode='eval')\n", "self.restricted_python_transformer.visit(node)\n", "self.page_templates_expression_transformer.visit(node)\n", "return node\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_172(VAR_354):...\n", "return VAR_354 + ' ' + VAR_354.replace('icon', 'glyphicon')\n" ]
[ "def rename(icon):...\n", "return icon + ' ' + icon.replace('icon', 'glyphicon')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/api/queue', methods=['GET'])...\n", "" ]
[ "@gui.route('/api/queue', methods=['GET'])...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def __init__(self, VAR_27, *VAR_6, **VAR_7):...\n", "self.unit_set = VAR_27\n", "super().__init__(*VAR_6, **kwargs)\n" ]
[ "def __init__(self, unit_set, *args, **kwargs):...\n", "self.unit_set = unit_set\n", "super().__init__(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2, 2),...\n", "return {'res': VAR_45 + self.var}\n" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2, 2),...\n", "return {'res': x + self.var}\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_0(self, VAR_1):...\n", "from openapi_python_client.parser.properties import UnionProperty\n", "VAR_13 = VAR_1.MagicMock()\n", "VAR_13.get_type_string.return_value = 'inner_type_string_1'\n", "VAR_14 = VAR_1.MagicMock()\n", "VAR_14.get_type_string.return_value = 'inner_type_string_2'\n", "VAR_4...
[ "def test_get_type_string(self, mocker):...\n", "from openapi_python_client.parser.properties import UnionProperty\n", "inner_property_1 = mocker.MagicMock()\n", "inner_property_1.get_type_string.return_value = 'inner_type_string_1'\n", "inner_property_2 = mocker.MagicMock()\n", "inner_property_2.get_type...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assert'", "Assign'", "Assert'" ]
[ "@FUNC_0...\n", "return ApplicationServicesHandler(self)\n" ]
[ "@cache_in_self...\n", "return ApplicationServicesHandler(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_64(self, VAR_2):...\n", "" ]
[ "def write(self, data):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@VAR_2.route('/', defaults={'page': 1})...\n", "VAR_20 = (request.args.get('sort') or 'stored').lower()\n", "return FUNC_15('newest', VAR_20, 1, VAR_9)\n" ]
[ "@web.route('/', defaults={'page': 1})...\n", "sort_param = (request.args.get('sort') or 'stored').lower()\n", "return render_books_list('newest', sort_param, 1, page)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Return'" ]
[ "@login_required...\n", "VAR_5 = get_object_or_404(CommentPollChoice.objects.unremoved().\n select_related('poll'), VAR_1=pk)\n", "if not VAR_5.poll.can_show_results:\n", "VAR_6 = CommentPollVote.objects.unremoved().for_choice(VAR_5=choice\n ).select_related('voter__st')\n", "VAR_6 = yt_paginate(VAR_6...
[ "@login_required...\n", "choice = get_object_or_404(CommentPollChoice.objects.unremoved().\n select_related('poll'), pk=pk)\n", "if not choice.poll.can_show_results:\n", "choice_votes = CommentPollVote.objects.unremoved().for_choice(choice=choice\n ).select_related('voter__st')\n", "choice_votes = yt_...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_21(VAR_23, VAR_24, VAR_25):...\n", "if VAR_23 != 'SECRET_KEY':\n", "if type(VAR_24) is dict:\n", "for k, v in VAR_24.items():\n", "VAR_25[VAR_23] = VAR_24\n", "FUNC_21(k, v, VAR_25[VAR_23])\n" ]
[ "def update_config_value(key, val, dictionary):...\n", "if key != 'SECRET_KEY':\n", "if type(val) is dict:\n", "for k, v in val.items():\n", "dictionary[key] = val\n", "update_config_value(k, v, dictionary[key])\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "For", "Assign'", "Expr'" ]
[ "def FUNC_32(VAR_37, VAR_38):...\n", "if VAR_37 != _(u'Unknown') and VAR_38 != _(u'Unknown'):\n", "VAR_95 = calibre_db.check_exists_book(VAR_38, VAR_37)\n", "VAR_62 = VAR_38.split('&')\n", "if VAR_95:\n", "VAR_62 = list(map(lambda it: it.strip().replace(',', '|'), VAR_62))\n", "VAR_2.info('Uploaded book...
[ "def prepare_authors_on_upload(title, authr):...\n", "if title != _(u'Unknown') and authr != _(u'Unknown'):\n", "entry = calibre_db.check_exists_book(authr, title)\n", "input_authors = authr.split('&')\n", "if entry:\n", "input_authors = list(map(lambda it: it.strip().replace(',', '|'),\n input_authors...
[ 0, 0, 0, 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'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'...
[ "@VAR_2.route('/ajax/deleterestriction/<int:res_type>/<int:user_id>',...\n", "VAR_10 = request.form.to_dict()\n", "if VAR_8 == 0:\n", "if VAR_10['id'].startswith('a'):\n", "if VAR_8 == 1:\n", "config.config_allowed_tags = FUNC_28(VAR_10, config.list_allowed_tags)\n", "if VAR_10['id'].startswith('d'):\n"...
[ "@admi.route('/ajax/deleterestriction/<int:res_type>/<int:user_id>', methods...\n", "element = request.form.to_dict()\n", "if res_type == 0:\n", "if element['id'].startswith('a'):\n", "if res_type == 1:\n", "config.config_allowed_tags = restriction_deletion(element, config.\n list_allowed_tags)\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 ]
[ "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Condition", "Condition", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Condition", "Condition", "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Co...
[ "def __str__(self):...\n", "VAR_151 = '%s ' % self.field\n", "if not self.new_value:\n", "VAR_151 += ugettext('removed')\n", "if not self.old_value:\n", "return VAR_151\n", "VAR_151 += ugettext('set to %s') % self.new_value\n", "VAR_151 += ugettext('changed from \"%(old_value)s\" to \"%(new_value)s\"'...
[ "def __str__(self):...\n", "out = '%s ' % self.field\n", "if not self.new_value:\n", "out += ugettext('removed')\n", "if not self.old_value:\n", "return out\n", "out += ugettext('set to %s') % self.new_value\n", "out += ugettext('changed from \"%(old_value)s\" to \"%(new_value)s\"') % {\n 'old_valu...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "AugAssign'", "Condition", "Return'", "AugAssign'", "AugAssign'" ]
[ "def FUNC_21(self, VAR_43, VAR_29=None, VAR_30=None):...\n", "\"\"\"docstring\"\"\"\n", "self.invoke_all('read_config', VAR_43, VAR_29=config_dir_path, VAR_30=\n data_dir_path)\n" ]
[ "def parse_config_dict(self, config_dict, config_dir_path=None,...\n", "\"\"\"docstring\"\"\"\n", "self.invoke_all('read_config', config_dict, config_dir_path=config_dir_path,\n data_dir_path=data_dir_path)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def __init__(self, VAR_14: BinaryIO, VAR_35: defer.Deferred, VAR_15:...\n", "self.stream = VAR_14\n", "self.deferred = VAR_35\n", "self.length = 0\n", "self.max_size = VAR_15\n" ]
[ "def __init__(self, stream: BinaryIO, deferred: defer.Deferred, max_size:...\n", "self.stream = stream\n", "self.deferred = deferred\n", "self.length = 0\n", "self.max_size = max_size\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@defer.inlineCallbacks...\n", "VAR_18 = yield FUNC_7(VAR_11)\n", "for member in VAR_18:\n", "if VAR_14 is not None and member == VAR_14:\n", "if VAR_6.is_mine(member):\n", "if VAR_12 is not None:\n", "if VAR_13 is not None:\n", "VAR_12.add(member)\n", "VAR_13.add(member.domain)\n" ]
[ "@defer.inlineCallbacks...\n", "members = yield get_room_members(room_id)\n", "for member in members:\n", "if ignore_user is not None and member == ignore_user:\n", "if hs.is_mine(member):\n", "if localusers is not None:\n", "if remotedomains is not None:\n", "localusers.add(member)\n", "remotedomai...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "For", "Condition", "Condition", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10, VAR_11=None, VAR_12=None):...\n", "VAR_14 = super(CLASS_0, self).create_option(VAR_6=name, VAR_7=value, VAR_8=\n label, VAR_9=selected, VAR_10=index, VAR_11=subindex, VAR_12=attrs)\n", "VAR_14['attrs']['data-color'] = self.queryset.get(pk=value).color\n",...
[ "def create_option(self, name, value, label, selected, index, subindex=None,...\n", "result = super(TagFormWidget, self).create_option(name=name, value=value,\n label=label, selected=selected, index=index, subindex=subindex, attrs=attrs\n )\n", "result['attrs']['data-color'] = self.queryset.get(pk=value)....
[ 0, 2, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@transaction.non_atomic_requests...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "if not BulkEmailFlag.feature_enabled(VAR_10):\n", "return HttpResponseForbidden('Email is not enabled for this course.')\n", "VAR_138 = json.loads(VAR_9.POST.get('send_...
[ "@transaction.non_atomic_requests...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "if not BulkEmailFlag.feature_enabled(course_id):\n", "return HttpResponseForbidden('Email is not enabled for this course.')\n", "targets = json.loads(request.POST...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Expr'", "Assign'", "Return'" ]
[ "def __getattr__(self, VAR_14: str) ->Any:...\n", "\"\"\"docstring\"\"\"\n", "if VAR_14 in ['generate_config_section', 'read_config']:\n", "if self.root is None:\n", "return self.root._get_unclassed_config(self.section, VAR_14)\n" ]
[ "def __getattr__(self, item: str) ->Any:...\n", "\"\"\"docstring\"\"\"\n", "if item in ['generate_config_section', 'read_config']:\n", "if self.root is None:\n", "return self.root._get_unclassed_config(self.section, item)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Return'" ]
[ "async def FUNC_3(self, VAR_5: str, VAR_6: Optional[str], VAR_7: IO, VAR_8:...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = random_string(24)\n", "VAR_26 = FileInfo(VAR_3=None, VAR_18=media_id)\n", "VAR_27 = await self.media_storage.store_file(VAR_7, VAR_26)\n", "VAR_0.info('Stored local media in file %r', VAR...
[ "async def create_content(self, media_type: str, upload_name: Optional[str],...\n", "\"\"\"docstring\"\"\"\n", "media_id = random_string(24)\n", "file_info = FileInfo(server_name=None, file_id=media_id)\n", "fname = await self.media_storage.store_file(content, file_info)\n", "logger.info('Stored local med...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_20(self):...\n", "VAR_22, VAR_23 = self.make_request('POST', '/createRoom',\n b'{\"invite\":[\"@alice:example.com \"]}')\n", "self.assertEquals(400, VAR_23.code)\n" ]
[ "def test_post_room_invitees_invalid_mxid(self):...\n", "request, channel = self.make_request('POST', '/createRoom',\n b'{\"invite\":[\"@alice:example.com \"]}')\n", "self.assertEquals(400, channel.code)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "VAR_7['auto_id'] = 'id_branch_%s'\n", "super().__init__(*VAR_6, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "kwargs['auto_id'] = 'id_branch_%s'\n", "super().__init__(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_7(self, VAR_3) ->Optional[bool]:...\n", "\"\"\"docstring\"\"\"\n", "return None\n" ]
[ "def cheaplyExists(self, _) ->Optional[bool]:...\n", "\"\"\"docstring\"\"\"\n", "return None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_13(VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "VAR_43 = {}\n", "VAR_44 = VAR_17.split(';')\n", "for input_raw in filter(bool, VAR_44):\n", "VAR_70 = re.match('([^=]+)=([^\\\\[\\\\]]+)\\\\[([^\\\\[\\\\]]+)\\\\]$', input_raw)\n", "return VAR_43\n", "if VAR_70:\n", "VAR_43[VAR_70.group(1)] = ...
[ "def preprocess_inputs_arg_string(inputs_str):...\n", "\"\"\"docstring\"\"\"\n", "input_dict = {}\n", "inputs_raw = inputs_str.split(';')\n", "for input_raw in filter(bool, inputs_raw):\n", "match = re.match('([^=]+)=([^\\\\[\\\\]]+)\\\\[([^\\\\[\\\\]]+)\\\\]$', input_raw)\n", "return input_dict\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Assign'" ]
[ "@pytest.fixture...\n", "from tests.testapp.models import FileModel\n", "return FileModel.objects.create(file=ContentFile(request.node.name, \n '%s.txt' % request.node.name))\n" ]
[ "@pytest.fixture...\n", "from tests.testapp.models import FileModel\n", "return FileModel.objects.create(file=ContentFile(request.node.name, \n '%s.txt' % request.node.name))\n" ]
[ 0, 0, 0 ]
[ "Condition", "ImportFrom'", "Return'" ]
[ "def __init__(self, VAR_5, VAR_4, *VAR_6, **VAR_7):...\n", "super().__init__(VAR_5, VAR_4, *VAR_6, **kwargs)\n", "self.fields['context'].widget.attrs['tabindex'] = 99\n", "self.fields['source'].widget.attrs['tabindex'] = 100\n", "self.fields['source'].widget.profile = VAR_4.profile\n", "self.fields['sourc...
[ "def __init__(self, translation, user, *args, **kwargs):...\n", "super().__init__(translation, user, *args, **kwargs)\n", "self.fields['context'].widget.attrs['tabindex'] = 99\n", "self.fields['source'].widget.attrs['tabindex'] = 100\n", "self.fields['source'].widget.profile = user.profile\n", "self.field...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "import yaml\n", "from ansible.utils.vault import VaultLib\n", "from ansible.parsing.vault import VaultLib\n", "\"\"\"R/W an ansible-vault yaml file\"\"\"\n", "def __init__(self, VAR_0):...\n", "self.password = VAR_0\n", "self.vault = VaultLib(VAR_0)\n", "def FUNC_0(self, VAR_1):...\n", "\"\"\"docst...
[ "import yaml\n", "from ansible.utils.vault import VaultLib\n", "from ansible.parsing.vault import VaultLib\n", "\"\"\"R/W an ansible-vault yaml file\"\"\"\n", "def __init__(self, password):...\n", "self.password = password\n", "self.vault = VaultLib(password)\n", "def load(self, stream):...\n", "\"\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_15():...\n", "VAR_3 = FUNC_5()\n", "VAR_11 = apath(VAR_3, VAR_122=request)\n", "def FUNC_58(VAR_44):...\n", "return [VAR_221 for VAR_221 in VAR_44 if not (VAR_221[:1] in '#' or VAR_221\n .endswith('~') or VAR_221.endswith('.bak'))]\n" ]
[ "def pack_custom():...\n", "app = get_app()\n", "base = apath(app, r=request)\n", "def ignore(fs):...\n", "return [f for f in fs if not (f[:1] in '#' or f.endswith('~') or f.endswith\n ('.bak'))]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_5(self):...\n", "if self.timed_call:\n", "self.timed_call.cancel()\n", "self.timed_call = None\n" ]
[ "def on_stop(self):...\n", "if self.timed_call:\n", "self.timed_call.cancel()\n", "self.timed_call = None\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'" ]
[ "def FUNC_2(VAR_18: Text=DEFAULT_MODELS_PATH) ->Optional[Text]:...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(VAR_18) or os.path.isfile(VAR_18):\n", "VAR_18 = os.path.dirname(VAR_18)\n", "VAR_49 = glob.glob(os.path.join(VAR_18, '*.tar.gz'))\n", "if len(VAR_49) == 0:\n", "return None\n", "re...
[ "def get_latest_model(model_path: Text=DEFAULT_MODELS_PATH) ->Optional[Text]:...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(model_path) or os.path.isfile(model_path):\n", "model_path = os.path.dirname(model_path)\n", "list_of_files = glob.glob(os.path.join(model_path, '*.tar.gz'))\n", "if len(l...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_8, *VAR_6, **VAR_7):...\n", "super().__init__(*VAR_6, **kwargs)\n", "self.helper = FormHelper()\n", "self.helper.form_tag = False\n", "self.request = VAR_8\n" ]
[ "def __init__(self, request, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n", "self.helper = FormHelper()\n", "self.helper.form_tag = False\n", "self.request = request\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_118(*VAR_9, **VAR_13):...\n", "VAR_431, VAR_432, VAR_141 = self.basic()\n", "VAR_141 = VAR_141 or self.user\n", "VAR_433 = VAR_145\n", "if callable(VAR_433):\n", "VAR_433 = VAR_433()\n", "if VAR_433:\n", "if not VAR_141:\n", "if callable(VAR_144):\n", "if VAR_263.request.ajax:\n", "VAR...
[ "def f(*a, **b):...\n", "basic_allowed, basic_accepted, user = self.basic()\n", "user = user or self.user\n", "login_required = requires_login\n", "if callable(login_required):\n", "login_required = login_required()\n", "if login_required:\n", "if not user:\n", "if callable(condition):\n", "if cur...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Return'", "Return'", "Expr'", "Assign'", "Return'", "Assign'"...
[ "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'" ]
[ "@app.route('/tags')...\n", "if not app.config['SEARCH_CONF']['engine'] == 'ripgrep' and not which('rg'):\n", "flash('Ripgrep must be installed to view pages about embedded tags.', 'error')\n", "VAR_10 = sorted(get_all_tags(force=True))\n", "return redirect('/')\n", "return render_template('tags/all.html'...
[ "@app.route('/tags')...\n", "if not app.config['SEARCH_CONF']['engine'] == 'ripgrep' and not which('rg'):\n", "flash('Ripgrep must be installed to view pages about embedded tags.', 'error')\n", "tags = sorted(get_all_tags(force=True))\n", "return redirect('/')\n", "return render_template('tags/all.html', ...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_17(self):...\n", "VAR_27 = np.ones([2, 10])\n", "VAR_38 = np.array([[1], [2], [3]])\n", "VAR_39 = np.mgrid[0:5, 0:5]\n", "VAR_40 = [[3], [4]]\n", "VAR_21 = (\n 'x1=np.ones([2,10]);x2=np.array([[1],[2],[3]]);x3=np.mgrid[0:5,0:5];x4=[[3],[4]]'\n )\n", "VAR_30 = saved_model_cli.load_inputs_...
[ "def testInputParserPythonExpression(self):...\n", "x1 = np.ones([2, 10])\n", "x2 = np.array([[1], [2], [3]])\n", "x3 = np.mgrid[0:5, 0:5]\n", "x4 = [[3], [4]]\n", "input_expr_str = (\n 'x1=np.ones([2,10]);x2=np.array([[1],[2],[3]]);x3=np.mgrid[0:5,0:5];x4=[[3],[4]]'\n )\n", "feed_dict = saved_mod...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_23(self, VAR_17):...\n", "" ]
[ "def api_listdir(self, directory):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@login_required...\n", "VAR_11 = TopicPrivate.objects.for_create_or_404(VAR_3, VAR_1.user)\n", "VAR_14 = TopicPrivateInviteForm(VAR_12=topic_private.topic, data=post_data(\n request))\n", "if VAR_14.is_valid():\n", "VAR_14.save()\n", "messages.error(VAR_1, utils.render_form_errors(VAR_14))\n", "noti...
[ "@login_required...\n", "topic_private = TopicPrivate.objects.for_create_or_404(topic_id, request.user)\n", "form = TopicPrivateInviteForm(topic=topic_private.topic, data=post_data(\n request))\n", "if form.is_valid():\n", "form.save()\n", "messages.error(request, utils.render_form_errors(form))\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 4 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_63(VAR_121=True, VAR_24=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_24:\n", "VAR_24 = VAR_1.sites_path\n", "VAR_189 = FUNC_69(os.path.join(VAR_24, 'apps.txt'), VAR_126=True)\n", "if VAR_121:\n", "for VAR_219 in FUNC_69(os.path.join(VAR_1.site_path, 'apps.txt')):\n", "if 'frappe' in ...
[ "def get_all_apps(with_internal_apps=True, sites_path=None):...\n", "\"\"\"docstring\"\"\"\n", "if not sites_path:\n", "sites_path = local.sites_path\n", "apps = get_file_items(os.path.join(sites_path, 'apps.txt'), raise_not_found\n =True)\n", "if with_internal_apps:\n", "for app in get_file_items(os...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Condition", "For", "Condition", "Condition", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "@override_config({'send_federation': True})...\n", "self.room_members = [VAR_0, VAR_2]\n", "self.get_success(self.handler.started_typing(target_user=U_APPLE, requester\n =create_requester(U_APPLE), VAR_16=ROOM_ID, timeout=20000))\n", "VAR_19 = self.hs.get_http_client().put_json\n", "VAR_19.assert_called...
[ "@override_config({'send_federation': True})...\n", "self.room_members = [U_APPLE, U_ONION]\n", "self.get_success(self.handler.started_typing(target_user=U_APPLE, requester\n =create_requester(U_APPLE), room_id=ROOM_ID, timeout=20000))\n", "put_json = self.hs.get_http_client().put_json\n", "put_json.asse...
[ 0, 0, 0, 4, 0 ]
[ "Condition", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@require_POST...\n", "if not is_ajax(VAR_0):\n", "return Http404()\n", "VAR_7 = CommentImageForm(VAR_5=request.user, data=request.POST, files=\n request.FILES)\n", "if VAR_7.is_valid():\n", "VAR_13 = VAR_7.save()\n", "return json_response({'error': dict(VAR_7.errors.items())})\n", "return json_res...
[ "@require_POST...\n", "if not is_ajax(request):\n", "return Http404()\n", "form = CommentImageForm(user=request.user, data=request.POST, files=request\n .FILES)\n", "if form.is_valid():\n", "image = form.save()\n", "return json_response({'error': dict(form.errors.items())})\n", "return json_respons...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Return'" ]
[ "def FUNC_3(VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = 'Browse directory: {}'.format(VAR_4)\n", "if FUNC_1(VAR_4):\n", "VAR_12 = None\n", "VAR_12 = FUNC_2(VAR_4)\n", "VAR_1 = os.listdir(VAR_4)\n", "VAR_10 = jinja.render('error.html', VAR_7='Error while reading directory',\n url='file:///{}'...
[ "def dirbrowser_html(path):...\n", "\"\"\"docstring\"\"\"\n", "title = 'Browse directory: {}'.format(path)\n", "if is_root(path):\n", "parent = None\n", "parent = parent_dir(path)\n", "all_files = os.listdir(path)\n", "html = jinja.render('error.html', title='Error while reading directory',\n url='...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_37(self, VAR_113='Welcome', VAR_114=None, VAR_115=(' [ ', ' | ',...\n", "\"\"\"docstring\"\"\"\n", "VAR_250 = []\n", "self.bar = ''\n", "VAR_28 = VAR_263.T\n", "VAR_117 = [] if not VAR_117 else VAR_117\n", "if not VAR_114:\n", "VAR_114 = self.url(self.settings.function)\n", "VAR_56 = VAR_2...
[ "def navbar(self, prefix='Welcome', action=None, separators=(' [ ', ' | ',...\n", "\"\"\"docstring\"\"\"\n", "items = []\n", "self.bar = ''\n", "T = current.T\n", "referrer_actions = [] if not referrer_actions else referrer_actions\n", "if not action:\n", "action = self.url(self.settings.function)\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_4(self):...\n", "VAR_4 = self._makeEngine()\n", "for p in ('x', 'x/y', 'x/y/z'):\n", "VAR_4.compile(p)\n", "VAR_4.compile('path:a|b|c/d/e')\n", "VAR_4.compile('string:Fred')\n", "VAR_4.compile('string:A$B')\n", "VAR_4.compile('string:a ${x/y} b ${y/z} c')\n", "VAR_4.compile('python: 2 + 2'...
[ "def test_compile(self):...\n", "e = self._makeEngine()\n", "for p in ('x', 'x/y', 'x/y/z'):\n", "e.compile(p)\n", "e.compile('path:a|b|c/d/e')\n", "e.compile('string:Fred')\n", "e.compile('string:A$B')\n", "e.compile('string:a ${x/y} b ${y/z} c')\n", "e.compile('python: 2 + 2')\n", "e.compile(\"\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_2.route('/ajax/listrestriction/<int:res_type>', defaults={'user_id': 0})...\n", "if VAR_8 == 0:\n", "VAR_103 = [{'Element': VAR_17, 'type': _('Deny'), 'id': 'd' + str(i)} for i,\n VAR_17 in enumerate(config.list_denied_tags()) if VAR_17 != '']\n", "if VAR_8 == 1:\n", "VAR_7 = [{'Element': VAR_17, '...
[ "@admi.route('/ajax/listrestriction/<int:res_type>', defaults={'user_id': 0})...\n", "if res_type == 0:\n", "restrict = [{'Element': x, 'type': _('Deny'), 'id': 'd' + str(i)} for i, x in\n enumerate(config.list_denied_tags()) if x != '']\n", "if res_type == 1:\n", "allow = [{'Element': x, 'type': _('Allo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "As...
[ "def FUNC_13(self):...\n", "if self.report_type == 'Script Report':\n", "make_boilerplate('controller.py', self, {'name': self.name})\n", "make_boilerplate('controller.js', self, {'name': self.name})\n" ]
[ "def create_report_py(self):...\n", "if self.report_type == 'Script Report':\n", "make_boilerplate('controller.py', self, {'name': self.name})\n", "make_boilerplate('controller.js', self, {'name': self.name})\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_118(*VAR_9, **VAR_13):...\n", "VAR_431, VAR_432, VAR_141 = self.basic()\n", "VAR_141 = VAR_141 or self.user\n", "VAR_433 = VAR_145\n", "if callable(VAR_433):\n", "VAR_433 = VAR_433()\n", "if VAR_433:\n", "if not VAR_141:\n", "if callable(VAR_144):\n", "if VAR_263.request.ajax:\n", "VAR...
[ "def f(*a, **b):...\n", "basic_allowed, basic_accepted, user = self.basic()\n", "user = user or self.user\n", "login_required = requires_login\n", "if callable(login_required):\n", "login_required = login_required()\n", "if login_required:\n", "if not user:\n", "if callable(condition):\n", "if cur...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Return'", "Return'", "Expr'", "Assign'", "Return'", "Assign'"...
[ "def FUNC_1(VAR_3):...\n", "return unicode(VAR_3).encode('utf-8')\n" ]
[ "def _safestr(s):...\n", "return unicode(s).encode('utf-8')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_87(VAR_62):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.modules import get_doctype_module, get_module_path\n", "VAR_43 = os.path.join(FUNC_58(get_doctype_module(VAR_62)), 'doctype',\n FUNC_56(VAR_62), 'test_records.json')\n", "if os.path.exists(VAR_43):\n", "return json.loads(f.read())\n",...
[ "def get_test_records(doctype):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.modules import get_doctype_module, get_module_path\n", "path = os.path.join(get_module_path(get_doctype_module(doctype)), 'doctype',\n scrub(doctype), 'test_records.json')\n", "if os.path.exists(path):\n", "return json.loads...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def __attrs_post_init__(self):...\n", "self.key_ids = signature_ids(self.json_object, self.server_name)\n" ]
[ "def __attrs_post_init__(self):...\n", "self.key_ids = signature_ids(self.json_object, self.server_name)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_15(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_139 = 'queue_access_%s' % self.slug\n", "self.permission_name = 'helpdesk.%s' % VAR_139\n", "return VAR_139\n" ]
[ "def prepare_permission_name(self):...\n", "\"\"\"docstring\"\"\"\n", "basename = 'queue_access_%s' % self.slug\n", "self.permission_name = 'helpdesk.%s' % basename\n", "return basename\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_29(VAR_66):...\n", "VAR_105 = FUNC_28(VAR_66._identifier, VAR_66.on_ui_render, VAR_15=p.\n get_ui_additional_key_data_for_cache, VAR_61=p.\n get_ui_additional_tracked_files, VAR_63=p.get_ui_custom_tracked_files,\n VAR_64=p.get_ui_custom_etag, VAR_65=p.get_ui_custom_lastmodified,\n VAR_62=p.g...
[ "def plugin_view(p):...\n", "cached = get_cached_view(p._identifier, p.on_ui_render, additional_key_data\n =p.get_ui_additional_key_data_for_cache, additional_files=p.\n get_ui_additional_tracked_files, custom_files=p.\n get_ui_custom_tracked_files, custom_etag=p.get_ui_custom_etag,\n custom_lastmodif...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_21(self, VAR_9, VAR_20):...\n", "f.write(VAR_20)\n" ]
[ "def albumartcache_save(self, path, data):...\n", "f.write(data)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "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_2(VAR_8, VAR_9=None):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.translate import get_dict\n", "return get_dict(VAR_8, VAR_9)\n" ]
[ "def get_lang_dict(fortype, name=None):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.translate import get_dict\n", "return get_dict(fortype, name)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Return'" ]
[ "def FUNC_10(self, VAR_5, VAR_6):...\n", "VAR_7 = self.get_image_uuid(VAR_5, VAR_6)\n", "VAR_9 = self.service.show(VAR_5, VAR_7)\n", "return self._translate_uuid_to_id(VAR_5, VAR_9)\n" ]
[ "def show(self, context, image_id):...\n", "image_uuid = self.get_image_uuid(context, image_id)\n", "image = self.service.show(context, image_uuid)\n", "return self._translate_uuid_to_id(context, image)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_8(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = saved_model_utils.get_saved_model_tag_sets(VAR_2)\n", "for VAR_3 in sorted(VAR_25):\n", "print(\n \"\"\"\nMetaGraphDef with tag-set: '%s' contains the following SignatureDefs:\"\"\"\n % ', '.join(VAR_3))\n", "FUNC_5(VAR_2)\n", "VAR_3...
[ "def _show_all(saved_model_dir):...\n", "\"\"\"docstring\"\"\"\n", "tag_sets = saved_model_utils.get_saved_model_tag_sets(saved_model_dir)\n", "for tag_set in sorted(tag_sets):\n", "print(\n \"\"\"\nMetaGraphDef with tag-set: '%s' contains the following SignatureDefs:\"\"\"\n % ', '.join(tag_set))\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Expr'", "Assign'", "Assign'", "For", "Expr'", "Expr'" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2048,...\n", "return {'res': VAR_44 + self.var}\n" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2048,...\n", "return {'res': x + self.var}\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_19(self):...\n", "VAR_22, VAR_23 = self.make_request('POST', '/createRoom', b'{\"visibili')\n", "self.assertEquals(400, VAR_23.code)\n", "VAR_22, VAR_23 = self.make_request('POST', '/createRoom', b'[\"hello\"]')\n", "self.assertEquals(400, VAR_23.code)\n" ]
[ "def test_post_room_invalid_content(self):...\n", "request, channel = self.make_request('POST', '/createRoom', b'{\"visibili')\n", "self.assertEquals(400, channel.code)\n", "request, channel = self.make_request('POST', '/createRoom', b'[\"hello\"]')\n", "self.assertEquals(400, channel.code)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_0(self):...\n", "self.http_client = Mock()\n", "self.reactor = ThreadedMemoryReactorClock()\n", "self.hs_clock = Clock(self.reactor)\n", "self.homeserver = setup_test_homeserver(self.addCleanup, http_client=self.\n http_client, clock=self.hs_clock, reactor=self.reactor)\n", "VAR_0 = UserID('u...
[ "def setUp(self):...\n", "self.http_client = Mock()\n", "self.reactor = ThreadedMemoryReactorClock()\n", "self.hs_clock = Clock(self.reactor)\n", "self.homeserver = setup_test_homeserver(self.addCleanup, http_client=self.\n http_client, clock=self.hs_clock, reactor=self.reactor)\n", "user_id = UserID('...
[ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "async def FUNC_14(VAR_14, VAR_15, VAR_16, VAR_17=None, VAR_18=None):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_15(VAR_37):...\n", "VAR_39, VAR_23 = VAR_37\n", "VAR_16.write(VAR_39)\n", "return VAR_23\n" ]
[ "async def get_file(destination, path, output_stream, args=None, max_size=None):...\n", "\"\"\"docstring\"\"\"\n", "def write_to(r):...\n", "data, response = r\n", "output_stream.write(data)\n", "return response\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "@log_function...\n", "VAR_2 = FUNC_1('/get_missing_events/%s', VAR_6)\n", "VAR_19 = await self.client.post_json(VAR_5=destination, VAR_2=path, VAR_39=\n {'limit': int(limit), 'min_depth': int(min_depth), 'earliest_events':\n earliest_events, 'latest_events': latest_events}, VAR_8=timeout)\n", "return V...
[ "@log_function...\n", "path = _create_v1_path('/get_missing_events/%s', room_id)\n", "content = await self.client.post_json(destination=destination, path=path,\n data={'limit': int(limit), 'min_depth': int(min_depth),\n 'earliest_events': earliest_events, 'latest_events': latest_events},\n timeout=time...
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_15(VAR_0):...\n", "VAR_0.DEBUG = True\n", "VAR_6 = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentParent'\")\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", "ass...
[ "def test_unicorn_render_hash(settings):...\n", "settings.DEBUG = True\n", "token = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentParent'\")\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, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assert'", "Assert'", "Assert'", "Assign'", "Assign'", "Assign'", "Assert'" ]
[ "def FUNC_16(VAR_11, VAR_28=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_11:\n", "return False\n", "VAR_37 = urllib_parse.urlparse(VAR_11)[1]\n", "return not VAR_37 or VAR_37 == VAR_28\n" ]
[ "def is_safe_url(url, host=None):...\n", "\"\"\"docstring\"\"\"\n", "if not url:\n", "return False\n", "netloc = urllib_parse.urlparse(url)[1]\n", "return not netloc or netloc == host\n" ]
[ 0, 0, 0, 0, 2, 2 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_7(self, VAR_44):...\n", "VAR_77 = len(VAR_44.group(0))\n", "if VAR_77 > 1:\n", "self.tokens.append({'type': 'newline'})\n" ]
[ "def parse_newline(self, m):...\n", "length = len(m.group(0))\n", "if length > 1:\n", "self.tokens.append({'type': 'newline'})\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_14(self):...\n", "if not FUNC_19('npm'):\n", "print('npm unavailable', file=sys.stderr)\n", "if not os.path.exists(self.node_modules):\n", "return False\n", "return True\n", "return FUNC_6(self.node_modules) < FUNC_6(VAR_1(VAR_2, 'package.json'))\n" ]
[ "def should_run_npm(self):...\n", "if not which('npm'):\n", "print('npm unavailable', file=sys.stderr)\n", "if not os.path.exists(self.node_modules):\n", "return False\n", "return True\n", "return mtime(self.node_modules) < mtime(pjoin(repo_root, 'package.json'))\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Condition", "Return'", "Return'", "Return'" ]
[ "@VAR_1.route('/' + VAR_0.stats_path)...\n", "return render_template('/login.html')\n" ]
[ "@app.route('/' + trape.stats_path)...\n", "return render_template('/login.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_50(VAR_21):...\n", "return VAR_21.depth, VAR_21.event_id\n" ]
[ "def sort_fun(ev):...\n", "return ev.depth, ev.event_id\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_12(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = [[['item']], [{'item1': 'value1'}], {'item1': 'value1'}]\n", "VAR_19 = [['list'], '', None, True, False]\n", "for case in VAR_18:\n", "self.assertEqual(add_nested_class(case), 'class=nested')\n", "for case in VAR_19:\n", "self.assertEqual...
[ "def test_add_nested_class(self):...\n", "\"\"\"docstring\"\"\"\n", "positive_cases = [[['item']], [{'item1': 'value1'}], {'item1': 'value1'}]\n", "negative_cases = [['list'], '', None, True, False]\n", "for case in positive_cases:\n", "self.assertEqual(add_nested_class(case), 'class=nested')\n", "for c...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Expr'", "For", "Expr'" ]
[ "from __future__ import unicode_literals\n", "import six\n", "from django.core.exceptions import ValidationError\n", "from django.http import HttpResponseRedirect, JsonResponse\n", "from django.shortcuts import redirect\n", "from django.utils.translation import ugettext_lazy as _\n", "from shuup.apps.pr...
[ "from __future__ import unicode_literals\n", "import six\n", "from django.core.exceptions import ValidationError\n", "from django.http import HttpResponseRedirect, JsonResponse\n", "from django.shortcuts import redirect\n", "from django.utils.translation import ugettext_lazy as _\n", "from shuup.apps.pr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "FunctionDef'", "A...
[ "import io\n", "import os\n", "import re\n", "from setuptools import find_packages, setup\n", "VAR_2 = re.search('__version__ = \\\\\"(.*?)\\\\\"', f.read()).group(1)\n", "def FUNC_0(VAR_0):...\n", "return os.path.join(os.path.dirname(__file__), VAR_0)\n" ]
[ "import io\n", "import os\n", "import re\n", "from setuptools import find_packages, setup\n", "version = re.search('__version__ = \\\\\"(.*?)\\\\\"', f.read()).group(1)\n", "def fpath(name):...\n", "return os.path.join(os.path.dirname(__file__), name)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "ImportFrom'", "Assign'", "FunctionDef'", "Return'" ]
[ "@FUNC_0...\n", "return sendmail\n" ]
[ "@cache_in_self...\n", "return sendmail\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_84(VAR_1):...\n", "def FUNC_83(*VAR_2, **VAR_3):...\n", "VAR_9 = VAR_2[0]\n", "VAR_65 = get_course_by_id(CourseKey.from_string(VAR_3['course_id']))\n", "if has_access(VAR_9.user, VAR_4, VAR_65):\n", "return VAR_1(*VAR_2, **kwargs)\n", "return HttpResponseForbidden()\n" ]
[ "def decorator(func):...\n", "def wrapped(*args, **kwargs):...\n", "request = args[0]\n", "course = get_course_by_id(CourseKey.from_string(kwargs['course_id']))\n", "if has_access(request.user, level, course):\n", "return func(*args, **kwargs)\n", "return HttpResponseForbidden()\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_4(VAR_8):...\n", "VAR_19 = VAR_8.args.get('signature')\n", "VAR_6 = float(VAR_8.args.get('expires') or 0)\n", "VAR_10 = VAR_8.view_args.get('query_id', None)\n", "VAR_20 = VAR_8.args.get('user_id', None)\n", "if VAR_19 and time.time() < VAR_6 <= time.time() + 3600:\n", "if VAR_20:\n", "retur...
[ "def hmac_load_user_from_request(request):...\n", "signature = request.args.get('signature')\n", "expires = float(request.args.get('expires') or 0)\n", "query_id = request.view_args.get('query_id', None)\n", "user_id = request.args.get('user_id', None)\n", "if signature and time.time() < expires <= time.t...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Return'" ]
[ "def FUNC_58(VAR_91, *VAR_119):...\n", "\"\"\"docstring\"\"\"\n", "VAR_91 = FUNC_56(VAR_91)\n", "return FUNC_61(VAR_1.module_app[VAR_91] + '.' + VAR_91, *VAR_119)\n" ]
[ "def get_module_path(module, *joins):...\n", "\"\"\"docstring\"\"\"\n", "module = scrub(module)\n", "return get_pymodule_path(local.module_app[module] + '.' + module, *joins)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_30(VAR_91):...\n", "" ]
[ "def get_domain_data(module):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "async def FUNC_15(self, VAR_4: str) ->Tuple[List[str], int]:...\n", "\"\"\"docstring\"\"\"\n", "return await self._remove_local_media_from_disk([VAR_4])\n" ]
[ "async def delete_local_media(self, media_id: str) ->Tuple[List[str], int]:...\n", "\"\"\"docstring\"\"\"\n", "return await self._remove_local_media_from_disk([media_id])\n" ]
[ 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_19(self, VAR_26: str, *, VAR_29: Optional[Type[Any]]=None, VAR_13:...\n", "return self.api_route(VAR_26=path, VAR_29=response_model, VAR_13=\n status_code, VAR_30=tags, VAR_31=dependencies, VAR_32=summary, VAR_33=\n description, VAR_34=response_description, VAR_35=responses, VAR_36=\n deprecate...
[ "def trace(self, path: str, *, response_model: Optional[Type[Any]]=None,...\n", "return self.api_route(path=path, response_model=response_model, status_code\n =status_code, tags=tags, dependencies=dependencies, summary=summary,\n description=description, response_description=response_description,\n respo...
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_27(self, VAR_27):...\n", "VAR_73 = self.playlistdb.deletePlaylist(VAR_27, self.getUserId(),\n override_owner=False)\n", "if VAR_73 == 'success':\n", "return VAR_73\n" ]
[ "def api_deleteplaylist(self, playlistid):...\n", "res = self.playlistdb.deletePlaylist(playlistid, self.getUserId(),\n override_owner=False)\n", "if res == 'success':\n", "return res\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_19(VAR_3, VAR_40=ValidationError, VAR_31=None, VAR_38=None, VAR_39...\n", "\"\"\"docstring\"\"\"\n", "FUNC_15(VAR_3, VAR_32=exc, VAR_31=title, VAR_35='red', VAR_38=\n is_minimizable, VAR_39=wide, VAR_34=as_list)\n" ]
[ "def throw(msg, exc=ValidationError, title=None, is_minimizable=None, wide=...\n", "\"\"\"docstring\"\"\"\n", "msgprint(msg, raise_exception=exc, title=title, indicator='red',\n is_minimizable=is_minimizable, wide=wide, as_list=as_list)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "def FUNC_14(self):...\n", "\"\"\"docstring\"\"\"\n", "async def FUNC_18(VAR_3, **VAR_4):...\n", "VAR_17 = RedirectException(b'/no/over/there', 304)\n", "VAR_17.cookies.append(b'session=yespls')\n", "VAR_5 = CLASS_2.TestResource()\n", "VAR_5.callback = VAR_10\n", "VAR_7, VAR_6 = make_request(self.reac...
[ "def test_redirect_exception_with_cookie(self):...\n", "\"\"\"docstring\"\"\"\n", "async def callback(request, **kwargs):...\n", "e = RedirectException(b'/no/over/there', 304)\n", "e.cookies.append(b'session=yespls')\n", "res = WrapHtmlRequestHandlerTests.TestResource()\n", "res.callback = callback\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "AsyncFunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@VAR_2.route('/<data>/<sort_param>', defaults={'page': 1, 'book_id': 1})...\n", "return FUNC_15(VAR_8, VAR_20, VAR_5, VAR_9)\n" ]
[ "@web.route('/<data>/<sort_param>', defaults={'page': 1, 'book_id': 1})...\n", "return render_books_list(data, sort_param, book_id, page)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_18(self, VAR_44):...\n", "VAR_79 = self._process_table(VAR_44)\n", "VAR_80 = re.sub('(?: *\\\\| *)?\\\\n$', '', VAR_44.group(3))\n", "VAR_80 = VAR_80.split('\\n')\n", "for VAR_101, VAR_100 in enumerate(VAR_80):\n", "VAR_100 = re.sub('^ *\\\\| *| *\\\\| *$', '', VAR_100)\n", "VAR_79['cells'] = ...
[ "def parse_table(self, m):...\n", "item = self._process_table(m)\n", "cells = re.sub('(?: *\\\\| *)?\\\\n$', '', m.group(3))\n", "cells = cells.split('\\n')\n", "for i, v in enumerate(cells):\n", "v = re.sub('^ *\\\\| *| *\\\\| *$', '', v)\n", "item['cells'] = cells\n", "cells[i] = re.split(' *\\\\| *...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_13(self, VAR_8):...\n", "VAR_14 = re.search('https?://[^/]*(/.*reset/\\\\S*)', VAR_8.body)\n", "self.assertTrue(VAR_14 is not None, 'No URL found in sent email')\n", "return VAR_14.group(), VAR_14.groups()[0]\n" ]
[ "def _read_signup_email(self, email):...\n", "urlmatch = re.search('https?://[^/]*(/.*reset/\\\\S*)', email.body)\n", "self.assertTrue(urlmatch is not None, 'No URL found in sent email')\n", "return urlmatch.group(), urlmatch.groups()[0]\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_0(self):...\n", "return self.post()\n" ]
[ "def get(self):...\n", "return self.post()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_11(self, VAR_4, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_33 = self.reactor.tcpClients\n", "self.assertGreaterEqual(len(VAR_33), 1)\n", "VAR_34, VAR_35, VAR_36, VAR_37, VAR_38 = VAR_33.pop()\n", "self.assertEqual(VAR_34, '1.2.3.4')\n", "self.assertEqual(VAR_35, VAR_10)\n", "VAR_39 = VA...
[ "def _handle_http_replication_attempt(self, hs, repl_port):...\n", "\"\"\"docstring\"\"\"\n", "clients = self.reactor.tcpClients\n", "self.assertGreaterEqual(len(clients), 1)\n", "host, port, client_factory, _timeout, _bindAddress = clients.pop()\n", "self.assertEqual(host, '1.2.3.4')\n", "self.assertEq...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "VAR_7 = deepcopy(VAR_7)\n", "if VAR_5.parameters is None:\n", "return VAR_7\n", "for param in VAR_5.parameters:\n", "if isinstance(param, oai.Reference) or param.param_schema is None:\n", "return VAR_7\n", "VAR_25 = property_from_data(VAR_11=param.name, VAR_26=param.required, VA...
[ "@staticmethod...\n", "endpoint = deepcopy(endpoint)\n", "if data.parameters is None:\n", "return endpoint\n", "for param in data.parameters:\n", "if isinstance(param, oai.Reference) or param.param_schema is None:\n", "return endpoint\n", "prop = property_from_data(name=param.name, required=param.requ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "For", "Condition", "Return'", "Assign'", "Condition", "Return'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Return'" ]
[ "def __str__(self):...\n", "return '%s / %s' % (self.ticket, self.field)\n" ]
[ "def __str__(self):...\n", "return '%s / %s' % (self.ticket, self.field)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@FUNC_0...\n", "if self.should_send_federation():\n", "return FederationSender(self)\n", "if not self.config.worker_app:\n", "return FederationRemoteSendQueue(self)\n" ]
[ "@cache_in_self...\n", "if self.should_send_federation():\n", "return FederationSender(self)\n", "if not self.config.worker_app:\n", "return FederationRemoteSendQueue(self)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Condition", "Return'" ]
[ "@transaction.non_atomic_requests...\n", "\"\"\"docstring\"\"\"\n", "VAR_38 = CourseKey.from_string(VAR_10)\n", "VAR_66 = VAR_9.GET.get('problem_location', '')\n", "VAR_170 = UsageKey.from_string(VAR_66)\n", "return JsonResponseBadRequest(_('Could not find problem with this location.'))\n", "instructor_...
[ "@transaction.non_atomic_requests...\n", "\"\"\"docstring\"\"\"\n", "course_key = CourseKey.from_string(course_id)\n", "problem_location = request.GET.get('problem_location', '')\n", "problem_key = UsageKey.from_string(problem_location)\n", "return JsonResponseBadRequest(_('Could not find problem with thi...
[ 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Return'", "Expr'", "Assign'", "Assign'", "Assign'", "Return'", "Condition", "Return'", "Assign'", "Condition" ]
[ "def FUNC_1(VAR_6, VAR_7, VAR_8=None):...\n", "if VAR_6:\n", "if VAR_8 and isinstance(VAR_6, dict):\n", "VAR_6 = VAR_6.get(VAR_8, [])\n", "if not isinstance(VAR_6, (list, tuple)):\n", "VAR_6 = [VAR_6]\n", "[VAR_114(VAR_7) for VAR_114 in VAR_6]\n" ]
[ "def callback(actions, form, tablename=None):...\n", "if actions:\n", "if tablename and isinstance(actions, dict):\n", "actions = actions.get(tablename, [])\n", "if not isinstance(actions, (list, tuple)):\n", "actions = [actions]\n", "[action(form) for action in actions]\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "@VAR_0.route('/camera_latest_timelapse/<camera_unique_id>/<max_age>')...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = Camera.query.filter(Camera.unique_id == VAR_4).first()\n", "VAR_37, VAR_38 = utils_general.get_camera_paths(VAR_8)\n", "VAR_39 = os.path.join(VAR_38, str(VAR_8.timelapse_last_file))\n", "if VA...
[ "@blueprint.route('/camera_latest_timelapse/<camera_unique_id>/<max_age>')...\n", "\"\"\"docstring\"\"\"\n", "camera = Camera.query.filter(Camera.unique_id == camera_unique_id).first()\n", "_, tl_path = utils_general.get_camera_paths(camera)\n", "timelapse_file_path = os.path.join(tl_path, str(camera.timela...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_11(self):...\n", "\"\"\"docstring\"\"\"\n", "self._create_alias(self.test_user)\n", "VAR_10 = self.get_success(self.handler.delete_association(create_requester(\n self.admin_user), self.room_alias))\n", "self.assertEquals(self.room_id, VAR_10)\n", "self.get_failure(self.handler.get_associatio...
[ "def test_delete_alias_admin(self):...\n", "\"\"\"docstring\"\"\"\n", "self._create_alias(self.test_user)\n", "result = self.get_success(self.handler.delete_association(create_requester(\n self.admin_user), self.room_alias))\n", "self.assertEquals(self.room_id, result)\n", "self.get_failure(self.handle...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = FUNC_1('/groups/%s/profile', VAR_30)\n", "return self.client.post_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'requester_user_id': requester_user_id}, VAR_39=content, VAR_15=True)\n" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "path = _create_v1_path('/groups/%s/profile', group_id)\n", "return self.client.post_json(destination=destination, path=path, args={\n 'requester_user_id': requester_user_id}, data=content, ignore_backoff=True)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'" ]
[ "async def FUNC_25(VAR_23):...\n", "self.assertEqual(VAR_23, {'server1': {FUNC_0(VAR_20): 1500}})\n", "return {'server1': {FUNC_0(VAR_20): FetchKeyResult(get_verify_key(VAR_20), \n 800)}}\n" ]
[ "async def get_keys1(keys_to_fetch):...\n", "self.assertEqual(keys_to_fetch, {'server1': {get_key_id(key1): 1500}})\n", "return {'server1': {get_key_id(key1): FetchKeyResult(get_verify_key(key1), \n 800)}}\n" ]
[ 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "Return'" ]