lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "def FUNC_173(VAR_445):...\n", "return A(VAR_445, _href=URL(args='_search', vars=dict(q=t)))\n" ]
[ "def link(t):...\n", "return A(t, _href=URL(args='_search', vars=dict(q=t)))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_16(self, *VAR_40, **VAR_7):...\n", "if not self.date:\n", "self.date = timezone.now()\n", "return super(CLASS_16, self).save(*VAR_40, **kwargs)\n" ]
[ "def save(self, *args, **kwargs):...\n", "if not self.date:\n", "self.date = timezone.now()\n", "return super(IgnoreEmail, self).save(*args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_4(self):...\n", "\"\"\"docstring\"\"\"\n", "return reverse(settings.LOGIN_VIEW)\n" ]
[ "def get_login_url(self):...\n", "\"\"\"docstring\"\"\"\n", "return reverse(settings.LOGIN_VIEW)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_0(self, VAR_2, VAR_3):...\n", "VAR_4 = self.setup_test_homeserver('server', http_client=None)\n", "return VAR_4\n" ]
[ "def make_homeserver(self, reactor, clock):...\n", "hs = self.setup_test_homeserver('server', http_client=None)\n", "return hs\n" ]
[ 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_25(self, VAR_19, VAR_38):...\n", "if VAR_19 in ('first', 'last'):\n", "VAR_46 = getattr(self, VAR_19)\n", "return getattr(self, VAR_19)\n", "VAR_19 = VAR_38[:]\n", "if not VAR_19:\n", "VAR_19 = None\n", "VAR_38[:] = []\n", "return VAR_46(VAR_19)\n" ]
[ "def traverse(self, name, furtherPath):...\n", "if name in ('first', 'last'):\n", "method = getattr(self, name)\n", "return getattr(self, name)\n", "name = furtherPath[:]\n", "if not name:\n", "name = None\n", "furtherPath[:] = []\n", "return method(name)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_8(VAR_0):...\n", "from openapi_python_client import GeneratorData, Project\n", "from openapi_python_client.parser.openapi import EndpointCollection, Schemas\n", "VAR_3 = VAR_0.MagicMock(autospec=GeneratorData, title='My Test API',\n endpoint_collections_by_tag={'default': mocker.MagicMock(autospe...
[ "def test__get_errors(mocker):...\n", "from openapi_python_client import GeneratorData, Project\n", "from openapi_python_client.parser.openapi import EndpointCollection, Schemas\n", "openapi = mocker.MagicMock(autospec=GeneratorData, title='My Test API',\n endpoint_collections_by_tag={'default': mocker.Mag...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assert'" ]
[ "@defer.inlineCallbacks...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = urllib.parse.urlparse(VAR_8)\n", "assert VAR_12.hostname\n", "VAR_15 = None\n", "if VAR_12.scheme == b'matrix' and not FUNC_0(VAR_12.hostname\n", "VAR_20 = yield defer.ensureDeferred(self._well_known_resolver.\n get_well_known(VAR_12...
[ "@defer.inlineCallbacks...\n", "\"\"\"docstring\"\"\"\n", "parsed_uri = urllib.parse.urlparse(uri)\n", "assert parsed_uri.hostname\n", "delegated_server = None\n", "if parsed_uri.scheme == b'matrix' and not _is_ip_literal(parsed_uri.hostname\n", "well_known_result = yield defer.ensureDeferred(self._well...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assert'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Return'" ]
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "VAR_135 = ReportStore.from_config(config_name='GRADES_DOWNLOAD')\n", "VAR_63 = {'downloads': [dict(VAR_16=name, VAR_147=url, link=HTML(\n '<a href=\"{}\">{}</a>').format(HTML(url),...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "report_store = ReportStore.from_config(config_name='GRADES_DOWNLOAD')\n", "response_payload = {'downloads': [dict(name=name, url=url, link=HTML(\n '<a href=\"{}\">{}</a>').fo...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6():...\n", "from frappe.database import get_db\n", "VAR_10 = VAR_1.conf.db_name\n", "VAR_151 = VAR_1.conf.db_password\n", "if VAR_1.conf.different_credentials_for_replica:\n", "VAR_10 = VAR_1.conf.replica_db_name\n", "VAR_1.replica_db = get_db(host=local.conf.replica_host, VAR_10=user,\n V...
[ "def connect_replica():...\n", "from frappe.database import get_db\n", "user = local.conf.db_name\n", "password = local.conf.db_password\n", "if local.conf.different_credentials_for_replica:\n", "user = local.conf.replica_db_name\n", "local.replica_db = get_db(host=local.conf.replica_host, user=user, pa...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "async def FUNC_5(self):...\n", "if hasattr(self, 'resolved_ref'):\n", "return self.resolved_ref\n", "self.sha1_validate(self.unresolved_ref)\n", "VAR_64 = ['git', 'ls-remote', self.repo, self.unresolved_ref]\n", "self.resolved_ref = self.unresolved_ref\n", "return self.resolved_ref\n", "VAR_65 = subp...
[ "async def get_resolved_ref(self):...\n", "if hasattr(self, 'resolved_ref'):\n", "return self.resolved_ref\n", "self.sha1_validate(self.unresolved_ref)\n", "command = ['git', 'ls-remote', self.repo, self.unresolved_ref]\n", "self.resolved_ref = self.unresolved_ref\n", "return self.resolved_ref\n", "re...
[ 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "Return'", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Expr'", "Assign'" ]
[ "@parameterized.named_parameters(('VariablesToFeedNone', '', 'func2', None),...\n", "if not test.is_built_with_xla():\n", "self.skipTest('Skipping test because XLA is not compiled in.')\n", "VAR_13 = os.path.join(test.get_temp_dir(), 'dummy_model')\n", "VAR_14 = self.AOTCompileDummyModel()\n", "VAR_6 = ge...
[ "@parameterized.named_parameters(('VariablesToFeedNone', '', 'func2', None),...\n", "if not test.is_built_with_xla():\n", "self.skipTest('Skipping test because XLA is not compiled in.')\n", "saved_model_dir = os.path.join(test.get_temp_dir(), 'dummy_model')\n", "dummy_model = self.AOTCompileDummyModel()\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 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "C...
[ "def FUNC_64(self, VAR_2):...\n", "" ]
[ "def write(self, data):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "async def FUNC_6(self):...\n", "return 'fake/repo/1a2b3c4d5e6f'\n" ]
[ "async def get_resolved_spec(self):...\n", "return 'fake/repo/1a2b3c4d5e6f'\n" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Return'" ]
[ "def FUNC_19(self, VAR_2):...\n", "def FUNC_30(self, VAR_8):...\n", "VAR_2.add_url_rule('/sites/<int:id>', endpoint='site_resource.get')\n", "url_for('delete', VAR_8=1, _cls=SiteResource)\n" ]
[ "def test_it_falls_through_if_class_endpoint_not_found(self, app):...\n", "def get(self, id):...\n", "app.add_url_rule('/sites/<int:id>', endpoint='site_resource.get')\n", "url_for('delete', id=1, _cls=SiteResource)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_15(self, VAR_0, VAR_8, VAR_5, VAR_7):...\n", "VAR_0.get(VAR_8 + self.url)\n", "VAR_16 = VAR_0.find_element(By.XPATH, \"//input[@name='file']\")\n", "VAR_16.send_keys(VAR_5)\n", "assert VAR_16.get_attribute('name') == 'file'\n", "VAR_17 = VAR_0.find_element(By.XPATH, \"//input[@name='save']\")\n"...
[ "def test_progress(self, driver, live_server, upload_file, freeze):...\n", "driver.get(live_server + self.url)\n", "file_input = driver.find_element(By.XPATH, \"//input[@name='file']\")\n", "file_input.send_keys(upload_file)\n", "assert file_input.get_attribute('name') == 'file'\n", "save_button = driver....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Assert'", "Assign'", "Expr'", "Assert'", "Expr'", "Assign'", "Expr'", "Assert'", "Assign'", "Expr'", "Assign'", "Assert'" ]
[ "@VAR_0.simple_tag...\n", "\"\"\"docstring\"\"\"\n", "VAR_52 = reverse('rest_framework:login')\n", "return 'log in'\n", "VAR_41 = \"<a href='{href}?next={next}'>log in</a>\"\n", "VAR_41 = format_html(VAR_41, href=login_url, next=escape(request.path))\n", "return mark_safe(VAR_41)\n" ]
[ "@register.simple_tag...\n", "\"\"\"docstring\"\"\"\n", "login_url = reverse('rest_framework:login')\n", "return 'log in'\n", "snippet = \"<a href='{href}?next={next}'>log in</a>\"\n", "snippet = format_html(snippet, href=login_url, next=escape(request.path))\n", "return mark_safe(snippet)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_155():...\n", "def FUNC_172(VAR_354):...\n", "return VAR_354 + ' ' + VAR_354.replace('icon', 'glyphicon')\n" ]
[ "def bootstrap3():...\n", "def rename(icon):...\n", "return icon + ' ' + icon.replace('icon', 'glyphicon')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Return'" ]
[ "def FUNC_15(self):...\n", "return getattr(self, '_doc_before_save', None)\n" ]
[ "def get_doc_before_save(self):...\n", "return getattr(self, '_doc_before_save', None)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_13(self):...\n", "\"\"\"docstring\"\"\"\n", "for VAR_19 in self.meta.get_table_fields():\n", "self.update_child_table(VAR_19.fieldname, VAR_19)\n" ]
[ "def update_children(self):...\n", "\"\"\"docstring\"\"\"\n", "for df in self.meta.get_table_fields():\n", "self.update_child_table(df.fieldname, df)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Expr'" ]
[ "def FUNC_20(self, VAR_19):...\n", "if os.path.exists(VAR_19):\n", "return f.read()\n" ]
[ "def albumartcache_load(self, imgb64path):...\n", "if os.path.exists(imgb64path):\n", "return f.read()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "if os.path.isfile('index.bs'):\n", "return 'index.bs'\n", "if os.path.isfile('Overview.bs'):\n", "return 'Overview.bs'\n", "VAR_20 = glob.glob('*.bs')\n", "if VAR_20:\n", "return VAR_20[0]\n", "VAR_21 = glob.glob('*.src.html')\n", "if VAR_21:\n",...
[ "def findImplicitInputFile():...\n", "\"\"\"docstring\"\"\"\n", "if os.path.isfile('index.bs'):\n", "return 'index.bs'\n", "if os.path.isfile('Overview.bs'):\n", "return 'Overview.bs'\n", "allBs = glob.glob('*.bs')\n", "if allBs:\n", "return allBs[0]\n", "allHtml = glob.glob('*.src.html')\n", "i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_6(self):...\n", "VAR_7 = self.helper.create_room_as(self.u_alice, tok=self.t_alice)\n", "VAR_8 = self.get_success(event_injection.inject_member_event(self.hs, VAR_7,\n self.u_bob, Membership.JOIN))\n", "VAR_9, VAR_10 = self.get_success(event_injection.create_event(self.hs,\n room_id=room, send...
[ "def test_get_joined_users_from_context(self):...\n", "room = self.helper.create_room_as(self.u_alice, tok=self.t_alice)\n", "bob_event = self.get_success(event_injection.inject_member_event(self.hs,\n room, self.u_bob, Membership.JOIN))\n", "event, context = self.get_success(event_injection.create_event(s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@CLASS_4('bookmarks')...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = sorted(objreg.get('bookmark-manager').marks.items(), key=lambda x:\n x[1])\n", "VAR_19 = sorted(objreg.get('quickmark-manager').marks.items(), key=lambda x:\n x[0])\n", "VAR_20 = jinja.render('bookmarks.html', title='Bookmarks', VAR_18...
[ "@add_handler('bookmarks')...\n", "\"\"\"docstring\"\"\"\n", "bookmarks = sorted(objreg.get('bookmark-manager').marks.items(), key=lambda\n x: x[1])\n", "quickmarks = sorted(objreg.get('quickmark-manager').marks.items(), key=lambda\n x: x[0])\n", "html = jinja.render('bookmarks.html', title='Bookmarks...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "async def FUNC_5(VAR_7=None, VAR_8=False):...\n", "return {'user': UserID.from_string(self.auth_user_id), 'token_id': 1,\n 'is_guest': False}\n" ]
[ "async def get_user_by_access_token(token=None, allow_guest=False):...\n", "return {'user': UserID.from_string(self.auth_user_id), 'token_id': 1,\n 'is_guest': False}\n" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Return'" ]
[ "async def FUNC_27(self, VAR_5: str, VAR_11: str, VAR_34: Iterable[...\n", "\"\"\"docstring\"\"\"\n", "async def FUNC_49(VAR_102: _NewEventInfo):...\n", "VAR_1 = VAR_102.event\n", "VAR_168 = await self._prep_event(VAR_5, VAR_1, VAR_2=ev_info.state, VAR_3=\n ev_info.auth_events, VAR_33=backfilled)\n", "...
[ "async def _handle_new_events(self, origin: str, room_id: str, event_infos:...\n", "\"\"\"docstring\"\"\"\n", "async def prep(ev_info: _NewEventInfo):...\n", "event = ev_info.event\n", "res = await self._prep_event(origin, event, state=ev_info.state,\n auth_events=ev_info.auth_events, backfilled=backfill...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "AsyncFunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_0, VAR_1):...\n", "return FUNC_0(VAR_0=request, VAR_1=pk, VAR_2='is_removed', VAR_3=False,\n VAR_5=_('The topic has been undeleted'))\n" ]
[ "def undelete(request, pk):...\n", "return _moderate(request=request, pk=pk, field_name='is_removed', to_value=\n False, message=_('The topic has been undeleted'))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0: Optional[str], VAR_1: Optional[Path]) ->Union[CLASS_0,...\n", "VAR_2 = FUNC_3(VAR_0=url, VAR_1=path)\n", "if isinstance(VAR_2, GeneratorError):\n", "return VAR_2\n", "VAR_3 = GeneratorData.from_dict(VAR_2)\n", "if isinstance(VAR_3, GeneratorError):\n", "return VAR_3\n", "return CLAS...
[ "def _get_project_for_url_or_path(url: Optional[str], path: Optional[Path]...\n", "data_dict = _get_document(url=url, path=path)\n", "if isinstance(data_dict, GeneratorError):\n", "return data_dict\n", "openapi = GeneratorData.from_dict(data_dict)\n", "if isinstance(openapi, GeneratorError):\n", "return...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_17(self, VAR_19, VAR_40):...\n", "return self\n" ]
[ "def creatorForNetloc(self, hostname, port):...\n", "return self\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "import pathlib\n", "import httpcore\n", "import jinja2\n", "import pytest\n", "import yaml\n", "from openapi_python_client import GeneratorError\n", "def FUNC_0(VAR_0):...\n", "VAR_1 = VAR_0.MagicMock()\n", "VAR_2 = VAR_0.patch('openapi_python_client._get_document', return_value=\n data_dict)\n"...
[ "import pathlib\n", "import httpcore\n", "import jinja2\n", "import pytest\n", "import yaml\n", "from openapi_python_client import GeneratorError\n", "def test__get_project_for_url_or_path(mocker):...\n", "data_dict = mocker.MagicMock()\n", "_get_document = mocker.patch('openapi_python_client._get_d...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "ImportFrom'", "Assign'", "Expr'", "Expr'", "Expr'", "Assert'", "FunctionDef'", "Assign'", "Assign'", "Assi...
[ "def FUNC_3(self, VAR_15: 'ComponentRegistry'):...\n", "self._registry = VAR_15\n" ]
[ "def initialize(self, registry: 'ComponentRegistry'):...\n", "self._registry = registry\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def __init__(self, VAR_3=None, VAR_7=None):...\n", "VAR_28 = {'class': 'vTimeField', 'size': '8'}\n", "if VAR_3 is not None:\n", "VAR_28.update(VAR_3)\n", "super(CLASS_2, self).__init__(VAR_3=final_attrs, VAR_7=format)\n" ]
[ "def __init__(self, attrs=None, format=None):...\n", "final_attrs = {'class': 'vTimeField', 'size': '8'}\n", "if attrs is not None:\n", "final_attrs.update(attrs)\n", "super(AdminTimeWidget, self).__init__(attrs=final_attrs, format=format)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "@login_required()...\n", "VAR_71 = VAR_2.GET\n", "VAR_46 = FUNC_1(VAR_2, 'image')\n", "VAR_45 = FUNC_1(VAR_2, 'dataset')\n", "VAR_44 = FUNC_1(VAR_2, 'project')\n", "VAR_47 = FUNC_1(VAR_2, 'screen')\n", "VAR_48 = FUNC_1(VAR_2, 'plate')\n", "VAR_85 = FUNC_1(VAR_2, 'acquisition')\n", "VAR_86 = FUNC_1(...
[ "@login_required()...\n", "r = request.GET\n", "image_ids = get_list(request, 'image')\n", "dataset_ids = get_list(request, 'dataset')\n", "project_ids = get_list(request, 'project')\n", "screen_ids = get_list(request, 'screen')\n", "plate_ids = get_list(request, 'plate')\n", "run_ids = get_list(reque...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6(self) ->None:...\n", "if streamlit.server.routes.allow_cross_origin_requests():\n", "self.set_header('Access-Control-Allow-Origin', '*')\n" ]
[ "def set_default_headers(self) ->None:...\n", "if streamlit.server.routes.allow_cross_origin_requests():\n", "self.set_header('Access-Control-Allow-Origin', '*')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'" ]
[ "@override_settings(LOGIN_URL='https:///login/')...\n", "VAR_25 = urlquote('http://testserver/login_required/')\n", "VAR_6 = 'https:///login/?next=%s' % VAR_25\n", "self.assertLoginURLEquals(VAR_6)\n" ]
[ "@override_settings(LOGIN_URL='https:///login/')...\n", "quoted_next = urlquote('http://testserver/login_required/')\n", "expected = 'https:///login/?next=%s' % quoted_next\n", "self.assertLoginURLEquals(expected)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(self, VAR_24, VAR_25=None):...\n", "if VAR_25:\n", "return b''.join(list(self.serialize(VAR_24, VAR_25)))\n", "return ''.join(list(self.serialize(VAR_24)))\n" ]
[ "def render(self, treewalker, encoding=None):...\n", "if encoding:\n", "return b''.join(list(self.serialize(treewalker, encoding)))\n", "return ''.join(list(self.serialize(treewalker)))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_7(self, VAR_16, VAR_17, VAR_5):...\n", "VAR_6 = VAR_16.get(VAR_5)\n", "if VAR_6:\n", "return VAR_6.split(',')\n" ]
[ "def value_from_datadict(self, data, files, name):...\n", "value = data.get(name)\n", "if value:\n", "return value.split(',')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_59(self):...\n", "\"\"\"docstring\"\"\"\n", "self.login()\n", "VAR_3 = self.client.get('/logout/custom_query/?follow=/somewhere/')\n", "self.assertEqual(VAR_3.status_code, 302)\n", "self.assertURLEqual(VAR_3.url, '/somewhere/')\n", "self.confirm_logged_out()\n" ]
[ "def test_logout_with_custom_redirect_argument(self):...\n", "\"\"\"docstring\"\"\"\n", "self.login()\n", "response = self.client.get('/logout/custom_query/?follow=/somewhere/')\n", "self.assertEqual(response.status_code, 302)\n", "self.assertURLEqual(response.url, '/somewhere/')\n", "self.confirm_logge...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_141(self, VAR_212):...\n", "if not self.can_read(VAR_212):\n", "VAR_407 = (VAR_212.body or '').replace('\\r', '')\n", "return ''\n", "VAR_408 = [VAR_446 for VAR_446 in VAR_407.split('\\n\\n') if not VAR_446.\n startswith('#') and VAR_446.strip()]\n", "if VAR_408:\n", "return VAR_408[0]\n" ]
[ "def first_paragraph(self, page):...\n", "if not self.can_read(page):\n", "mm = (page.body or '').replace('\\r', '')\n", "return ''\n", "ps = [p for p in mm.split('\\n\\n') if not p.startswith('#') and p.strip()]\n", "if ps:\n", "return ps[0]\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Return'" ]
[ "@staticmethod...\n", "VAR_1 = AnEnum(VAR_0['an_enum_value'])\n", "def FUNC_2(VAR_4: Dict[str, Any]) ->Union[datetime, date]:...\n", "VAR_5: Union[datetime, date]\n", "VAR_5 = datetime.fromisoformat(VAR_0['aCamelDateTime'])\n", "VAR_5 = date.fromisoformat(VAR_0['aCamelDateTime'])\n", "return VAR_5\n", ...
[ "@staticmethod...\n", "an_enum_value = AnEnum(d['an_enum_value'])\n", "def _parse_a_camel_date_time(data: Dict[str, Any]) ->Union[datetime, date]:...\n", "a_camel_date_time: Union[datetime, date]\n", "a_camel_date_time = datetime.fromisoformat(d['aCamelDateTime'])\n", "a_camel_date_time = date.fromisoform...
[ 0, 0, 0, 5, 5, 5, 0, 0 ]
[ "Condition", "Assign'", "FunctionDef'", "AnnAssign'", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_8():...\n", "VAR_6 = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentModel' model_id=model.id\"\n )\n", "VAR_7 = unicorn(None, VAR_6)\n", "VAR_8 = {'model': {'pk': 123}}\n", "VAR_9 = VAR_7.render(VAR_8)\n", "assert '==123==' in VAR_9\n" ]
[ "def test_unicorn_render_id_use_pk():...\n", "token = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentModel' model_id=model.id\"\n )\n", "unicorn_node = unicorn(None, token)\n", "context = {'model': {'pk': 123}}\n", "actual = unicorn_node.render(context)\n", "a...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assert'" ]
[ "def FUNC_70(self):...\n", "VAR_76 = getattr(self, '_liked_by', None)\n", "if VAR_76:\n", "return json.loads(VAR_76)\n", "return []\n" ]
[ "def get_liked_by(self):...\n", "liked_by = getattr(self, '_liked_by', None)\n", "if liked_by:\n", "return json.loads(liked_by)\n", "return []\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_6(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertEqual(VAR_5.evaluate('d/one'), 1)\n" ]
[ "def test_evaluate_simple_path_dict_key_int_value(self):...\n", "ec = self._makeContext()\n", "self.assertEqual(ec.evaluate('d/one'), 1)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "async def FUNC_6(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'{self.quoted_namespace}/{self.resolved_ref}'\n" ]
[ "async def get_resolved_spec(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'{self.quoted_namespace}/{self.resolved_ref}'\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_4(self):...\n", "assert controller_name(CLASS_11) == 'more_than_one_word'\n" ]
[ "def test_it_works_with_more_than_one_word(self):...\n", "assert controller_name(MoreThanOneWordController) == 'more_than_one_word'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assert'" ]
[ "def FUNC_11(self, VAR_11, VAR_9, VAR_12, VAR_10, **VAR_4):...\n", "self.layout.move_cell_to_position(VAR_11, VAR_9, VAR_12, VAR_10)\n", "self.save_layout()\n" ]
[ "def dispatch_move_cell_to_position(self, from_x, from_y, to_x, to_y, **kwargs):...\n", "self.layout.move_cell_to_position(from_x, from_y, to_x, to_y)\n", "self.save_layout()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_8(self, VAR_6):...\n", "VAR_13 = UploadForm(data={'file-clear': '1'}, instance=filemodel)\n", "assert VAR_13.is_valid()\n", "assert not VAR_13.cleaned_data['file']\n" ]
[ "def test_clear(self, filemodel):...\n", "form = UploadForm(data={'file-clear': '1'}, instance=filemodel)\n", "assert form.is_valid()\n", "assert not form.cleaned_data['file']\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'", "Assert'" ]
[ "def FUNC_3(self, VAR_13):...\n", "return VAR_13\n" ]
[ "def to_python(self, value):...\n", "return value\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_121(*VAR_79, **VAR_42):...\n", "if VAR_13.read_from_replica:\n", "FUNC_6()\n", "VAR_225 = VAR_129(*VAR_79, **get_newargs(fn, kwargs))\n", "if VAR_1 and hasattr(VAR_1, 'primary_db'):\n", "return VAR_225\n", "VAR_1.db.close()\n", "VAR_1.db = VAR_1.primary_db\n" ]
[ "def wrapper_fn(*args, **kwargs):...\n", "if conf.read_from_replica:\n", "connect_replica()\n", "retval = fn(*args, **get_newargs(fn, kwargs))\n", "if local and hasattr(local, 'primary_db'):\n", "return retval\n", "local.db.close()\n", "local.db = local.primary_db\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Condition", "Return'", "Expr'", "Assign'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_96 = []\n", "VAR_97 = set()\n", "VAR_98 = []\n", "VAR_68 = {}\n", "VAR_77 = {}\n", "for VAR_215 in ('Project', 'Dataset', 'Image', 'Screen', 'Plate'):\n", "VAR_154 = VAR_2.GET.get(VAR_215, None)\n", "VAR_96 = list(set(VAR_96))\n", "if VAR...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "ownerIds = []\n", "currentGroups = set()\n", "groupSets = []\n", "groups = {}\n", "owners = {}\n", "for dtype in ('Project', 'Dataset', 'Image', 'Screen', 'Plate'):\n", "oids = request.GET.get(dtype, None)\n", "ownerIds = list(set(ownerIds))\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 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Condition", "For", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Expr'", "Ex...
[ "def __init__(self, VAR_5, VAR_4, *VAR_6, **VAR_7):...\n", "if VAR_7['initial'] is None:\n", "VAR_7['initial'] = {}\n", "VAR_7['initial']['terminology'] = True\n", "super().__init__(VAR_5, VAR_4, *VAR_6, **kwargs)\n" ]
[ "def __init__(self, translation, user, *args, **kwargs):...\n", "if kwargs['initial'] is None:\n", "kwargs['initial'] = {}\n", "kwargs['initial']['terminology'] = True\n", "super().__init__(translation, user, *args, **kwargs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "async def FUNC_4(self, VAR_5: str, VAR_1: EventBase, VAR_2: Optional[...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = VAR_1.room_id\n", "VAR_12 = VAR_1.event_id\n", "VAR_0.debug('[%s %s] Processing event: %s', VAR_11, VAR_12, VAR_1)\n", "await self._handle_new_event(VAR_5, VAR_1, VAR_2=state)\n", "if VAR_1...
[ "async def _process_received_pdu(self, origin: str, event: EventBase, state:...\n", "\"\"\"docstring\"\"\"\n", "room_id = event.room_id\n", "event_id = event.event_id\n", "logger.debug('[%s %s] Processing event: %s', room_id, event_id, event)\n", "await self._handle_new_event(origin, event, state=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 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Conditio...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "VAR_120 = CourseRegistrationCode.objects.filter(VAR_10=course_id).order_by(\n 'invoice_item__invoice__company_name')\n", "VAR_88 = VAR_9.POST['active_company_name']\n", "if VAR_8...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "registration_codes_list = CourseRegistrationCode.objects.filter(course_id=\n course_id).order_by('invoice_item__invoice__company_name')\n", "company_name = request.POST['acti...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_8(self):...\n", "self._record_users()\n", "self.get_success(self.handler.delete_device(VAR_0, 'abc'))\n", "self.get_failure(self.handler.get_device(VAR_0, 'abc'), synapse.api.errors.\n NotFoundError)\n" ]
[ "def test_delete_device(self):...\n", "self._record_users()\n", "self.get_success(self.handler.delete_device(user1, 'abc'))\n", "self.get_failure(self.handler.get_device(user1, 'abc'), synapse.api.errors.\n NotFoundError)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_39(self):...\n", "\"\"\"docstring\"\"\"\n", "signal.signal(signal.SIGINT, self._handle_sigint)\n" ]
[ "def _restore_sigint_handler(self):...\n", "\"\"\"docstring\"\"\"\n", "signal.signal(signal.SIGINT, self._handle_sigint)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "@app.route('/folders/delete', methods=['POST'])...\n", "VAR_9 = forms.DeleteFolderForm()\n", "if VAR_9.validate_on_submit():\n", "if data.delete_dir(VAR_9.dir_name.data):\n", "flash('Could not delete folder.', 'error')\n", "flash('Folder successfully deleted.', 'success')\n", "flash('Folder not found.'...
[ "@app.route('/folders/delete', methods=['POST'])...\n", "form = forms.DeleteFolderForm()\n", "if form.validate_on_submit():\n", "if data.delete_dir(form.dir_name.data):\n", "flash('Could not delete folder.', 'error')\n", "flash('Folder successfully deleted.', 'success')\n", "flash('Folder not found.', '...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Condition", "Expr'", "Expr'", "Expr'", "Return'", "Return'", "Return'" ]
[ "def FUNC_4(VAR_2, VAR_3, VAR_5, VAR_6=0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = saved_model_utils.get_meta_graph_def(VAR_2, VAR_3)\n", "VAR_24 = FUNC_2(VAR_4, VAR_5)\n", "VAR_25 = FUNC_3(VAR_4, VAR_5)\n", "VAR_26 = ' ' * VAR_6\n", "def FUNC_30(VAR_27):...\n", "print(VAR_26 + VAR_27)\n", "FUNC...
[ "def _show_inputs_outputs(saved_model_dir, tag_set, signature_def_key, indent=0...\n", "\"\"\"docstring\"\"\"\n", "meta_graph_def = saved_model_utils.get_meta_graph_def(saved_model_dir, tag_set)\n", "inputs_tensor_info = _get_inputs_tensor_info_from_meta_graph_def(meta_graph_def\n , signature_def_key)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Expr'", "Expr'", "For", "Expr'", "Expr'", "Expr'", "For", "Expr'", "Expr'", "Expr'" ]
[ "@wraps(VAR_2)...\n", "if current_user.role_upload():\n", "return VAR_2(*VAR_48, **kwargs)\n", "abort(403)\n" ]
[ "@wraps(f)...\n", "if current_user.role_upload():\n", "return f(*args, **kwargs)\n", "abort(403)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Expr'" ]
[ "def __str__(self):...\n", "if self.shared:\n", "return '%s (*)' % self.title\n", "return '%s' % self.title\n" ]
[ "def __str__(self):...\n", "if self.shared:\n", "return '%s (*)' % self.title\n", "return '%s' % self.title\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import copy\n", "import os\n", "import datetime\n", "import Ice\n", "from Ice import Exception as IceException\n", "import logging\n", "import traceback\n", "import json\n", "import re\n", "import sys\n", "import warnings\n", "from past.builtins import unicode\n", ...
[ "\"\"\" A view functions is simply a Python function that takes a Web request and\nreturns a Web response. This response can be the HTML contents of a Web page,\nor a redirect, or the 404 and 500 error, or an XML document, or an image...\nor anything.\"\"\"\n", "import copy\n", "import os\n", "import datetime...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'"...
[ "async def FUNC_8(self, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "async def FUNC_15(VAR_20):...\n", "VAR_58 = await self.get_server_verify_key_v2_indirect(VAR_16, VAR_20)\n", "VAR_0.warning('Key lookup failed from %r: %s', VAR_20.server_name, e)\n", "return {}\n", "return VAR_58\n", "VAR_0.exception...
[ "async def get_keys(self, keys_to_fetch):...\n", "\"\"\"docstring\"\"\"\n", "async def get_key(key_server):...\n", "result = await self.get_server_verify_key_v2_indirect(keys_to_fetch, key_server\n )\n", "logger.warning('Key lookup failed from %r: %s', key_server.server_name, e)\n", "return {}\n", "r...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "AsyncFunctionDef'", "Assign'", "Expr'", "Return'", "Return'", "Expr'" ]
[ "def FUNC_34(VAR_32, VAR_33, VAR_34=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_68 = ['code', 'redeem_code_url', 'course_id', 'company_name',\n 'created_by', 'redeemed_by', 'invoice_id', 'purchaser',\n 'customer_reference_number', 'internal_reference', 'is_valid']\n", "VAR_85 = instructor_analytics.ba...
[ "def registration_codes_csv(file_name, codes_list, csv_type=None):...\n", "\"\"\"docstring\"\"\"\n", "query_features = ['code', 'redeem_code_url', 'course_id', 'company_name',\n 'created_by', 'redeemed_by', 'invoice_id', 'purchaser',\n 'customer_reference_number', 'internal_reference', 'is_valid']\n", "...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_7, VAR_8):...\n", "" ]
[ "def check_user_session(user_id, session_key):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@VAR_2.route('/register', methods=['GET', 'POST'])...\n", "if not config.config_public_reg:\n", "abort(404)\n", "if VAR_87 is not None and VAR_87.is_authenticated:\n", "return redirect(url_for('web.index'))\n", "if not config.get_mail_server_configured():\n", "flash(_(\n u'E-Mail server is not confi...
[ "@web.route('/register', methods=['GET', 'POST'])...\n", "if not config.config_public_reg:\n", "abort(404)\n", "if current_user is not None and current_user.is_authenticated:\n", "return redirect(url_for('web.index'))\n", "if not config.get_mail_server_configured():\n", "flash(_(\n u'E-Mail server is...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Condition", "Return'", "Condition", "Expr'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Expr'", "Return'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Return'", "Assign'", "Return'", "Condition", "Assign'", ...
[ "def FUNC_6(self, VAR_1):...\n", "from openapi_python_client.parser import properties\n", "properties._existing_enums = VAR_1.MagicMock()\n", "assert properties.EnumProperty.get_all_enums() == properties._existing_enums\n", "properties._existing_enums = {}\n" ]
[ "def test_get_all_enums(self, mocker):...\n", "from openapi_python_client.parser import properties\n", "properties._existing_enums = mocker.MagicMock()\n", "assert properties.EnumProperty.get_all_enums() == properties._existing_enums\n", "properties._existing_enums = {}\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assert'", "Assign'" ]
[ "def FUNC_114():...\n", "if VAR_32:\n", "if VAR_19.rollback_on_exception:\n", "VAR_12.rollback()\n", "import inspect\n", "if inspect.isclass(VAR_32) and issubclass(VAR_32, Exception):\n" ]
[ "def _raise_exception():...\n", "if raise_exception:\n", "if flags.rollback_on_exception:\n", "db.rollback()\n", "import inspect\n", "if inspect.isclass(raise_exception) and issubclass(raise_exception, Exception):\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Import'", "Condition" ]
[ "def __init__(self, VAR_9, *VAR_6, **VAR_7):...\n", "super().__init__(*VAR_6, **kwargs)\n", "VAR_118 = Language.objects.filter(translation__component=component).exclude(pk\n =component.source_language_id)\n", "self.fields['lang'].choices = VAR_118.as_choices()\n" ]
[ "def __init__(self, component, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n", "languages = Language.objects.filter(translation__component=component).exclude(\n pk=component.source_language_id)\n", "self.fields['lang'].choices = languages.as_choices()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "@VAR_4.route('/quiz')...\n", "return render_template('quiz/quiz_container.html')\n" ]
[ "@app.route('/quiz')...\n", "return render_template('quiz/quiz_container.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@login_required(isAdmin=True)...\n", "\"\"\"docstring\"\"\"\n", "if VAR_2.method != 'POST':\n", "return {'template': 'webclient/scripts/upload_script.html'}\n", "VAR_236 = VAR_2.POST.get('script_path')\n", "VAR_237 = VAR_2.FILES['script_file']\n", "VAR_237.seek(0)\n", "VAR_238 = VAR_237.read().decode...
[ "@login_required(isAdmin=True)...\n", "\"\"\"docstring\"\"\"\n", "if request.method != 'POST':\n", "return {'template': 'webclient/scripts/upload_script.html'}\n", "script_path = request.POST.get('script_path')\n", "script_file = request.FILES['script_file']\n", "script_file.seek(0)\n", "script_text =...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'" ]
[ "\"\"\"A cleanup tool for HTML.\n\nRemoves unwanted tags and content. See the `Cleaner` class for\ndetails.\n\"\"\"\n", "from __future__ import absolute_import\n", "import copy\n", "import re\n", "import sys\n", "from urlparse import urlsplit\n", "from urllib.parse import urlsplit, unquote_plus\n", "...
[ "\"\"\"A cleanup tool for HTML.\n\nRemoves unwanted tags and content. See the `Cleaner` class for\ndetails.\n\"\"\"\n", "from __future__ import absolute_import\n", "import copy\n", "import re\n", "import sys\n", "from urlparse import urlsplit\n", "from urllib.parse import urlsplit, unquote_plus\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 2 ]
[ "Expr'", "ImportFrom'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assig...
[ "def FUNC_97(VAR_62):...\n", "def FUNC_120():...\n", "VAR_214 = VAR_1.db.get_value('DocType', VAR_62, 'module')\n", "return VAR_1.module_app[FUNC_56(VAR_214)]\n" ]
[ "def get_doctype_app(doctype):...\n", "def _get_doctype_app():...\n", "doctype_module = local.db.get_value('DocType', doctype, 'module')\n", "return local.module_app[scrub(doctype_module)]\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_9(self):...\n", "def __call__(self):...\n", "VAR_6 = CLASS_5()\n", "VAR_5 = self._makeContext(VAR_0={'dummy': dummy})\n", "self.assertIs(VAR_5.evaluate('dummy'), VAR_6)\n" ]
[ "def test_evaluate_with_unimplemented_call(self):...\n", "def __call__(self):...\n", "dummy = Dummy()\n", "ec = self._makeContext(bindings={'dummy': dummy})\n", "self.assertIs(ec.evaluate('dummy'), dummy)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "async def FUNC_36(self, VAR_40: Iterable[EventBase], VAR_41: Iterable[...\n", "\"\"\"docstring\"\"\"\n", "VAR_0.debug('construct_auth_difference Start!')\n", "def FUNC_50(VAR_21):...\n", "return VAR_21.depth, VAR_21.event_id\n" ]
[ "async def construct_auth_difference(self, local_auth: Iterable[EventBase],...\n", "\"\"\"docstring\"\"\"\n", "logger.debug('construct_auth_difference Start!')\n", "def sort_fun(ev):...\n", "return ev.depth, ev.event_id\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "FunctionDef'", "Return'" ]
[ "@CLASS_4('log')...\n", "\"\"\"docstring\"\"\"\n", "if log.ram_handler is None:\n", "VAR_38 = None\n", "VAR_37 = QUrlQuery(VAR_3).queryItemValue('level')\n", "VAR_20 = jinja.render('log.html', title='log', content=html_log)\n", "if not VAR_37:\n", "return 'text/html', VAR_20\n", "VAR_37 = 'vdebug'\n...
[ "@add_handler('log')...\n", "\"\"\"docstring\"\"\"\n", "if log.ram_handler is None:\n", "html_log = None\n", "level = QUrlQuery(url).queryItemValue('level')\n", "html = jinja.render('log.html', title='log', content=html_log)\n", "if not level:\n", "return 'text/html', html\n", "level = 'vdebug'\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_84(*VAR_79, **VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_12.get_value(*VAR_79, **kwargs)\n" ]
[ "def get_value(*args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "return db.get_value(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_33(VAR_30):...\n", "print(VAR_29 + VAR_30)\n" ]
[ "def in_print(s):...\n", "print(indent_str + s)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_29(self):...\n", "self.called = True\n" ]
[ "def to_html(self):...\n", "self.called = True\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_2(VAR_6, VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "if hasattr(VAR_6, '__render_with_namespace__'):\n", "VAR_6 = ZRPythonExpr.call_with_ns(VAR_6.__render_with_namespace__, VAR_7)\n", "VAR_40 = aq_base(VAR_6)\n", "return VAR_6\n", "VAR_40 = removeAllProxies(VAR_40)\n", "if callable(VAR_40):\n...
[ "def render(ob, ns):...\n", "\"\"\"docstring\"\"\"\n", "if hasattr(ob, '__render_with_namespace__'):\n", "ob = ZRPythonExpr.call_with_ns(ob.__render_with_namespace__, ns)\n", "base = aq_base(ob)\n", "return ob\n", "base = removeAllProxies(base)\n", "if callable(base):\n", "if getattr(base, 'isDocTem...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Return'", "Assign'", "Condition", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_1(self, VAR_2, VAR_3, VAR_4):...\n", "self.room_id = self.helper.create_room_as(self.user_id)\n" ]
[ "def prepare(self, reactor, clock, hs):...\n", "self.room_id = self.helper.create_room_as(self.user_id)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_2(VAR_4, VAR_5, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "for VAR_32, node in enumerate(VAR_4):\n", "if VAR_32 % 2 == 0:\n", "return VAR_4\n", "VAR_4[VAR_32:VAR_32 + 1] = FUNC_3(VAR_5, node, VAR_6)\n" ]
[ "def processTextNodes(nodes, regex, replacer):...\n", "\"\"\"docstring\"\"\"\n", "for i, node in enumerate(nodes):\n", "if i % 2 == 0:\n", "return nodes\n", "nodes[i:i + 1] = reSubObject(regex, node, replacer)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Condition", "Return'", "Assign'" ]
[ "def FUNC_2(VAR_5: EscapableEntity) ->str:...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(VAR_5, HTML):\n", "return VAR_5.__html__()\n", "VAR_5 = FUNC_0(VAR_5)\n", "VAR_5 = VAR_1.sub('<\\\\1\\\\2>', VAR_5)\n", "for a_href in VAR_3.finditer(VAR_5):\n", "VAR_5 = VAR_5.replace(a_href.group(0), u'<a hre...
[ "def escape_text(text: EscapableEntity) ->str:...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(text, HTML):\n", "return text.__html__()\n", "text = escape_attribute(text)\n", "text = _UNESCAPER_TEXT.sub('<\\\\1\\\\2>', text)\n", "for a_href in _A_HREF.finditer(text):\n", "text = text.replace(a_href.g...
[ 0, 0, 0, 0, 0, 0, 0, 2, 2 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Assign'", "For", "Assign'", "Return'" ]
[ "def FUNC_9(VAR_10, VAR_18=False):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_7(self):...\n", "self.distribution.run_command('jsversion')\n", "VAR_60 = self.distribution.get_command_obj('jsdeps')\n", "VAR_61 = self.distribution.get_command_obj('js')\n", "VAR_62 = self.distribution.get_command_obj('css'...
[ "def css_js_prerelease(command, strict=False):...\n", "\"\"\"docstring\"\"\"\n", "def run(self):...\n", "self.distribution.run_command('jsversion')\n", "jsdeps = self.distribution.get_command_obj('jsdeps')\n", "js = self.distribution.get_command_obj('js')\n", "css = self.distribution.get_command_obj('cs...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Return'", "Expr'", "Condition", "Condition", "Expr'", "Assign'", "Expr'", "A...
[ "def FUNC_1(self):...\n", "VAR_3 = VAR_0.get('/', {'q': '查询'})\n", "VAR_4 = add_query_param(VAR_3, 'format', 'json')\n", "self.assertIn('q=%E6%9F%A5%E8%AF%A2', VAR_4)\n", "self.assertIn('format=json', VAR_4)\n" ]
[ "def test_add_query_param_with_non_latin_character(self):...\n", "request = factory.get('/', {'q': '查询'})\n", "json_url = add_query_param(request, 'format', 'json')\n", "self.assertIn('q=%E6%9F%A5%E8%AF%A2', json_url)\n", "self.assertIn('format=json', json_url)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_12(VAR_4):...\n", "VAR_21 = [m.upper() for m in VAR_13]\n", "for r, m, v in itertools.product(VAR_12, VAR_21, [VAR_4.__name__]):\n", "self.before_acl.append((r, m, v, VAR_3))\n", "return VAR_4\n" ]
[ "def decorator(view_func):...\n", "_methods = [m.upper() for m in methods]\n", "for r, m, v in itertools.product(roles, _methods, [view_func.__name__]):\n", "self.before_acl.append((r, m, v, with_children))\n", "return view_func\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_3(VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = VAR_17.lower().strip('\\x00\\x1a \\n\\r\\t')\n", "for scheme in VAR_11:\n", "if re.sub('[^A-Za-z0-9\\\\/:]+', '', VAR_22).startswith(scheme):\n", "return VAR_19(VAR_17, VAR_15=True, VAR_16=False)\n", "return ''\n" ]
[ "def escape_link(url):...\n", "\"\"\"docstring\"\"\"\n", "lower_url = url.lower().strip('\\x00\\x1a \\n\\r\\t')\n", "for scheme in _scheme_blacklist:\n", "if re.sub('[^A-Za-z0-9\\\\/:]+', '', lower_url).startswith(scheme):\n", "return escape(url, quote=True, smart_amp=False)\n", "return ''\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(self):...\n", "self.client.get('/logout/')\n" ]
[ "def logout(self):...\n", "self.client.get('/logout/')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@wrapt.decorator...\n", "VAR_18.update(dict(zip(VAR_15.__code__.co_varnames, VAR_17)))\n", "FUNC_0(VAR_18['searchfield'])\n", "VAR_18['start'] = cint(VAR_18['start'])\n", "VAR_18['page_len'] = cint(VAR_18['page_len'])\n", "if VAR_18['doctype'] and not VAR_20.db.exists('DocType', VAR_18['doctype']):\n", ...
[ "@wrapt.decorator...\n", "kwargs.update(dict(zip(fn.__code__.co_varnames, args)))\n", "sanitize_searchfield(kwargs['searchfield'])\n", "kwargs['start'] = cint(kwargs['start'])\n", "kwargs['page_len'] = cint(kwargs['page_len'])\n", "if kwargs['doctype'] and not frappe.db.exists('DocType', kwargs['doctype']...
[ 0, 0, 0, 0, 0, 0, 0, 2 ]
[ "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(self) ->None:...\n", "VAR_16 = self.package_dir / 'models'\n", "VAR_16.mkdir()\n", "VAR_17 = VAR_16 / '__init__.py'\n", "VAR_18 = []\n", "VAR_19 = self.env.get_template('types.py')\n", "VAR_20 = VAR_16 / 'types.py'\n", "VAR_20.write_text(VAR_19.render())\n", "VAR_21 = self.env.get_templ...
[ "def _build_models(self) ->None:...\n", "models_dir = self.package_dir / 'models'\n", "models_dir.mkdir()\n", "models_init = models_dir / '__init__.py'\n", "imports = []\n", "types_template = self.env.get_template('types.py')\n", "types_path = models_dir / 'types.py'\n", "types_path.write_text(types_t...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Expr'", "For", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_58, *VAR_6, **VAR_7):...\n", "self.project = VAR_58\n", "super().__init__(*VAR_6, **kwargs)\n", "self.fields['token'].queryset = VAR_58.projecttoken_set.all()\n" ]
[ "def __init__(self, project, *args, **kwargs):...\n", "self.project = project\n", "super().__init__(*args, **kwargs)\n", "self.fields['token'].queryset = project.projecttoken_set.all()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'" ]
[ "@VAR_20.whitelist()...\n", "VAR_9 = cint(VAR_9)\n", "if isinstance(VAR_5, string_types):\n", "VAR_5 = json.loads(VAR_5)\n", "if VAR_1:\n", "FUNC_0(VAR_1)\n", "if not VAR_1:\n", "VAR_1 = 'name'\n", "VAR_21 = VAR_20.get_hooks().standard_queries or {}\n", "if VAR_4 and VAR_4.split()[0].lower() != 's...
[ "@frappe.whitelist()...\n", "start = cint(start)\n", "if isinstance(filters, string_types):\n", "filters = json.loads(filters)\n", "if searchfield:\n", "sanitize_searchfield(searchfield)\n", "if not searchfield:\n", "searchfield = 'name'\n", "standard_queries = frappe.get_hooks().standard_queries or...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Return'", "Condition", "Expr'", "Condition", "Assign'", "Condition", "Assign...
[ "def FUNC_2(VAR_0, VAR_1: FlaskClient):...\n", "VAR_5 = VAR_1.get('/bookmarks/new')\n", "assert VAR_5.status_code == 200\n" ]
[ "def test_get_new_bookmark(test_app, client: FlaskClient):...\n", "response = client.get('/bookmarks/new')\n", "assert response.status_code == 200\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'" ]
[ "async def FUNC_30(self, VAR_1: EventBase, VAR_2: Optional[Iterable[...\n", "\"\"\"docstring\"\"\"\n", "if VAR_33 or VAR_1.internal_metadata.is_outlier():\n", "return\n", "VAR_109 = await self.store.get_latest_event_ids_in_room(VAR_1.room_id)\n", "VAR_110 = set(VAR_109)\n", "VAR_111 = set(VAR_1.prev_eve...
[ "async def _check_for_soft_fail(self, event: EventBase, state: Optional[...\n", "\"\"\"docstring\"\"\"\n", "if backfilled or event.internal_metadata.is_outlier():\n", "return\n", "extrem_ids_list = await self.store.get_latest_event_ids_in_room(event.room_id)\n", "extrem_ids = set(extrem_ids_list)\n", "p...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", ...
[ "\"\"\"Tests for SavedModelCLI tool.\"\"\"\n", "import contextlib\n", "import os\n", "import pickle\n", "import platform\n", "import shutil\n", "import sys\n", "from absl.testing import parameterized\n", "import numpy as np\n", "from six import StringIO\n", "from tensorflow.core.example import e...
[ "\"\"\"Tests for SavedModelCLI tool.\"\"\"\n", "import contextlib\n", "import os\n", "import pickle\n", "import platform\n", "import shutil\n", "import sys\n", "from absl.testing import parameterized\n", "import numpy as np\n", "from six import StringIO\n", "from tensorflow.core.example import e...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFro...
[ "@FUNC_0...\n", "return EventCreationHandler(self)\n" ]
[ "@cache_in_self...\n", "return EventCreationHandler(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_25(self):...\n", "VAR_5, VAR_15 = self._test_confirm_start()\n", "VAR_15 = VAR_15.replace('/reset/', '/reset/custom/')\n", "VAR_3 = self.client.post(VAR_15, {'new_password1': 'anewpassword',\n 'new_password2': 'anewpassword'})\n", "self.assertEqual(VAR_3.status_code, 302)\n", "self.assertURLE...
[ "def test_confirm_redirect_custom(self):...\n", "url, path = self._test_confirm_start()\n", "path = path.replace('/reset/', '/reset/custom/')\n", "response = self.client.post(path, {'new_password1': 'anewpassword',\n 'new_password2': 'anewpassword'})\n", "self.assertEqual(response.status_code, 302)\n", ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_114():...\n", "if VAR_32:\n", "if VAR_19.rollback_on_exception:\n", "VAR_12.rollback()\n", "import inspect\n", "if inspect.isclass(VAR_32) and issubclass(VAR_32, Exception):\n" ]
[ "def _raise_exception():...\n", "if raise_exception:\n", "if flags.rollback_on_exception:\n", "db.rollback()\n", "import inspect\n", "if inspect.isclass(raise_exception) and issubclass(raise_exception, Exception):\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Import'", "Condition" ]
[ "def FUNC_43(self):...\n", "if self.user and self.user.email is not None:\n", "return self.user.email\n", "return self.email\n" ]
[ "def _email_address(self):...\n", "if self.user and self.user.email is not None:\n", "return self.user.email\n", "return self.email\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_2: IReactorCore, VAR_3: Optional[...\n", "self._reactor = VAR_2\n", "self._parsed_uri = VAR_12\n", "if VAR_3 is None:\n", "self._tls_options = None\n", "self._tls_options = VAR_3.get_options(self._parsed_uri.host)\n", "self._srv_resolver = VAR_11\n" ]
[ "def __init__(self, reactor: IReactorCore, tls_client_options_factory:...\n", "self._reactor = reactor\n", "self._parsed_uri = parsed_uri\n", "if tls_client_options_factory is None:\n", "self._tls_options = None\n", "self._tls_options = tls_client_options_factory.get_options(self._parsed_uri\n .host)\n...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_29():...\n", "VAR_58 = Config(os.path.join(request.folder, 'settings.cfg'), section=\n 'editor_sessions', default_values={})\n", "VAR_57 = VAR_58.read()\n", "if request.vars.session_name and request.vars.files:\n", "VAR_135 = request.vars.session_name\n", "return VAR_43.render('default/editor...
[ "def editor_sessions():...\n", "config = Config(os.path.join(request.folder, 'settings.cfg'), section=\n 'editor_sessions', default_values={})\n", "preferences = config.read()\n", "if request.vars.session_name and request.vars.files:\n", "session_name = request.vars.session_name\n", "return response.re...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_14(self):...\n", "self.assertFormfield(models.Band, 'members', widgets.ManyToManyRawIdWidget,\n raw_id_fields=['members'])\n" ]
[ "def testRawIDManyTOMany(self):...\n", "self.assertFormfield(models.Band, 'members', widgets.ManyToManyRawIdWidget,\n raw_id_fields=['members'])\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1(self):...\n", "if 'ping' not in current_app.config.get('ACTIVE_PROVIDERS'):\n", "return 'Ping is not enabled in the config. See the ACTIVE_PROVIDERS section.', 404\n", "VAR_6 = ('clientId,{client_id},redirectUri,{redirectUri},return_to,{return_to}'\n .format(VAR_8=current_app.config.get('PING_...
[ "def post(self):...\n", "if 'ping' not in current_app.config.get('ACTIVE_PROVIDERS'):\n", "return 'Ping is not enabled in the config. See the ACTIVE_PROVIDERS section.', 404\n", "default_state = (\n 'clientId,{client_id},redirectUri,{redirectUri},return_to,{return_to}'.\n format(client_id=current_app.c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Co...