lines listlengths 1 383 | raw_lines listlengths 1 383 | label listlengths 1 383 | type listlengths 1 383 |
|---|---|---|---|
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return format_html(\"\"\"<ul{0}>\n{1}\n</ul>\"\"\", flatatt(self.attrs),\n format_html_join('\\n', '<li>{0}</li>', ((force_text(w),) for w in self)))\n"
] | [
"def render(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return format_html(\"\"\"<ul{0}>\n{1}\n</ul>\"\"\", flatatt(self.attrs),\n format_html_join('\\n', '<li>{0}</li>', ((force_text(w),) for w in self)))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_25(self):...\n",
"return self._has_role(constants.ROLE_UPLOAD)\n"
] | [
"def role_upload(self):...\n",
"return self._has_role(constants.ROLE_UPLOAD)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"self.assertFormfield(models.Event, 'start_date', widgets.AdminDateWidget)\n"
] | [
"def testDateField(self):...\n",
"self.assertFormfield(models.Event, 'start_date', widgets.AdminDateWidget)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"import logging\n",
"import urllib.parse\n",
"from io import BytesIO\n",
"from typing import TYPE_CHECKING, Any, BinaryIO, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union\n",
"import treq\n",
"from canonicaljson import encode_canonical_json\n",
"from netaddr import IPAddress, IPSet\n",
... | [
"import logging\n",
"import urllib.parse\n",
"from io import BytesIO\n",
"from typing import TYPE_CHECKING, Any, BinaryIO, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union\n",
"import treq\n",
"from canonicaljson import encode_canonical_json\n",
"from netaddr import IPAddress, IPSet\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Impo... |
[
"def FUNC_38(self):...\n",
"from zope.interface.verify import verifyClass\n",
"from zope.tal.interfaces import ITALExpressionEngine\n",
"verifyClass(ITALExpressionEngine, self._getTargetClass())\n"
] | [
"def test_class_conforms_to_ITALExpressionEngine(self):...\n",
"from zope.interface.verify import verifyClass\n",
"from zope.tal.interfaces import ITALExpressionEngine\n",
"verifyClass(ITALExpressionEngine, self._getTargetClass())\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"ImportFrom'",
"Expr'"
] |
[
"@login_required()...\n",
""
] | [
"@login_required()...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"\"\"\"\nForm Widget classes specific to the Django admin site.\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import copy\n",
"from django import forms\n",
"from django.contrib.admin.templatetags.admin_static import static\n",
"from django.core.urlresolvers import reverse\n",
"from django.fo... | [
"\"\"\"\nForm Widget classes specific to the Django admin site.\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import copy\n",
"from django import forms\n",
"from django.contrib.admin.templatetags.admin_static import static\n",
"from django.core.urlresolvers import reverse\n",
"from django.fo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Condition",
"Assign'",
"Return'"
] |
[
"async def FUNC_6(*VAR_9, **VAR_10):...\n",
"return None\n"
] | [
"async def _insert_client_ip(*args, **kwargs):...\n",
"return None\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Return'"
] |
[
"def FUNC_88(VAR_212):...\n",
"VAR_408 = VAR_5.getAnnotationLinks('Image', parent_ids=imageIds)\n",
"VAR_409 = {}\n",
"VAR_410 = {}\n",
"for VAR_432 in VAR_212:\n",
"VAR_409[VAR_432] = []\n",
"for VAR_344 in VAR_408:\n",
"VAR_383 = VAR_344.getChild()\n",
"VAR_411 = []\n",
"if VAR_383._obj.__class_... | [
"def loadImageTags(imageIds):...\n",
"tagLinks = conn.getAnnotationLinks('Image', parent_ids=imageIds)\n",
"linkMap = {}\n",
"tagMap = {}\n",
"for iId in imageIds:\n",
"linkMap[iId] = []\n",
"for link in tagLinks:\n",
"c = link.getChild()\n",
"imageTags = []\n",
"if c._obj.__class__ == omero.model... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Return'"
] |
[
"def FUNC_14(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_16:\n",
"if VAR_13.get('logging') or False:\n",
"VAR_21.append(FUNC_1(VAR_3))\n",
"print(repr(VAR_3))\n"
] | [
"def log(msg):...\n",
"\"\"\"docstring\"\"\"\n",
"if not request:\n",
"if conf.get('logging') or False:\n",
"debug_log.append(as_unicode(msg))\n",
"print(repr(msg))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"conditional.processConditionals(self)\n",
"self.fillContainers = locateFillContainers(self)\n",
"lint.exampleIDs(self)\n",
"boilerplate.addBikeshedVersion(self)\n",
"boilerplate.addCanonicalURL(self)\n",
"boilerplate.addFavicon(self)\n",
"boilerplate.addSpecVersion(self)\n",... | [
"def processDocument(self):...\n",
"conditional.processConditionals(self)\n",
"self.fillContainers = locateFillContainers(self)\n",
"lint.exampleIDs(self)\n",
"boilerplate.addBikeshedVersion(self)\n",
"boilerplate.addCanonicalURL(self)\n",
"boilerplate.addFavicon(self)\n",
"boilerplate.addSpecVersion(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"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_0(self):...\n",
"from openapi_python_client.parser.properties import StringProperty\n",
"VAR_4 = VAR_35(VAR_5='test', VAR_26=True, default=None)\n",
"assert VAR_4.get_type_string() == 'str'\n",
"VAR_4.required = False\n",
"assert VAR_4.get_type_string() == 'Optional[str]'\n"
] | [
"def test_get_type_string(self):...\n",
"from openapi_python_client.parser.properties import StringProperty\n",
"p = StringProperty(name='test', required=True, default=None)\n",
"assert p.get_type_string() == 'str'\n",
"p.required = False\n",
"assert p.get_type_string() == 'Optional[str]'\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Assert'",
"Assign'",
"Assert'"
] |
[
"def FUNC_26(self, VAR_15, **VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_15.status_code == 401:\n",
"VAR_1.warning('401 Error, Credentials not correct for %s', VAR_15.request.url)\n"
] | [
"def warn_on_401(self, resp, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"if resp.status_code == 401:\n",
"logger.warning('401 Error, Credentials not correct for %s', resp.request.url)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'"
] |
[
"@override_config({'send_federation': True})...\n",
"self.room_members = [VAR_0, VAR_1, VAR_2]\n",
"from synapse.handlers.typing import RoomMember\n",
"VAR_22 = RoomMember(VAR_3, VAR_0.to_string())\n",
"self.handler._member_typing_until[VAR_22] = 1002000\n",
"self.handler._room_typing[VAR_3] = {VAR_0.to_s... | [
"@override_config({'send_federation': True})...\n",
"self.room_members = [U_APPLE, U_BANANA, U_ONION]\n",
"from synapse.handlers.typing import RoomMember\n",
"member = RoomMember(ROOM_ID, U_APPLE.to_string())\n",
"self.handler._member_typing_until[member] = 1002000\n",
"self.handler._room_typing[ROOM_ID] ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_30(VAR_27):...\n",
"print(VAR_26 + VAR_27)\n"
] | [
"def in_print(s):...\n",
"print(indent_str + s)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_8, *VAR_6, **VAR_7):...\n",
"super().__init__(*VAR_6, **kwargs)\n",
"self.fields['lang'].choices += Language.objects.have_translation().as_choices()\n",
"self.fields['project'].choices += [(VAR_58.slug, VAR_58.name) for VAR_58 in\n VAR_8.user.allowed_projects]\n"
] | [
"def __init__(self, request, *args, **kwargs):...\n",
"super().__init__(*args, **kwargs)\n",
"self.fields['lang'].choices += Language.objects.have_translation().as_choices()\n",
"self.fields['project'].choices += [(project.slug, project.name) for project in\n request.user.allowed_projects]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"AugAssign'",
"AugAssign'"
] |
[
"import re\n",
"import stringcase\n",
"def FUNC_0(VAR_0: str) ->str:...\n",
"return re.sub('[^\\\\w _-]+', '', VAR_0)\n"
] | [
"import re\n",
"import stringcase\n",
"def _sanitize(value: str) ->str:...\n",
"return re.sub('[^\\\\w _-]+', '', value)\n"
] | [
0,
0,
0,
5
] | [
"Import'",
"Import'",
"FunctionDef'",
"Return'"
] |
[
"@pytest.mark.posix...\n",
"assert filescheme.parent_dir(VAR_9) == VAR_11\n"
] | [
"@pytest.mark.posix...\n",
"assert filescheme.parent_dir(directory) == parent\n"
] | [
0,
0
] | [
"Condition",
"Assert'"
] |
[
"def FUNC_1(VAR_2):...\n",
"@wraps(VAR_2)...\n",
"if current_user.role_edit() or current_user.role_admin():\n",
"return VAR_2(*VAR_48, **kwargs)\n",
"abort(403)\n",
"return FUNC_46\n"
] | [
"def edit_required(f):...\n",
"@wraps(f)...\n",
"if current_user.role_edit() or current_user.role_admin():\n",
"return f(*args, **kwargs)\n",
"abort(403)\n",
"return inner\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"VAR_5 = self._makeContext()\n",
"self.assertEqual(VAR_5.evaluate('path:'), None)\n"
] | [
"def test_empty_path_expression_explicit(self):...\n",
"ec = self._makeContext()\n",
"self.assertEqual(ec.evaluate('path:'), None)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_156():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_355 = {'prefix': VAR_113, 'user': VAR_116 if self.user_id else None}\n",
"for i in VAR_250:\n",
"if i['name'] == VAR_28('Log In'):\n",
"self.bar = VAR_355\n",
"VAR_346 = 'login'\n",
"if i['name'] == VAR_28('Sign Up'):\n",
"VAR_355[VAR_346] = i[... | [
"def bare():...\n",
"\"\"\"docstring\"\"\"\n",
"bare = {'prefix': prefix, 'user': user_identifier if self.user_id else None}\n",
"for i in items:\n",
"if i['name'] == T('Log In'):\n",
"self.bar = bare\n",
"k = 'login'\n",
"if i['name'] == T('Sign Up'):\n",
"bare[k] = i['href']\n",
"k = 'register'\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'"
] |
[
"@log_function...\n",
"VAR_142 = {'signed': VAR_44}\n",
"VAR_45 = {'type': VAR_188.Member, 'content': {'membership': Membership.\n INVITE, 'third_party_invite': VAR_142}, 'room_id': VAR_11, 'sender':\n VAR_42, 'state_key': VAR_43}\n",
"if await self.auth.check_host_in_room(VAR_11, self.hs.hostname):\n",... | [
"@log_function...\n",
"third_party_invite = {'signed': signed}\n",
"event_dict = {'type': EventTypes.Member, 'content': {'membership':\n Membership.INVITE, 'third_party_invite': third_party_invite}, 'room_id':\n room_id, 'sender': sender_user_id, 'state_key': target_user_id}\n",
"if await self.auth.chec... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/user/keys/query')\n",
"VAR_19 = await self.client.post_json(VAR_5=destination, VAR_2=path, VAR_39=\n query_content, VAR_8=timeout)\n",
"return VAR_19\n"
] | [
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/user/keys/query')\n",
"content = await self.client.post_json(destination=destination, path=path,\n data=query_content, timeout=timeout)\n",
"return content\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_4):...\n",
"self.get_success(self.store.create_room_alias_association(self.room_alias,\n self.room_id, ['test'], VAR_4))\n"
] | [
"def _create_alias(self, user):...\n",
"self.get_success(self.store.create_room_alias_association(self.room_alias,\n self.room_id, ['test'], user))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@ensure_csrf_cookie...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n",
"VAR_65 = get_course_by_id(VAR_10)\n",
"VAR_136 = has_access(VAR_9.user, 'instructor', VAR_65)\n",
"VAR_137 = has_forum_access(VAR_9.user, VAR_10, FORUM_ROLE_ADMINISTRATOR)\n",
"VA... | [
"@ensure_csrf_cookie...\n",
"\"\"\"docstring\"\"\"\n",
"course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n",
"course = get_course_by_id(course_id)\n",
"has_instructor_access = has_access(request.user, 'instructor', course)\n",
"has_forum_admin = has_forum_access(request.user, course_i... | [
0,
0,
0,
0,
0,
0,
3,
3,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Return'"
] |
[
"@def_function.function...\n",
"return VAR_49 + 2 * VAR_55\n"
] | [
"@def_function.function...\n",
"return y + 2 * c\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_70(VAR_12, VAR_29):...\n",
"VAR_95 = FUNC_69(VAR_12, VAR_29)\n",
"return FUNC_68(VAR_12, VAR_95)\n"
] | [
"def extract_user_identifier(user, filtr):...\n",
"dynamic_field = extract_dynamic_field_from_filter(user, filtr)\n",
"return extract_user_data_from_field(user, dynamic_field)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_2: str, VAR_3: pathlib.Path) ->pathlib.Path:...\n",
"VAR_12 = (VAR_3 / VAR_2).absolute()\n",
"if not str(VAR_12).startswith(str(VAR_3) + '/'):\n",
"return VAR_12\n"
] | [
"def sanitized_join(path: str, root: pathlib.Path) ->pathlib.Path:...\n",
"result = (root / path).absolute()\n",
"if not str(result).startswith(str(root) + '/'):\n",
"return result\n"
] | [
0,
1,
1,
1
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_0(VAR_5):...\n",
"if VAR_3(VAR_5):\n",
"return None\n",
"return VAR_4(VAR_5)\n"
] | [
"def _is_javascript_scheme(s):...\n",
"if _is_image_dataurl(s):\n",
"return None\n",
"return _is_possibly_malicious_scheme(s)\n"
] | [
0,
2,
2,
2
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_18(self, VAR_17, VAR_18):...\n",
"if not VAR_53.session['admin']:\n",
"VAR_66 = albumArtFilePath(VAR_17)\n",
"VAR_64 = albumartfetcher.AlbumArtFetcher()\n",
"VAR_20, VAR_67 = VAR_64.retrieveData(VAR_18)\n",
"self.albumartcache_save(VAR_66, VAR_20)\n"
] | [
"def api_albumart_set(self, directory, imageurl):...\n",
"if not cherrypy.session['admin']:\n",
"b64imgpath = albumArtFilePath(directory)\n",
"fetcher = albumartfetcher.AlbumArtFetcher()\n",
"data, header = fetcher.retrieveData(imageurl)\n",
"self.albumartcache_save(b64imgpath, data)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(VAR_6: EscapableEntity) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(VAR_6, HTML):\n",
"VAR_6 = VAR_6.__html__()\n",
"if not isinstance(VAR_6, str):\n",
"return u'%s' % VAR_6\n",
"VAR_6 = ensure_str(VAR_6)\n",
"while True:\n",
"VAR_9 = VAR_6.find('<')\n",
"if VAR_9 == -1:\n"... | [
"def strip_tags(ht: EscapableEntity) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(ht, HTML):\n",
"ht = ht.__html__()\n",
"if not isinstance(ht, str):\n",
"return u'%s' % ht\n",
"ht = ensure_str(ht)\n",
"while True:\n",
"x = ht.find('<')\n",
"if x == -1:\n",
"y = ht.find('>', x)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def FUNC_3(self, VAR_5, *VAR_6, **VAR_4):...\n",
"VAR_16 = VAR_5.POST.get('command')\n",
"if VAR_16:\n",
"VAR_24 = getattr(self, 'dispatch_%s' % VAR_16, None)\n",
"if VAR_5.POST.get('save') and self.form and self.form.is_valid():\n",
"if not callable(VAR_24):\n",
"self.form.save()\n",
"return self.ge... | [
"def post(self, request, *args, **kwargs):...\n",
"command = request.POST.get('command')\n",
"if command:\n",
"dispatcher = getattr(self, 'dispatch_%s' % command, None)\n",
"if request.POST.get('save') and self.form and self.form.is_valid():\n",
"if not callable(dispatcher):\n",
"self.form.save()\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"For",
"Condition",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Return'",
"Expr'",
"Return'"
] |
[
"@action('copyrole', lazy_gettext('Copy Role'), lazy_gettext(...\n",
"self.update_redirect()\n",
"for VAR_21 in VAR_33:\n",
"VAR_49 = VAR_21.__class__()\n",
"return redirect(self.get_redirect())\n",
"VAR_49.name = VAR_21.name\n",
"VAR_49.permissions = VAR_21.permissions\n",
"VAR_49.name = VAR_49.name ... | [
"@action('copyrole', lazy_gettext('Copy Role'), lazy_gettext(...\n",
"self.update_redirect()\n",
"for item in items:\n",
"new_role = item.__class__()\n",
"return redirect(self.get_redirect())\n",
"new_role.name = item.name\n",
"new_role.permissions = item.permissions\n",
"new_role.name = new_role.name... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"For",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self, **VAR_4):...\n",
"return VAR_0\n"
] | [
"def generate_config_section(self, **kwargs):...\n",
"return DEFAULT_CONFIG\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"async def FUNC_76(*VAR_20, **VAR_21):...\n",
"return None\n"
] | [
"async def _insert_client_ip(*args, **kwargs):...\n",
"return None\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Return'"
] |
[
"def FUNC_0(self) ->Dict[str, Any]:...\n",
"VAR_1 = self.an_enum_value.value\n",
"if isinstance(self.a_camel_date_time, datetime):\n",
"VAR_5 = self.a_camel_date_time.isoformat()\n",
"VAR_5 = self.a_camel_date_time.isoformat()\n",
"VAR_2 = self.a_date.isoformat()\n",
"if self.nested_list_of_enums is Non... | [
"def to_dict(self) ->Dict[str, Any]:...\n",
"an_enum_value = self.an_enum_value.value\n",
"if isinstance(self.a_camel_date_time, datetime):\n",
"a_camel_date_time = self.a_camel_date_time.isoformat()\n",
"a_camel_date_time = self.a_camel_date_time.isoformat()\n",
"a_date = self.a_date.isoformat()\n",
"i... | [
0,
0,
5,
0,
0,
0,
0,
0,
0,
5,
0,
5,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Return'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_62(VAR_95):...\n",
"VAR_32 = re.compile('^plugin_' + VAR_96 + '(/.*|\\\\..*)?$')\n",
"return [VAR_70 for VAR_70 in VAR_95 if VAR_70 and VAR_32.match(VAR_70)]\n"
] | [
"def filter_plugins(items):...\n",
"regex = re.compile('^plugin_' + plugin + '(/.*|\\\\..*)?$')\n",
"return [item for item in items if item and regex.match(item)]\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_9():...\n",
"yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n",
"if VAR_1:\n",
"yield '<?xml-stylesheet type=\"text/xsl\" href=\"/scopelist.xsl\" ?>\\n'\n",
"yield '<objectlist>\\n'\n",
"for line in f:\n",
"VAR_10 = line.strip()\n",
"yield '</objectlist>\\n'\n",
"VAR_13 = str(FUNC_... | [
"def generate():...\n",
"yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n",
"if STYLE:\n",
"yield '<?xml-stylesheet type=\"text/xsl\" href=\"/scopelist.xsl\" ?>\\n'\n",
"yield '<objectlist>\\n'\n",
"for line in f:\n",
"video = line.strip()\n",
"yield '</objectlist>\\n'\n",
"video_path = str(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_157 = []\n",
"VAR_158 = VAR_8.getRoiService()\n",
"VAR_62 = VAR_158.findByImage(VAR_178(VAR_36), None, VAR_8.SERVICE_OPTS)\n",
"for VAR_53 in VAR_62.rois:\n",
"VAR_241 = {}\n",
"VAR_157.sort(VAR_79=lambda x: x['id'])\n",
"VAR_241['id'] = VAR_... | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"rois = []\n",
"roiService = conn.getRoiService()\n",
"result = roiService.findByImage(long(imageId), None, conn.SERVICE_OPTS)\n",
"for r in result.rois:\n",
"roi = {}\n",
"rois.sort(key=lambda x: x['id'])\n",
"roi['id'] = r.getId().getValue()\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, **VAR_22):...\n",
"\"\"\"docstring\"\"\"\n",
"if 'quote_char' in VAR_22:\n",
"self.use_best_quote_char = False\n",
"for attr in self.options:\n",
"setattr(self, attr, VAR_22.get(attr, getattr(self, attr)))\n",
"self.errors = []\n",
"self.strict = False\n"
] | [
"def __init__(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"if 'quote_char' in kwargs:\n",
"self.use_best_quote_char = False\n",
"for attr in self.options:\n",
"setattr(self, attr, kwargs.get(attr, getattr(self, attr)))\n",
"self.errors = []\n",
"self.strict = False\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"For",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_14(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_16:\n",
"if VAR_13.get('logging') or False:\n",
"VAR_21.append(FUNC_1(VAR_3))\n",
"print(repr(VAR_3))\n"
] | [
"def log(msg):...\n",
"\"\"\"docstring\"\"\"\n",
"if not request:\n",
"if conf.get('logging') or False:\n",
"debug_log.append(as_unicode(msg))\n",
"print(repr(msg))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_20(self):...\n",
"VAR_5, VAR_15 = self._test_confirm_start()\n",
"VAR_3 = self.client.post(VAR_15, {'new_password1': 'anewpassword',\n 'new_password2': 'x'})\n",
"self.assertFormError(VAR_3, SetPasswordForm.error_messages['password_mismatch']\n )\n"
] | [
"def test_confirm_different_passwords(self):...\n",
"url, path = self._test_confirm_start()\n",
"response = self.client.post(path, {'new_password1': 'anewpassword',\n 'new_password2': 'x'})\n",
"self.assertFormError(response, SetPasswordForm.error_messages[\n 'password_mismatch'])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"self.register_user('id_admin', 'pass', admin=True)\n",
"VAR_8 = self.login('id_admin', 'pass')\n",
"self.register_user('id_nonadmin', 'pass', admin=False)\n",
"VAR_22 = self.login('id_nonadmin', 'pass')\n",
"VAR_23 = self.helper.upload_media(self.upload_resource, self.image_data... | [
"def test_quarantine_media_by_id(self):...\n",
"self.register_user('id_admin', 'pass', admin=True)\n",
"admin_user_tok = self.login('id_admin', 'pass')\n",
"self.register_user('id_nonadmin', 'pass', admin=False)\n",
"non_admin_user_tok = self.login('id_nonadmin', 'pass')\n",
"response = self.helper.upload... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_2, VAR_3, VAR_4):...\n",
"self.store = VAR_4.get_datastore()\n",
"self.admin_user = self.register_user('admin', 'pass', admin=True)\n",
"self.admin_user_tok = self.login('admin', 'pass')\n",
"self.other_user = self.register_user('user', 'pass')\n",
"self.other_user_token = self.login... | [
"def prepare(self, reactor, clock, hs):...\n",
"self.store = hs.get_datastore()\n",
"self.admin_user = self.register_user('admin', 'pass', admin=True)\n",
"self.admin_user_tok = self.login('admin', 'pass')\n",
"self.other_user = self.register_user('user', 'pass')\n",
"self.other_user_token = self.login('u... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@VAR_2.route('/shutdown')...\n",
"VAR_32 = VAR_119(request.args.get('parameter').strip())\n",
"VAR_33 = {}\n",
"if VAR_32 in (0, 1):\n",
"calibre_db.dispose()\n",
"if VAR_32 == 2:\n",
"ub.dispose()\n",
"VAR_0.warning('reconnecting to calibre database')\n",
"VAR_33['text'] = _(u'Unknown command')\n"... | [
"@admi.route('/shutdown')...\n",
"task = int(request.args.get('parameter').strip())\n",
"showtext = {}\n",
"if task in (0, 1):\n",
"calibre_db.dispose()\n",
"if task == 2:\n",
"ub.dispose()\n",
"log.warning('reconnecting to calibre database')\n",
"showtext['text'] = _(u'Unknown command')\n",
"if t... | [
0,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_20(self):...\n",
"VAR_27 = np.array([[1], [2]])\n",
"VAR_32 = os.path.join(test.get_temp_dir(), 'input.npz')\n",
"np.savez(VAR_32, VAR_54=x0)\n",
"VAR_28 = np.ones([2, 10])\n",
"VAR_21 = 'x0=' + VAR_32 + '[a]'\n",
"VAR_22 = 'x0=np.ones([2,10])'\n",
"VAR_31 = saved_model_cli.load_inputs_from_... | [
"def testInputParserBothDuplicate(self):...\n",
"x0 = np.array([[1], [2]])\n",
"input_path = os.path.join(test.get_temp_dir(), 'input.npz')\n",
"np.savez(input_path, a=x0)\n",
"x1 = np.ones([2, 10])\n",
"input_str = 'x0=' + input_path + '[a]'\n",
"input_expr_str = 'x0=np.ones([2,10])'\n",
"feed_dict =... | [
0,
5,
5,
5,
5,
5,
5,
5,
5
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"FUNC_18()\n"
] | [
"@staticmethod...\n",
"_callback()\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = CLASS_4()\n",
"for VAR_11, VAR_5 in VAR_12.items():\n",
"if isinstance(VAR_5, oai.Reference):\n",
"return VAR_18\n",
"VAR_18.errors.append(ParseError(VAR_5=data, detail=\n 'Reference schemas are not supported.'))\n",
"if VAR_5.enum is not N... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"result = Schemas()\n",
"for name, data in schemas.items():\n",
"if isinstance(data, oai.Reference):\n",
"return result\n",
"result.errors.append(ParseError(data=data, detail=\n 'Reference schemas are not supported.'))\n",
"if data.enum is not None:\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_12(self):...\n",
"p('Exported terms:')\n",
"for VAR_19 in findAll('[data-export]', self):\n",
"for term in config.linkTextsFromElement(VAR_19):\n",
"p('Unexported terms:')\n",
"p(' ' + term)\n",
"for VAR_19 in findAll('[data-noexport]', self):\n",
"for term in config.linkTextsFromElement(VA... | [
"def printTargets(self):...\n",
"p('Exported terms:')\n",
"for el in findAll('[data-export]', self):\n",
"for term in config.linkTextsFromElement(el):\n",
"p('Unexported terms:')\n",
"p(' ' + term)\n",
"for el in findAll('[data-noexport]', self):\n",
"for term in config.linkTextsFromElement(el):\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"For",
"Expr'",
"Expr'",
"For",
"For",
"Expr'"
] |
[
"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_98(self, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"self.json_procedures[VAR_10.__name__] = VAR_10\n",
"return VAR_10\n"
] | [
"def json(self, f):...\n",
"\"\"\"docstring\"\"\"\n",
"self.json_procedures[f.__name__] = f\n",
"return f\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_1, VAR_2=None):...\n",
""
] | [
"def get(self, arg, word=None):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_13(VAR_13, VAR_14, VAR_15, VAR_16=None):...\n",
""
] | [
"def create_and_login_user(org, name, email, picture=None):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_3(self, *, VAR_4: str) ->Set[str]:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = super().get_imports(VAR_4=prefix)\n",
"VAR_8.add('from typing import Dict')\n",
"if self.default is not None:\n",
"VAR_8.add('from dataclasses import field')\n",
"return VAR_8\n",
"VAR_8.add('from typing import cas... | [
"def get_imports(self, *, prefix: str) ->Set[str]:...\n",
"\"\"\"docstring\"\"\"\n",
"imports = super().get_imports(prefix=prefix)\n",
"imports.add('from typing import Dict')\n",
"if self.default is not None:\n",
"imports.add('from dataclasses import field')\n",
"return imports\n",
"imports.add('from ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Return'",
"Expr'"
] |
[
"def FUNC_118(*VAR_11, **VAR_351):...\n",
""
] | [
"def f(*args, **kwargs):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_12(VAR_23, VAR_24, VAR_27, VAR_28=None, VAR_29=1):...\n",
"if 'mandatory' in VAR_27:\n",
"for mandatory in VAR_27['mandatory']:\n",
"if VAR_28 is None:\n",
"if mandatory not in VAR_28:\n",
"VAR_28 = {}\n",
"VAR_10 = dict(VAR_28)\n",
"return None\n",
"if 'suffix' not in VAR_10 and VAR_29 > ... | [
"def _process_template_config(name, implementation, rule, config=None, counter=1...\n",
"if 'mandatory' in rule:\n",
"for mandatory in rule['mandatory']:\n",
"if config is None:\n",
"if mandatory not in config:\n",
"config = {}\n",
"data = dict(config)\n",
"return None\n",
"if 'suffix' not in data a... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Conditio... |
[
"def FUNC_27(self):...\n",
"for test_str in ('Iñtërnâtiônàlizætiøn', \"1234'\", -1234):\n",
"VAR_21 = self.client.post('%s/admin_widgets/event/add/' % self.admin_root,\n {'main_band': test_str})\n",
"self.assertContains(VAR_21,\n 'Select a valid choice. That choice is not one of the available choices.')... | [
"def test_invalid_target_id(self):...\n",
"for test_str in ('Iñtërnâtiônàlizætiøn', \"1234'\", -1234):\n",
"response = self.client.post('%s/admin_widgets/event/add/' % self.admin_root,\n {'main_band': test_str})\n",
"self.assertContains(response,\n 'Select a valid choice. That choice is not one of the a... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"return '-'.join(p.replace('-', '_-') for p in self.namespace.split('/'))\n"
] | [
"def get_build_slug(self):...\n",
"return '-'.join(p.replace('-', '_-') for p in self.namespace.split('/'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from ...core.utils.views import is_post, post_data\n",
"from ..models import Comment\n",
"from .forms import FlagForm\n",
"@login_required...\n",
"VAR_2 = get_object_or_4... | [
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from ...core.utils.views import is_post, post_data\n",
"from ..models import Comment\n",
"from .forms import FlagForm\n",
"@login_required...\n",
"comment = get_object_or... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_30(VAR_16):...\n",
"VAR_35 = PerspectivesKeyFetcher(self.hs)\n",
"VAR_23 = {VAR_34: {'key1': 0}}\n",
"self.expect_outgoing_key_query(VAR_34, 'key1', VAR_16)\n",
"return self.get_success(VAR_35.get_keys(VAR_23))\n"
] | [
"def get_key_from_perspectives(response):...\n",
"fetcher = PerspectivesKeyFetcher(self.hs)\n",
"keys_to_fetch = {SERVER_NAME: {'key1': 0}}\n",
"self.expect_outgoing_key_query(SERVER_NAME, 'key1', response)\n",
"return self.get_success(fetcher.get_keys(keys_to_fetch))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_14(self, VAR_6):...\n",
"if not self.query:\n",
"frappe.throw(_('Must specify a Query to run'), title=_('Report Document Error')\n )\n",
"if not self.query.lower().startswith('select'):\n",
"frappe.throw(_('Query must be a SELECT'), title=_('Report Document Error'))\n",
"VAR_15 = [list(t) for... | [
"def execute_query_report(self, filters):...\n",
"if not self.query:\n",
"frappe.throw(_('Must specify a Query to run'), title=_('Report Document Error')\n )\n",
"if not self.query.lower().startswith('select'):\n",
"frappe.throw(_('Query must be a SELECT'), title=_('Report Document Error'))\n",
"result... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(VAR_3, **VAR_4):...\n",
"VAR_2.update(VAR_4)\n",
"return 200, VAR_4\n"
] | [
"def _callback(request, **kwargs):...\n",
"got_kwargs.update(kwargs)\n",
"return 200, kwargs\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"return logging.INFO\n"
] | [
"def _log_level_default(self):...\n",
"return logging.INFO\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_53(self):...\n",
"frappe.clear_document_cache(self.doctype, self.name)\n"
] | [
"def clear_cache(self):...\n",
"frappe.clear_document_cache(self.doctype, self.name)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_43(self, VAR_21, VAR_22, VAR_20):...\n",
"if 'view' in VAR_92:\n",
"if not VAR_92['view'].get(VAR_21):\n",
"return None\n",
"VAR_92['view'][VAR_21] = dict()\n",
"VAR_92['view'][VAR_21][VAR_22] = VAR_20\n"
] | [
"def set_view_property(self, page, prop, value):...\n",
"if 'view' in flask_session:\n",
"if not flask_session['view'].get(page):\n",
"return None\n",
"flask_session['view'][page] = dict()\n",
"flask_session['view'][page][prop] = value\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_3(self):...\n",
"self.transitiveDependencies.clear()\n",
"self.assembleDocument()\n",
"self.processDocument()\n"
] | [
"def preprocess(self):...\n",
"self.transitiveDependencies.clear()\n",
"self.assembleDocument()\n",
"self.processDocument()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_20(self, VAR_6, VAR_7, VAR_8):...\n",
"VAR_12 = json.loads(self.json)\n",
"VAR_13 = self.get_standard_report_columns(VAR_12)\n",
"VAR_15 = []\n",
"VAR_26, VAR_27, VAR_14 = self.get_standard_report_order_by(VAR_12)\n",
"VAR_28 = frappe.get_list(self.ref_doctype, fields=[(get_group_by_field(\n ... | [
"def run_standard_report(self, filters, limit, user):...\n",
"params = json.loads(self.json)\n",
"columns = self.get_standard_report_columns(params)\n",
"result = []\n",
"order_by, group_by, group_by_args = self.get_standard_report_order_by(params)\n",
"_result = frappe.get_list(self.ref_doctype, fields=[... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/groups/%s/users/%s/accept_invite', VAR_30, VAR_16)\n",
"return self.client.post_json(VAR_5=destination, VAR_2=path, VAR_39=content,\n VAR_15=True)\n"
] | [
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/groups/%s/users/%s/accept_invite', group_id, user_id)\n",
"return self.client.post_json(destination=destination, path=path, data=\n content, ignore_backoff=True)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_31(self):...\n",
"VAR_5 = self._makeContext()\n",
"VAR_5.evaluate('context/__class__')\n",
"VAR_5.evaluate('nocall: random/_itertools/repeat')\n",
"VAR_5.evaluate('random/_itertools/repeat/foobar')\n"
] | [
"def test_underscore_traversal(self):...\n",
"ec = self._makeContext()\n",
"ec.evaluate('context/__class__')\n",
"ec.evaluate('nocall: random/_itertools/repeat')\n",
"ec.evaluate('random/_itertools/repeat/foobar')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_104():...\n",
"from frappe.core.doctype.domain_settings.domain_settings import get_active_domains\n",
"return FUNC_104()\n"
] | [
"def get_active_domains():...\n",
"from frappe.core.doctype.domain_settings.domain_settings import get_active_domains\n",
"return get_active_domains()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Return'"
] |
[
"def FUNC_33(self):...\n",
"self.parser = saved_model_cli.create_parser()\n",
"VAR_9 = test.test_src_dir_path(VAR_0)\n",
"VAR_44 = np.array([[1], [2]])\n",
"VAR_45 = np.zeros((6, 3))\n",
"VAR_31 = os.path.join(test.get_temp_dir(), 'testRunCommandNewOutdir_inputs.npz'\n )\n",
"VAR_41 = os.path.join(te... | [
"def testRunCommandWithDebuggerEnabled(self):...\n",
"self.parser = saved_model_cli.create_parser()\n",
"base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n",
"x = np.array([[1], [2]])\n",
"x_notused = np.zeros((6, 3))\n",
"input_path = os.path.join(test.get_temp_dir(),\n 'testRunCommandNewOutdir_in... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_105(VAR_62, VAR_9, VAR_166=None, VAR_167=False, VAR_168=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_202 = FUNC_48(VAR_62)\n",
"if VAR_202.track_changes:\n",
"VAR_216 = VAR_12.get_all('Version', VAR_106={'ref_doctype': doctype,\n 'docname': name, 'order_by': 'creation' if head else None, 'limi... | [
"def get_version(doctype, name, limit=None, head=False, raise_err=True):...\n",
"\"\"\"docstring\"\"\"\n",
"meta = get_meta(doctype)\n",
"if meta.track_changes:\n",
"names = db.get_all('Version', filters={'ref_doctype': doctype, 'docname':\n name, 'order_by': 'creation' if head else None, 'limit': limit}... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"ImportFrom'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@ensure_csrf_cookie...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n",
"VAR_131 = 'bulk_course_email'\n",
"VAR_133 = instructor_task.api.get_instructor_task_history(VAR_10, VAR_131=\n task_type)\n",
"VAR_63 = {'emails': map(extract_email_features, VA... | [
"@ensure_csrf_cookie...\n",
"\"\"\"docstring\"\"\"\n",
"course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n",
"task_type = 'bulk_course_email'\n",
"emails = instructor_task.api.get_instructor_task_history(course_id,\n task_type=task_type)\n",
"response_payload = {'emails': map(extra... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"return self.kw_project\n"
] | [
"def get_kwargs(self):...\n",
"return self.kw_project\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@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_0(self, VAR_1, VAR_2):...\n",
"VAR_3 = self.setup_test_homeserver(resource_for_federation=Mock(),\n http_client=None)\n",
"return VAR_3\n"
] | [
"def make_homeserver(self, reactor, clock):...\n",
"hs = self.setup_test_homeserver(resource_for_federation=Mock(), http_client\n =None)\n",
"return hs\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@FUNC_0...\n",
"if self.config.worker_app:\n",
"return GroupsLocalWorkerHandler(self)\n",
"return GroupsLocalHandler(self)\n"
] | [
"@cache_in_self...\n",
"if self.config.worker_app:\n",
"return GroupsLocalWorkerHandler(self)\n",
"return GroupsLocalHandler(self)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, *VAR_17, **VAR_18):...\n",
"super().__init__(*VAR_17, **kwargs)\n",
"self.url, VAR_10 = self.spec.split('/', 1)\n",
"self.repo = urllib.parse.unquote(self.url)\n",
"self.unresolved_ref = urllib.parse.unquote(VAR_10)\n",
"if not self.unresolved_ref:\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super().__init__(*args, **kwargs)\n",
"self.url, unresolved_ref = self.spec.split('/', 1)\n",
"self.repo = urllib.parse.unquote(self.url)\n",
"self.unresolved_ref = urllib.parse.unquote(unresolved_ref)\n",
"if not self.unresolved_ref:\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition"
] |
[
"def FUNC_52(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_69 = self.get_doc_before_save()\n",
"if self._action == 'save':\n",
"self.run_method('on_update')\n",
"if self._action == 'submit':\n",
"self.clear_cache()\n",
"self.run_method('on_update')\n",
"if self._action == 'cancel':\n",
"self.notif... | [
"def run_post_save_methods(self):...\n",
"\"\"\"docstring\"\"\"\n",
"doc_before_save = self.get_doc_before_save()\n",
"if self._action == 'save':\n",
"self.run_method('on_update')\n",
"if self._action == 'submit':\n",
"self.clear_cache()\n",
"self.run_method('on_update')\n",
"if self._action == 'can... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Assign'"
] |
[
"@FUNC_0...\n",
"return DeactivateAccountHandler(self)\n"
] | [
"@cache_in_self...\n",
"return DeactivateAccountHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_12(VAR_14: Union[Text, Path], VAR_4: Any) ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"import jsonpickle.ext.numpy as jsonpickle_numpy\n",
"import jsonpickle\n",
"jsonpickle_numpy.register_handlers()\n",
"rasa.shared.utils.io.write_text_file(jsonpickle.dumps(VAR_4), VAR_14)\n"
] | [
"def json_pickle(file_name: Union[Text, Path], obj: Any) ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"import jsonpickle.ext.numpy as jsonpickle_numpy\n",
"import jsonpickle\n",
"jsonpickle_numpy.register_handlers()\n",
"rasa.shared.utils.io.write_text_file(jsonpickle.dumps(obj), file_name)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Import'",
"Import'",
"Expr'",
"Expr'"
] |
[
"def FUNC_76(self):...\n",
"VAR_90 = self.token['align']\n",
"VAR_91 = len(VAR_90)\n",
"VAR_92 = self.renderer.placeholder()\n",
"VAR_69 = self.renderer.placeholder()\n",
"for VAR_101, value in enumerate(self.token['header']):\n",
"VAR_81 = VAR_90[VAR_101] if VAR_101 < VAR_91 else None\n",
"VAR_69 += ... | [
"def output_table(self):...\n",
"aligns = self.token['align']\n",
"aligns_length = len(aligns)\n",
"cell = self.renderer.placeholder()\n",
"header = self.renderer.placeholder()\n",
"for i, value in enumerate(self.token['header']):\n",
"align = aligns[i] if i < aligns_length else None\n",
"header += se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"AugAssign'",
"Assign'",
"Assign'",
"AugAssign'",
"For",
"Assign'",
"Return'",
"For",
"Assign'",
"AugAssign'",
"Assign'",
"AugAssign'"
] |
[
"def FUNC_2(self, VAR_1):...\n",
"from openapi_python_client.parser.properties import FileProperty\n",
"VAR_5 = VAR_1.MagicMock()\n",
"VAR_1.patch('openapi_python_client.utils.snake_case')\n",
"VAR_9 = 'blah'\n",
"VAR_4 = VAR_38(VAR_5=name, VAR_26=True, default=None)\n",
"assert VAR_4.get_imports(VAR_9=... | [
"def test_get_imports(self, mocker):...\n",
"from openapi_python_client.parser.properties import FileProperty\n",
"name = mocker.MagicMock()\n",
"mocker.patch('openapi_python_client.utils.snake_case')\n",
"prefix = 'blah'\n",
"p = FileProperty(name=name, required=True, default=None)\n",
"assert p.get_im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assert'",
"Assign'",
"Assert'"
] |
[
"@require_POST...\n",
"VAR_3 = get_object_or_404(Topic.objects.for_access(VAR_0.user), VAR_2=topic_id)\n",
"VAR_4 = NotificationCreationForm(user=request.user, VAR_3=topic, data=\n request.POST)\n",
"if VAR_4.is_valid():\n",
"VAR_4.save()\n",
"messages.error(VAR_0, utils.render_form_errors(VAR_4))\n",
... | [
"@require_POST...\n",
"topic = get_object_or_404(Topic.objects.for_access(request.user), pk=topic_id)\n",
"form = NotificationCreationForm(user=request.user, topic=topic, data=\n request.POST)\n",
"if form.is_valid():\n",
"form.save()\n",
"messages.error(request, utils.render_form_errors(form))\n",
"... | [
0,
0,
0,
0,
0,
0,
4
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"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'"
] |
[
"def FUNC_17(VAR_5):...\n",
"VAR_19 = filescheme.dirbrowser_html(VAR_5).decode('utf-8')\n",
"VAR_20 = bs4.BeautifulSoup(VAR_19, 'html.parser')\n",
"print(VAR_20.prettify())\n",
"VAR_21 = VAR_20('div', id='dirbrowserContainer')[0]\n",
"VAR_42 = VAR_21('ul', class_='parent')\n",
"if not VAR_42:\n",
"VAR... | [
"def parse(path):...\n",
"html = filescheme.dirbrowser_html(path).decode('utf-8')\n",
"soup = bs4.BeautifulSoup(html, 'html.parser')\n",
"print(soup.prettify())\n",
"container = soup('div', id='dirbrowserContainer')[0]\n",
"parent_elem = container('ul', class_='parent')\n",
"if not parent_elem:\n",
"p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Expr'",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_5(VAR_22: Text, VAR_23: Text, VAR_24: Optional[Fingerprint]=None...\n",
"\"\"\"docstring\"\"\"\n",
"import tarfile\n",
"if VAR_24:\n",
"FUNC_11(VAR_22, VAR_24)\n",
"VAR_43 = os.path.dirname(VAR_23)\n",
"if not os.path.exists(VAR_43):\n",
"os.makedirs(VAR_43)\n",
"for elem in os.scandir(VAR... | [
"def create_package_rasa(training_directory: Text, output_filename: Text,...\n",
"\"\"\"docstring\"\"\"\n",
"import tarfile\n",
"if fingerprint:\n",
"persist_fingerprint(training_directory, fingerprint)\n",
"output_directory = os.path.dirname(output_filename)\n",
"if not os.path.exists(output_directory)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Import'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"For",
"Expr'",
"Expr'",
"Return'"
] |
[
"@expose('/login/', methods=['GET', 'POST'])...\n",
"if g.user is not None and g.user.is_authenticated:\n",
"return redirect(self.appbuilder.get_url_for_index)\n",
"VAR_10 = LoginForm_db()\n",
"if VAR_10.validate_on_submit():\n",
"VAR_50 = self.appbuilder.sm.auth_user_db(VAR_10.username.data, VAR_10.\n ... | [
"@expose('/login/', methods=['GET', 'POST'])...\n",
"if g.user is not None and g.user.is_authenticated:\n",
"return redirect(self.appbuilder.get_url_for_index)\n",
"form = LoginForm_db()\n",
"if form.validate_on_submit():\n",
"user = self.appbuilder.sm.auth_user_db(form.username.data, form.password.data)\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"@VAR_1.after_request...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1.config.get('INCOGNITO') and VAR_13.content_type.startswith('text/html'\n",
"VAR_40 = (request.endpoint == 'report' and request.view_args is not None and\n request.view_args['report_name'] == 'editor')\n",
"return VAR_13\n",
"if not VAR_4... | [
"@app.after_request...\n",
"\"\"\"docstring\"\"\"\n",
"if app.config.get('INCOGNITO') and response.content_type.startswith('text/html'\n",
"is_editor = (request.endpoint == 'report' and request.view_args is not None and\n request.view_args['report_name'] == 'editor')\n",
"return response\n",
"if not is... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_4, VAR_5=None):...\n",
"VAR_11 = VAR_263.request.args\n",
"if VAR_4 < 0 and len(VAR_11) >= -VAR_4:\n",
"return VAR_11[VAR_4]\n",
"if VAR_4 >= 0 and len(VAR_11) > VAR_4:\n",
"return VAR_11[VAR_4]\n",
"return VAR_5\n"
] | [
"def getarg(position, default=None):...\n",
"args = current.request.args\n",
"if position < 0 and len(args) >= -position:\n",
"return args[position]\n",
"if position >= 0 and len(args) > position:\n",
"return args[position]\n",
"return default\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_9 = test.test_src_dir_path(VAR_0)\n",
"self.parser = saved_model_cli.create_parser()\n",
"VAR_10 = self.parser.parse_args(['show', '--dir', VAR_9, '--tag_set',\n 'badtagset'])\n",
"saved_model_cli.show(VAR_10)\n"
] | [
"def testShowCommandErrorNoTagSet(self):...\n",
"base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n",
"self.parser = saved_model_cli.create_parser()\n",
"args = self.parser.parse_args(['show', '--dir', base_path, '--tag_set',\n 'badtagset'])\n",
"saved_model_cli.show(args)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_68():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_192 = FUNC_10()\n",
"if VAR_13.db_name:\n",
"VAR_1.app_modules = VAR_192.get_value('app_modules')\n",
"if not (VAR_1.app_modules and VAR_1.module_app):\n",
"VAR_1.module_app = VAR_192.get_value('module_app')\n",
"VAR_1.module_app, VAR_1.app_module... | [
"def setup_module_map():...\n",
"\"\"\"docstring\"\"\"\n",
"_cache = cache()\n",
"if conf.db_name:\n",
"local.app_modules = _cache.get_value('app_modules')\n",
"if not (local.app_modules and local.module_app):\n",
"local.module_app = _cache.get_value('module_app')\n",
"local.module_app, local.app_modu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"async def FUNC_28(self, VAR_5: str, VAR_11: str, VAR_3: List[EventBase],...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_104 = {}\n",
"for VAR_170 in itertools.chain(VAR_3, VAR_2):\n",
"VAR_170.internal_metadata.outlier = True\n",
"VAR_60 = {VAR_170.event_id: VAR_170 for VAR_170 in itertools.chain(VAR_3,\n VAR... | [
"async def _persist_auth_tree(self, origin: str, room_id: str, auth_events:...\n",
"\"\"\"docstring\"\"\"\n",
"events_to_context = {}\n",
"for e in itertools.chain(auth_events, state):\n",
"e.internal_metadata.outlier = True\n",
"event_map = {e.event_id: e for e in itertools.chain(auth_events, state, [\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
] | [
"Condition",
"Docstring",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"For",
"For",
"For",
"Condition",
"Assign'",
"For",
"Expr'",
"Condition",
"Assign'",
"Ex... |
[
"def FUNC_4(self) ->Sequence[GeneratorError]:...\n",
"\"\"\"docstring\"\"\"\n",
"print(f'Generating {self.project_name}')\n",
"self.project_dir.mkdir()\n",
"return [GeneratorError(detail=\n 'Directory already exists. Delete it or use the update command.')]\n",
"self._create_package()\n",
"self._build... | [
"def build(self) ->Sequence[GeneratorError]:...\n",
"\"\"\"docstring\"\"\"\n",
"print(f'Generating {self.project_name}')\n",
"self.project_dir.mkdir()\n",
"return [GeneratorError(detail=\n 'Directory already exists. Delete it or use the update command.')]\n",
"self._create_package()\n",
"self._build_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_29(self):...\n",
"VAR_5 = self._makeContext()\n",
"self.assertIs(VAR_5.evaluate('nocall:open'), open)\n"
] | [
"def test_open_in_path_expr(self):...\n",
"ec = self._makeContext()\n",
"self.assertIs(ec.evaluate('nocall:open'), open)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self, VAR_13):...\n",
"if VAR_13 is None:\n",
"if not isinstance(self.inputSource, FileInputSource):\n",
"return VAR_13\n",
"VAR_13 = '-'\n",
"if self.inputSource.sourceName.endswith('.bs'):\n",
"VAR_13 = self.inputSource.sourceName[0:-3] + '.html'\n",
"if self.inputSource.sourceName.endsw... | [
"def fixMissingOutputFilename(self, outputFilename):...\n",
"if outputFilename is None:\n",
"if not isinstance(self.inputSource, FileInputSource):\n",
"return outputFilename\n",
"outputFilename = '-'\n",
"if self.inputSource.sourceName.endswith('.bs'):\n",
"outputFilename = self.inputSource.sourceName[0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"@CLASS_4('gpl')...\n",
"\"\"\"docstring\"\"\"\n",
"return 'text/html', utils.read_file('html/license.html')\n"
] | [
"@add_handler('gpl')...\n",
"\"\"\"docstring\"\"\"\n",
"return 'text/html', utils.read_file('html/license.html')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_3(self, VAR_23):...\n",
"assert isinstance(VAR_23, text_type)\n",
"if self.encoding:\n",
"return VAR_23.encode(self.encoding, 'strict')\n",
"return VAR_23\n"
] | [
"def encodeStrict(self, string):...\n",
"assert isinstance(string, text_type)\n",
"if self.encoding:\n",
"return string.encode(self.encoding, 'strict')\n",
"return string\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Condition",
"Return'",
"Return'"
] |
[
"@VAR_0.route('/api/templates', methods=['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_73 = {'application': request.args.get('application'), 'backend':\n request.args.get('backend'), 'recent': request.args.get('recent'),\n 'length': request.args.get('length'), 'offset': request.args.get('offset')}\n",
... | [
"@gui.route('/api/templates', methods=['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"params = {'application': request.args.get('application'), 'backend':\n request.args.get('backend'), 'recent': request.args.get('recent'),\n 'length': request.args.get('length'), 'offset': request.args.get('offset')}\n",
"t... | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.