lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "@VAR_1.get('/', response_model=List[AModel], operation_id='getUserList')...\n", "\"\"\"docstring\"\"\"\n", "return\n" ]
[ "@test_router.get('/', response_model=List[AModel], operation_id='getUserList')...\n", "\"\"\"docstring\"\"\"\n", "return\n" ]
[ 5, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_42():...\n", "\"\"\"docstring\"\"\"\n", "import operator\n", "import os\n", "import hashlib\n", "VAR_3 = FUNC_5()\n", "if is_gae:\n", "VAR_161 = 'dbold' if 'old' in (request.args(1) or '') else 'dbnew'\n", "VAR_161 = request.args(1) or 'new'\n", "VAR_101 = {}\n", "VAR_101['status'] = F...
[ "def errors():...\n", "\"\"\"docstring\"\"\"\n", "import operator\n", "import os\n", "import hashlib\n", "app = get_app()\n", "if is_gae:\n", "method = 'dbold' if 'old' in (request.args(1) or '') else 'dbnew'\n", "method = request.args(1) or 'new'\n", "db_ready = {}\n", "db_ready['status'] = get...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Import'", "Import'", "Import'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "For", "Assign'", "Assign'", "For", "Condition...
[ "@default('client_id')...\n", "return os.getenv('GITHUB_CLIENT_ID', '')\n" ]
[ "@default('client_id')...\n", "return os.getenv('GITHUB_CLIENT_ID', '')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def __init__(self, VAR_6=None, VAR_7=None):...\n", "self.type = VAR_6\n", "if self.type not in ('readonly', 'latest'):\n", "self.fallback = VAR_7\n" ]
[ "def __init__(self, type=None, fallback=None):...\n", "self.type = type\n", "if self.type not in ('readonly', 'latest'):\n", "self.fallback = fallback\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_14(self, VAR_0, VAR_1, VAR_2):...\n", "self.federation_sender = VAR_2.get_federation_sender()\n", "self.event_builder_factory = VAR_2.get_event_builder_factory()\n", "self.federation_handler = VAR_2.get_federation_handler()\n", "self.presence_handler = VAR_2.get_presence_handler()\n", "self.stor...
[ "def prepare(self, reactor, clock, hs):...\n", "self.federation_sender = hs.get_federation_sender()\n", "self.event_builder_factory = hs.get_event_builder_factory()\n", "self.federation_handler = hs.get_federation_handler()\n", "self.presence_handler = hs.get_presence_handler()\n", "self.store = hs.get_da...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_50(self, VAR_112=VAR_3, VAR_140=VAR_3, VAR_136=VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "self._reset_two_factor_auth(VAR_263.session)\n", "if VAR_112 is VAR_3:\n", "VAR_112 = self.get_vars_next() or self.settings.logout_next\n", "if VAR_140 is VAR_3:\n", "VAR_140 = self.settings.logout_onlogo...
[ "def logout(self, next=DEFAULT, onlogout=DEFAULT, log=DEFAULT):...\n", "\"\"\"docstring\"\"\"\n", "self._reset_two_factor_auth(current.session)\n", "if next is DEFAULT:\n", "next = self.get_vars_next() or self.settings.logout_next\n", "if onlogout is DEFAULT:\n", "onlogout = self.settings.logout_onlogou...
[ 0, 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", "Expr'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Condition", "Expr'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Expr'", "Assign'", "Conditi...
[ "def FUNC_2(self, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = False\n", "if VAR_5.session.get('callback') is None:\n", "VAR_5.session['callback'] = dict()\n", "if VAR_5.session.get('shares') is None:\n", "VAR_11 = True\n", "VAR_5.session['shares'] = dict()\n", "if VAR_11:\n", "VAR_11 = Tru...
[ "def prepare_session(self, request):...\n", "\"\"\"docstring\"\"\"\n", "changes = False\n", "if request.session.get('callback') is None:\n", "request.session['callback'] = dict()\n", "if request.session.get('shares') is None:\n", "changes = True\n", "request.session['shares'] = dict()\n", "if change...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_25(self):...\n", "self.assert_expected(self.folder.t, 'BooleanAttributes.html')\n" ]
[ "def testBooleanAttributes(self):...\n", "self.assert_expected(self.folder.t, 'BooleanAttributes.html')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "async def FUNC_6(self, VAR_14: str, VAR_15: str, VAR_16: str, VAR_17: str...\n", "\"\"\"docstring\"\"\"\n", "VAR_36 = {'token': VAR_15, 'client_secret': VAR_16, 'sid': VAR_17}\n", "VAR_37 = (self.hs.config.public_baseurl + \n '_matrix/client/unstable/add_threepid/email/submit_token?%s' % urllib.\n pars...
[ "async def send_add_threepid_mail(self, email_address: str, token: str,...\n", "\"\"\"docstring\"\"\"\n", "params = {'token': token, 'client_secret': client_secret, 'sid': sid}\n", "link = (self.hs.config.public_baseurl + \n '_matrix/client/unstable/add_threepid/email/submit_token?%s' % urllib.\n parse....
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_4, VAR_5, VAR_6):...\n", "VAR_16 = self.get_success(self.handler.on_make_join_request(VAR_4, VAR_6,\n VAR_5))\n", "VAR_16.signatures[VAR_4] = {'x': 'y'}\n", "VAR_11 = run_in_background(self.handler.on_send_join_request, VAR_4, VAR_16)\n", "self.get_success(VAR_11)\n", "VAR_21 = se...
[ "def _build_and_send_join_event(self, other_server, other_user, room_id):...\n", "join_event = self.get_success(self.handler.on_make_join_request(\n other_server, room_id, other_user))\n", "join_event.signatures[other_server] = {'x': 'y'}\n", "d = run_in_background(self.handler.on_send_join_request, other_...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2, VAR_3 = qutescheme.data_for_url(VAR_0.url())\n", "VAR_5 = 'No handler found for {}!'.format(VAR_0.url().toDisplayString())\n", "return networkreply.FixedDataNetworkReply(VAR_0, VAR_3, VAR_2)\n", "return networkreply.ErrorNetworkReply(VAR_0, VAR...
[ "def handler(request):...\n", "\"\"\"docstring\"\"\"\n", "mimetype, data = qutescheme.data_for_url(request.url())\n", "errorstr = 'No handler found for {}!'.format(request.url().toDisplayString())\n", "return networkreply.FixedDataNetworkReply(request, data, mimetype)\n", "return networkreply.ErrorNetwork...
[ 0, 0, 3, 3, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_26(self):...\n", "VAR_29 = coreapi.Document(VAR_5='', title='Example API', content={'animals':\n {'dog': {'vet': {'list': coreapi.Link(url='/animals/dog/{id}/vet',\n action='get', fields=[coreapi.Field('id', required=True, location=\n 'path', schema=coreschema.String())])}, 'read': coreapi.Link...
[ "def test_multiple_nested_routes(self):...\n", "schema = coreapi.Document(url='', title='Example API', content={'animals':\n {'dog': {'vet': {'list': coreapi.Link(url='/animals/dog/{id}/vet',\n action='get', fields=[coreapi.Field('id', required=True, location=\n 'path', schema=coreschema.String())])}, 'r...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assert'", "Assert'", "Assert'", "Assert'", "Assert'" ]
[ "def FUNC_7():...\n", "\"\"\"docstring\"\"\"\n", "session.forget()\n", "session._unlock(VAR_43)\n", "VAR_24, VAR_25 = check_new_version(request.env.web2py_version,\n WEB2PY_VERSION_URL)\n", "if VAR_24 in (-1, -2):\n", "return A(T('Unable to check for upgrades'), _href=WEB2PY_URL)\n", "if not VAR_24...
[ "def check_version():...\n", "\"\"\"docstring\"\"\"\n", "session.forget()\n", "session._unlock(response)\n", "new_version, version = check_new_version(request.env.web2py_version,\n WEB2PY_VERSION_URL)\n", "if new_version in (-1, -2):\n", "return A(T('Unable to check for upgrades'), _href=WEB2PY_URL)\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Assign'", "Condition", "Return'", "Condition", "Return'", "For", "Return'", "Return'" ]
[ "@login_required...\n", "\"\"\"docstring\"\"\"\n", "if VAR_7 is None:\n", "VAR_18 = None\n", "if VAR_8 is None:\n", "VAR_5 = {}\n", "VAR_18 = get_project(VAR_6, VAR_7)\n", "VAR_18 = get_component(VAR_6, VAR_7, VAR_8)\n", "VAR_12 = ReportsForm(VAR_6.POST)\n", "VAR_5 = {'project': VAR_18}\n", "VAR...
[ "@login_required...\n", "\"\"\"docstring\"\"\"\n", "if project is None:\n", "obj = None\n", "if component is None:\n", "kwargs = {}\n", "obj = get_project(request, project)\n", "obj = get_component(request, project, component)\n", "form = ReportsForm(request.POST)\n", "kwargs = {'project': obj}\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, 2, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Return'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assi...
[ "def FUNC_25(VAR_18):...\n", "return VAR_18 is not None and bool(VAR_18['wizard']['order'])\n" ]
[ "def wizard_active(templates):...\n", "return templates is not None and bool(templates['wizard']['order'])\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_25.whitelist(allow_guest=True)...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = VAR_25.get_doc(VAR_9, VAR_10)\n", "if getattr(VAR_14, VAR_11, VAR_25._dict()).is_whitelisted:\n", "VAR_25.call(getattr(VAR_14, VAR_11), **frappe.local.form_dict)\n", "VAR_25.throw(_('Not permitted'), VAR_25.PermissionError)\n...
[ "@frappe.whitelist(allow_guest=True)...\n", "\"\"\"docstring\"\"\"\n", "doc = frappe.get_doc(doctype, name)\n", "if getattr(doc, custom_method, frappe._dict()).is_whitelisted:\n", "frappe.call(getattr(doc, custom_method), **frappe.local.form_dict)\n", "frappe.throw(_('Not permitted'), frappe.PermissionErr...
[ 2, 0, 2, 2, 2, 2 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_120(self, VAR_201):...\n", "VAR_324 = []\n", "VAR_327 = SPAN()\n", "VAR_327.append(A(VAR_201, _href=URL()))\n", "for arg in self.args:\n", "VAR_327.append('/')\n", "return VAR_327\n", "VAR_324.append(arg)\n", "VAR_327.append(A(arg, _href=URL(args='/'.join(path))))\n" ]
[ "def breadcrumbs(self, basename):...\n", "path = []\n", "span = SPAN()\n", "span.append(A(basename, _href=URL()))\n", "for arg in self.args:\n", "span.append('/')\n", "return span\n", "path.append(arg)\n", "span.append(A(arg, _href=URL(args='/'.join(path))))\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "For", "Expr'", "Return'", "Expr'", "Expr'" ]
[ "@parameterized.named_parameters(('non_tfrt', False))...\n", "self.parser = saved_model_cli.create_parser()\n", "VAR_10 = test.test_src_dir_path(VAR_0)\n", "VAR_45 = np.array([[1], [2]])\n", "VAR_46 = np.zeros((6, 3))\n", "VAR_32 = os.path.join(test.get_temp_dir(), 'testRunCommandNewOutdir_inputs.npz'\n ...
[ "@parameterized.named_parameters(('non_tfrt', False))...\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 'testRunCommandNewO...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_86(VAR_71):...\n", "for VAR_433 in ['Dataset', 'Image', 'Plate']:\n", "VAR_187 = VAR_71.POST.get(VAR_433, None)\n", "if VAR_187 is not None:\n", "for o in list(VAR_5.getObjects(VAR_433, VAR_187.split(','))):\n", "return o.getDetails().owner.id.val\n" ]
[ "def getObjectOwnerId(r):...\n", "for t in ['Dataset', 'Image', 'Plate']:\n", "ids = r.POST.get(t, None)\n", "if ids is not None:\n", "for o in list(conn.getObjects(t, ids.split(','))):\n", "return o.getDetails().owner.id.val\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Assign'", "Condition", "For", "Return'" ]
[ "def FUNC_6():...\n", "VAR_26 = mysql.connector.connect(user=DB_USER, password=DB_PASSWORD, host=\n DB_HOST, database=DB_DBNAME, port=DB_PORT)\n", "VAR_27 = VAR_26.cursor()\n", "VAR_27.execute(VAR_20, VAR_22)\n", "yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n", "if VAR_1:\n", "yield '<?xml...
[ "def generate():...\n", "cnx = mysql.connector.connect(user=DB_USER, password=DB_PASSWORD, host=\n DB_HOST, database=DB_DBNAME, port=DB_PORT)\n", "cursor = cnx.cursor()\n", "cursor.execute(query, substitutes)\n", "yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n", "if STYLE:\n", "yield '<?xml...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "For", "Expr'", "Expr'", "Expr'" ]
[ "async def FUNC_28(VAR_40, VAR_41, VAR_48, **VAR_3):...\n", "self.assertEqual(VAR_40, self.mock_perspective_server.server_name)\n", "self.assertEqual(VAR_41, '/_matrix/key/v2/query')\n", "VAR_51 = VAR_48['server_keys']\n", "self.assertEqual(list(VAR_51[VAR_14].keys()), [VAR_15])\n", "return {'server_keys'...
[ "async def post_json(destination, path, data, **kwargs):...\n", "self.assertEqual(destination, self.mock_perspective_server.server_name)\n", "self.assertEqual(path, '/_matrix/key/v2/query')\n", "q = data['server_keys']\n", "self.assertEqual(list(q[expected_server_name].keys()), [expected_key_id])\n", "ret...
[ 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "async def FUNC_6(VAR_6):...\n", "" ]
[ "async def middleware_handler(request):...\n", "" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Condition" ]
[ "def FUNC_0(VAR_6=None, VAR_7=None):...\n", "if VAR_6 is None:\n", "VAR_6 = request.url_root\n", "VAR_35 = not settings().getBoolean(['devel', 'cache', 'preemptive']\n ) or VAR_6 in settings().get(['server', 'preemptiveCache', 'exceptions']\n ) or not (VAR_6.startswith('http://') or VAR_6.startswith('ht...
[ "def _preemptive_unless(base_url=None, additional_unless=None):...\n", "if base_url is None:\n", "base_url = request.url_root\n", "disabled_for_root = not settings().getBoolean(['devel', 'cache', 'preemptive']\n ) or base_url in settings().get(['server', 'preemptiveCache', 'exceptions']\n ) or not (base...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_17(self, VAR_0):...\n", "from openapi_python_client import Project\n", "VAR_8 = Project(VAR_3=mocker.MagicMock(title='My Test API'))\n", "VAR_8.project_dir = VAR_0.MagicMock()\n", "VAR_8.project_dir.mkdir.side_effect = FileExistsError\n", "VAR_11 = VAR_8.build()\n", "VAR_8.project_dir.mkdir.as...
[ "def test_build_file_exists(self, mocker):...\n", "from openapi_python_client import Project\n", "project = Project(openapi=mocker.MagicMock(title='My Test API'))\n", "project.project_dir = mocker.MagicMock()\n", "project.project_dir.mkdir.side_effect = FileExistsError\n", "result = project.build()\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assert'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if VAR_5.operationId is None:\n", "return ParseError(VAR_5=data, detail=\n 'Path operations with operationId are not yet supported')\n", "VAR_7 = CLASS_2(VAR_8=path, VAR_9=method, description=data.description,\n VAR_11=data.operationId, requires_securi...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if data.operationId is None:\n", "return ParseError(data=data, detail=\n 'Path operations with operationId are not yet supported')\n", "endpoint = Endpoint(path=path, method=method, description=data.description,\n name=data.operationId, requires_securi...
[ 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Return'" ]
[ "@VAR_0.route('/plugin/<plugin_name>')...\n", "\"\"\"docstring\"\"\"\n", "VAR_111 = FUNC_58(f'/internal/plugins/{VAR_12}', 'get')\n", "flash(str(err), 'danger')\n", "return render_template('plugin.html', title=f'{plugin_name}', VAR_111=\n plugin_info)\n", "return redirect(url_for('plugins_page'))\n" ]
[ "@gui.route('/plugin/<plugin_name>')...\n", "\"\"\"docstring\"\"\"\n", "plugin_info = query_internal_api(f'/internal/plugins/{plugin_name}', 'get')\n", "flash(str(err), 'danger')\n", "return render_template('plugin.html', title=f'{plugin_name}', plugin_info=\n plugin_info)\n", "return redirect(url_for(...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Expr'", "Return'", "Return'" ]
[ "@VAR_7.route('/id/<path:object_path>')...\n", "VAR_28 = Headers([('Content-Type', 'text/xml')])\n", "return Response(FUNC_7(VAR_19=object_path), '200 OK', VAR_28=headers)\n" ]
[ "@scope_blueprint.route('/id/<path:object_path>')...\n", "headers = Headers([('Content-Type', 'text/xml')])\n", "return Response(_get_object_element(object_path=object_path), '200 OK',\n headers=headers)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Return'" ]
[ "def FUNC_37(self, VAR_44):...\n", "VAR_14 = VAR_44.group(2) or VAR_44.group(1)\n", "VAR_14 = self.output(VAR_14)\n", "return self.renderer.emphasis(VAR_14)\n" ]
[ "def output_emphasis(self, m):...\n", "text = m.group(2) or m.group(1)\n", "text = self.output(text)\n", "return self.renderer.emphasis(text)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@VAR_2.route('/get_series_json', methods=['GET'])...\n", "return calibre_db.get_typeahead(db.Series, request.args.get('q'))\n" ]
[ "@web.route('/get_series_json', methods=['GET'])...\n", "return calibre_db.get_typeahead(db.Series, request.args.get('q'))\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_12(VAR_4):...\n", "if not self._check_permission([VAR_0], VAR_1, VAR_4):\n", "if callable(VAR_11):\n", "return VAR_4\n", "VAR_11()\n", "self._deny_hook()\n" ]
[ "def decorator(view_func):...\n", "if not self._check_permission([role], method, view_func):\n", "if callable(callback):\n", "return view_func\n", "callback()\n", "self._deny_hook()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_3(self):...\n", "super().tearDown()\n", "SecurityManager.setSecurityPolicy(self.oldPolicy)\n", "noSecurityManager()\n" ]
[ "def tearDown(self):...\n", "super().tearDown()\n", "SecurityManager.setSecurityPolicy(self.oldPolicy)\n", "noSecurityManager()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_3(VAR_0):...\n", "VAR_0.DEBUG = True\n", "VAR_6 = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentKwargs' parent=view key='blob'\"\n )\n", "VAR_7 = unicorn(None, VAR_6)\n", "VAR_10 = CLASS_0(component_name='test', component_id='asdf')\n", "VAR_8 = {'v...
[ "def test_unicorn_render_parent_with_key(settings):...\n", "settings.DEBUG = True\n", "token = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentKwargs' parent=view key='blob'\"\n )\n", "unicorn_node = unicorn(None, token)\n", "view = FakeComponentParent(component_...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assert'" ]
[ "@VAR_7.route('/meta/<path:object_path>')...\n", "VAR_34 = FUNC_10(VAR_19)\n", "VAR_35 = dict()\n", "VAR_35['_gt_label'] = VAR_34.split('/')[-2]\n", "return jsonify(VAR_35)\n" ]
[ "@scope_blueprint.route('/meta/<path:object_path>')...\n", "path = _get_obj_absolute_path(object_path)\n", "attrs = dict()\n", "attrs['_gt_label'] = path.split('/')[-2]\n", "return jsonify(attrs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "def FUNC_86(VAR_123, VAR_86, VAR_124):...\n", "\"\"\"docstring\"\"\"\n", "VAR_185 = HttpResponse(content_type='text/csv')\n", "VAR_185['Content-Disposition'] = 'attachment; filena...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "def csv_response(filename, header, rows):...\n", "\"\"\"docstring\"\"\"\n", "response = HttpResponse(content_type='text/csv')\n", "response['Content-Disposition'] = 'attachm...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "For", "Assign'", "Return'", "Expr'" ]
[ "\"\"\"QtWebKit specific qute://* handlers and glue code.\"\"\"\n", "import mimetypes\n", "from PyQt5.QtNetwork import QNetworkReply\n", "from qutebrowser.browser import pdfjs, qutescheme\n", "from qutebrowser.browser.webkit.network import networkreply\n", "from qutebrowser.utils import log, usertypes, qt...
[ "\"\"\"QtWebKit specific qute://* handlers and glue code.\"\"\"\n", "import mimetypes\n", "from PyQt5.QtNetwork import QNetworkReply\n", "from qutebrowser.browser import pdfjs, qutescheme\n", "from qutebrowser.browser.webkit.network import networkreply\n", "from qutebrowser.utils import log, usertypes, qt...
[ 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0 ]
[ "Expr'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_0(VAR_2: T) ->VAR_1:...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_2.__name__.startswith('get_'):\n", "VAR_3 = VAR_2.__name__[len('get'):]\n", "VAR_4 = [False]\n", "@functools.wraps(VAR_2)...\n", "return getattr(self, VAR_3)\n", "if VAR_4[0]:\n", "VAR_4[0] = True\n", "VAR_18 = VAR_2(self...
[ "def cache_in_self(builder: T) ->T:...\n", "\"\"\"docstring\"\"\"\n", "if not builder.__name__.startswith('get_'):\n", "depname = builder.__name__[len('get'):]\n", "building = [False]\n", "@functools.wraps(builder)...\n", "return getattr(self, depname)\n", "if building[0]:\n", "building[0] = True\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_13(self, VAR_5, VAR_39):...\n", "if self.force or not os.path.exists(VAR_39):\n", "return True\n", "VAR_50 = FUNC_6(VAR_39)\n", "for source in self.sources(VAR_5):\n", "if FUNC_6(source) > VAR_50:\n", "return False\n", "print(source, VAR_39)\n", "return True\n" ]
[ "def should_run(self, name, target):...\n", "if self.force or not os.path.exists(target):\n", "return True\n", "target_mtime = mtime(target)\n", "for source in self.sources(name):\n", "if mtime(source) > target_mtime:\n", "return False\n", "print(source, target)\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Return'", "Assign'", "For", "Condition", "Return'", "Expr'", "Return'" ]
[ "def __call__(self, VAR_14, VAR_43=None):...\n", "return self.parse(VAR_14, VAR_43)\n" ]
[ "def __call__(self, text, rules=None):...\n", "return self.parse(text, rules)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_138(self):...\n", "return True\n" ]
[ "def can_search(self):...\n", "return True\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "async def FUNC_4(self, VAR_14: str, VAR_15: str, VAR_16: str, VAR_17: str...\n", "\"\"\"docstring\"\"\"\n", "VAR_36 = {'token': VAR_15, 'client_secret': VAR_16, 'sid': VAR_17}\n", "VAR_37 = (self.hs.config.public_baseurl + \n '_synapse/client/password_reset/email/submit_token?%s' % urllib.parse.\n urle...
[ "async def send_password_reset_mail(self, email_address: str, token: str,...\n", "\"\"\"docstring\"\"\"\n", "params = {'token': token, 'client_secret': client_secret, 'sid': sid}\n", "link = (self.hs.config.public_baseurl + \n '_synapse/client/password_reset/email/submit_token?%s' % urllib.parse.\n urle...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_55(VAR_118):...\n", "\"\"\"docstring\"\"\"\n", "return importlib.import_module(VAR_118)\n" ]
[ "def get_module(modulename):...\n", "\"\"\"docstring\"\"\"\n", "return importlib.import_module(modulename)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __iter__(self):...\n", "if self.field.empty_label is not None:\n", "yield '', self.field.empty_label\n", "for VAR_55 in self.queryset:\n", "yield self.choice(VAR_55)\n" ]
[ "def __iter__(self):...\n", "if self.field.empty_label is not None:\n", "yield '', self.field.empty_label\n", "for obj in self.queryset:\n", "yield self.choice(obj)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "For", "Expr'" ]
[ "@VAR_0.route('/jobs/<int:job_id>/edit', methods=['GET', 'POST'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_57 = os.path.join(VAR_0.config['UPLOAD_FOLDER'], 'loadfile.txt')\n", "VAR_56 = os.path.join(VAR_0.config['UPLOAD_FOLDER'], 'export.txt')\n", "if request.method == 'POST':\n", "VAR_99 = request.form.get...
[ "@gui.route('/jobs/<int:job_id>/edit', methods=['GET', 'POST'])...\n", "\"\"\"docstring\"\"\"\n", "loadfile_path = os.path.join(gui.config['UPLOAD_FOLDER'], 'loadfile.txt')\n", "export_path = os.path.join(gui.config['UPLOAD_FOLDER'], 'export.txt')\n", "if request.method == 'POST':\n", "edited_job_info = r...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'", "Expr'", "Assign'", "Return'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_34(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_61 = False\n", "self._action = 'save'\n", "if not self.get('__islocal'):\n", "if self.meta.issingle:\n", "self.check_docstatus_transition(0)\n", "VAR_100 = frappe.db.sql(\n \"\"\"select value from tabSingles\n\t\t\t\t\twhere doctype=%s and ...
[ "def check_if_latest(self):...\n", "\"\"\"docstring\"\"\"\n", "conflict = False\n", "self._action = 'save'\n", "if not self.get('__islocal'):\n", "if self.meta.issingle:\n", "self.check_docstatus_transition(0)\n", "modified = frappe.db.sql(\n \"\"\"select value from tabSingles\n\t\t\t\t\twhere doct...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_2(VAR_4: List[str]):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_6():...\n", "yield '<!-- CLICK_WEB START HEADER -->'\n", "yield '<div class=\"command-line\">Executing: {}</div>'.format('/'.join(VAR_4))\n", "yield '<!-- CLICK_WEB END HEADER -->'\n", "VAR_10 = '\\n'.join(FUNC_6())\n", "return...
[ "def _create_cmd_header(commands: List[str]):...\n", "\"\"\"docstring\"\"\"\n", "def generate():...\n", "yield '<!-- CLICK_WEB START HEADER -->'\n", "yield '<div class=\"command-line\">Executing: {}</div>'.format('/'.join(commands)\n )\n", "yield '<!-- CLICK_WEB END HEADER -->'\n", "html_str = '\\n'....
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Expr'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "@VAR_2.route('/get_series_json', methods=['GET'])...\n", "return calibre_db.get_typeahead(db.Series, request.args.get('q'))\n" ]
[ "@web.route('/get_series_json', methods=['GET'])...\n", "return calibre_db.get_typeahead(db.Series, request.args.get('q'))\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "async def FUNC_11(VAR_6, VAR_7, VAR_20):...\n", "self.assertEqual(VAR_6, self.hs.hostname)\n", "self.assertEqual(VAR_7, '/_matrix/key/v2/query')\n", "VAR_10 = FakeChannel(self.site, self.reactor)\n", "VAR_11 = SynapseRequest(VAR_10)\n", "VAR_11.content = BytesIO(encode_canonical_json(VAR_20))\n", "VAR_...
[ "async def post_json(destination, path, data):...\n", "self.assertEqual(destination, self.hs.hostname)\n", "self.assertEqual(path, '/_matrix/key/v2/query')\n", "channel = FakeChannel(self.site, self.reactor)\n", "req = SynapseRequest(channel)\n", "req.content = BytesIO(encode_canonical_json(data))\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_23, *VAR_24, **VAR_25):...\n", "VAR_66 = type(VAR_23)\n", "if isinstance(VAR_23, VAR_72):\n", "VAR_56 = fromstring(VAR_23)\n", "VAR_56 = copy.deepcopy(VAR_23)\n", "FUNC_1(VAR_56, *VAR_24, **kw)\n", "return _transform_result(VAR_66, VAR_56)\n" ]
[ "def autolink_html(html, *args, **kw):...\n", "result_type = type(html)\n", "if isinstance(html, basestring):\n", "doc = fromstring(html)\n", "doc = copy.deepcopy(html)\n", "autolink(doc, *args, **kw)\n", "return _transform_result(result_type, doc)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "import logging\n", "from typing import Any, Callable, List, Optional, Tuple\n", "import attr\n", "from twisted.internet.interfaces import IConsumer, IPullProducer, IReactorTime\n", "from twisted.internet.protocol import Protocol\n", "from twisted.internet.task import LoopingCall\n", "from twisted.web.h...
[ "import logging\n", "from typing import Any, Callable, List, Optional, Tuple\n", "import attr\n", "from twisted.internet.interfaces import IConsumer, IPullProducer, IReactorTime\n", "from twisted.internet.protocol import Protocol\n", "from twisted.internet.task import LoopingCall\n", "from twisted.web.h...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Assi...
[ "async def FUNC_27(VAR_40, VAR_41, **VAR_3):...\n", "self.assertEqual(VAR_40, VAR_34)\n", "self.assertEqual(VAR_41, '/_matrix/key/v2/server/key1')\n", "return VAR_16\n" ]
[ "async def get_json(destination, path, **kwargs):...\n", "self.assertEqual(destination, SERVER_NAME)\n", "self.assertEqual(path, '/_matrix/key/v2/server/key1')\n", "return response\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_9(self, VAR_21):...\n", "VAR_21.password = generate_password_hash(VAR_21.password)\n" ]
[ "def pre_add(self, item):...\n", "item.password = generate_password_hash(item.password)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_12(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_33 = self.reactor.tcpClients\n", "self.assertEqual(len(VAR_33), 1)\n", "VAR_34, VAR_35, VAR_36, VAR_37, VAR_38 = VAR_33.pop(0)\n", "self.assertEqual(VAR_34, 'localhost')\n", "self.assertEqual(VAR_35, 6379)\n", "VAR_39 = VAR_36.buildProtocol(No...
[ "def connect_any_redis_attempts(self):...\n", "\"\"\"docstring\"\"\"\n", "clients = self.reactor.tcpClients\n", "self.assertEqual(len(clients), 1)\n", "host, port, client_factory, _timeout, _bindAddress = clients.pop(0)\n", "self.assertEqual(host, 'localhost')\n", "self.assertEqual(port, 6379)\n", "cl...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_25(self, VAR_13, VAR_14):...\n", "VAR_30 = []\n", "for fieldname, VAR_4 in VAR_13:\n", "VAR_5 = frappe.get_meta(VAR_4)\n", "return VAR_30\n", "if VAR_5.get_field(fieldname):\n", "VAR_41 = VAR_5.get_field(fieldname)\n", "if fieldname == '_aggregate_column':\n", "VAR_30.append(VAR_41)\n", ...
[ "def build_standard_report_columns(self, columns, group_by_args):...\n", "_columns = []\n", "for fieldname, doctype in columns:\n", "meta = frappe.get_meta(doctype)\n", "return _columns\n", "if meta.get_field(fieldname):\n", "field = meta.get_field(fieldname)\n", "if fieldname == '_aggregate_column':\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_57(self, VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "return frappe.db.get_value(self.doctype, self.name, VAR_18)\n" ]
[ "def db_get(self, fieldname):...\n", "\"\"\"docstring\"\"\"\n", "return frappe.db.get_value(self.doctype, self.name, fieldname)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_26(VAR_32, VAR_17):...\n", "if 'btn-upload-cover' in VAR_32.files:\n", "VAR_40 = VAR_32.files['btn-upload-cover']\n", "return None\n", "if VAR_40.filename != '':\n", "if not current_user.role_upload():\n", "abort(403)\n", "VAR_80, VAR_111 = helper.save_cover(VAR_40, VAR_17.path)\n", "if VA...
[ "def upload_cover(request, book):...\n", "if 'btn-upload-cover' in request.files:\n", "requested_file = request.files['btn-upload-cover']\n", "return None\n", "if requested_file.filename != '':\n", "if not current_user.role_upload():\n", "abort(403)\n", "ret, message = helper.save_cover(requested_file...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Return'", "Expr'", "Return'" ]
[ "@require_POST...\n", "\"\"\"docstring\"\"\"\n", "VAR_224 = {}\n", "VAR_225 = ['Project', 'Dataset', 'Image', 'Screen', 'Plate', 'Fileset']\n", "for VAR_215 in VAR_225:\n", "VAR_154 = VAR_2.POST.get(VAR_215, None)\n", "if VAR_27 == 'chgrp':\n", "if VAR_154 is not None:\n", "VAR_332 = getIntOrDefault...
[ "@require_POST...\n", "\"\"\"docstring\"\"\"\n", "targetObjects = {}\n", "dtypes = ['Project', 'Dataset', 'Image', 'Screen', 'Plate', 'Fileset']\n", "for dtype in dtypes:\n", "oids = request.POST.get(dtype, None)\n", "if action == 'chgrp':\n", "if oids is not None:\n", "target_id = getIntOrDefault(r...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "For", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@FUNC_0...\n", "return InsecureInterceptableContextFactory(\n ) if self.config.use_insecure_ssl_client_just_for_testing_do_not_use else RegularPolicyForHTTPS(\n )\n" ]
[ "@cache_in_self...\n", "return InsecureInterceptableContextFactory(\n ) if self.config.use_insecure_ssl_client_just_for_testing_do_not_use else RegularPolicyForHTTPS(\n )\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@log_function...\n", "VAR_2 = FUNC_2('/invite/%s/%s', VAR_6, VAR_7)\n", "VAR_37 = await self.client.put_json(VAR_5=destination, VAR_2=path, VAR_39=\n content, VAR_15=True)\n", "return VAR_37\n" ]
[ "@log_function...\n", "path = _create_v2_path('/invite/%s/%s', room_id, event_id)\n", "response = await self.client.put_json(destination=destination, path=path,\n data=content, ignore_backoff=True)\n", "return response\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_4(VAR_0, VAR_1: FlaskClient):...\n", "VAR_5 = VAR_1.get('/notes/new')\n", "assert VAR_5.status_code == 200\n" ]
[ "def test_get_new_note(test_app, client: FlaskClient):...\n", "response = client.get('/notes/new')\n", "assert response.status_code == 200\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'" ]
[ "@VAR_0.simple_tag...\n", "return VAR_8.to_html()\n" ]
[ "@register.simple_tag...\n", "return pager.to_html()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "import tornado.ioloop\n", "import tornado.web\n", "import os\n", "import json\n", "import sys\n", "import rtxcomplete\n", "import traceback\n", "VAR_0 = os.path.dirname(os.path.abspath(__file__))\n", "rtxcomplete.load()\n", "def FUNC_2(self, VAR_1, VAR_2=None):...\n", "VAR_8 = self.get_argument...
[ "import tornado.ioloop\n", "import tornado.web\n", "import os\n", "import json\n", "import sys\n", "import rtxcomplete\n", "import traceback\n", "root = os.path.dirname(os.path.abspath(__file__))\n", "rtxcomplete.load()\n", "def get(self, arg, word=None):...\n", "limit = self.get_argument('limit...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Fu...
[ "async def FUNC_12(self, VAR_2, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_31 = {}\n", "for requested_key_id in VAR_6:\n", "if requested_key_id in VAR_31:\n", "return VAR_31\n", "VAR_39 = self.clock.time_msec()\n", "VAR_21 = await self.client.get_json(destination=server_name, path=\n '/_matrix/...
[ "async def get_server_verify_key_v2_direct(self, server_name, key_ids):...\n", "\"\"\"docstring\"\"\"\n", "keys = {}\n", "for requested_key_id in key_ids:\n", "if requested_key_id in keys:\n", "return keys\n", "time_now_ms = self.clock.time_msec()\n", "response = await self.client.get_json(destination...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'" ]
[ "@VAR_0.route('/token', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_67 = request.json if request.json else {}\n", "VAR_68 = VAR_67.get('username')\n", "VAR_69 = VAR_67.get('password')\n", "if not VAR_68 or not VAR_69:\n", "VAR_70 = {'success': False, 'message': 'Could not verify user.'}\n",...
[ "@gui.route('/token', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "request_json = request.json if request.json else {}\n", "request_user = request_json.get('username')\n", "request_password = request_json.get('password')\n", "if not request_user or not request_password:\n", "response_data = {'su...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_1(VAR_3=VAR_3, VAR_4=True, **VAR_5):...\n", "VAR_24 = CLASS_8()\n", "def FUNC_9(VAR_25):...\n", "return VAR_25[:-1] if VAR_25.endswith('_') else VAR_25\n" ]
[ "def createChameleonEngine(types=types, untrusted=True, **overrides):...\n", "e = ChameleonEngine()\n", "def norm(k):...\n", "return k[:-1] if k.endswith('_') else k\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "FunctionDef'", "Return'" ]
[ "@property...\n", "VAR_38 = self.ip if self.ip else '[all ip addresses on your system]'\n", "return self._url(VAR_38)\n" ]
[ "@property...\n", "ip = self.ip if self.ip else '[all ip addresses on your system]'\n", "return self._url(ip)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Return'" ]
[ "def FUNC_164(VAR_179):...\n", "if isinstance(VAR_179, unicodeT):\n", "return VAR_179.encode('utf8')\n", "if hasattr(VAR_179, 'isoformat'):\n", "return VAR_179.isoformat()[:19].replace('T', ' ')\n", "if VAR_179 is None:\n", "return '<NULL>'\n", "return VAR_179\n" ]
[ "def none_exception(value):...\n", "if isinstance(value, unicodeT):\n", "return value.encode('utf8')\n", "if hasattr(value, 'isoformat'):\n", "return value.isoformat()[:19].replace('T', ' ')\n", "if value is None:\n", "return '<NULL>'\n", "return value\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "For", "Return'", "Condition", "Return'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import argparse\n", "import os\n", "import re\n", "import sys\n", "from absl import app\n", "import numpy as np\n", "import six\n", "from tensorflow.core.example import example_pb2\n", "from tensorflow.core.framework import types_pb2\n", "from tensorflow.python.client im...
[ "\"\"\"Command-line interface to inspect and execute a graph in a SavedModel.\n\nFor detailed usages and examples, please refer to:\nhttps://www.tensorflow.org/guide/saved_model#cli_to_inspect_and_execute_savedmodel\n\n\"\"\"\n", "import argparse\n", "import os\n", "import re\n", "import sys\n", "from abs...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Impor...
[ "def FUNC_2(self, VAR_5, VAR_6, VAR_3=None):...\n", "VAR_31 = self.rel.to\n", "if VAR_3 is None:\n", "VAR_3 = {}\n", "VAR_32 = []\n", "if VAR_31 in self.admin_site._registry:\n", "VAR_38 = reverse('admin:%s_%s_changelist' % (VAR_31._meta.app_label, VAR_31\n ._meta.model_name), current_app=self.admin_...
[ "def render(self, name, value, attrs=None):...\n", "rel_to = self.rel.to\n", "if attrs is None:\n", "attrs = {}\n", "extra = []\n", "if rel_to in self.admin_site._registry:\n", "related_url = reverse('admin:%s_%s_changelist' % (rel_to._meta.app_label,\n rel_to._meta.model_name), current_app=self.admi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'" ]
[ "def __repr__(self):...\n", "return '<Book %r>' % self.id\n" ]
[ "def __repr__(self):...\n", "return '<Book %r>' % self.id\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_20():...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = FUNC_5()\n", "remove_compiled_application(apath(VAR_3, VAR_122=request))\n", "session.flash = T('compiled application removed')\n", "redirect(URL('site'))\n" ]
[ "def remove_compiled_app():...\n", "\"\"\"docstring\"\"\"\n", "app = get_app()\n", "remove_compiled_application(apath(app, r=request))\n", "session.flash = T('compiled application removed')\n", "redirect(URL('site'))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_9(self, VAR_3, VAR_4, VAR_5):...\n", "self.requester = self.register_user('requester', 'pass')\n", "self.requester_tok = self.login('requester', 'pass')\n" ]
[ "def prepare(self, reactor, clock, hs):...\n", "self.requester = self.register_user('requester', 'pass')\n", "self.requester_tok = self.login('requester', 'pass')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_9(self, VAR_13, VAR_14, VAR_9):...\n", "VAR_35 = '?width=32&height=32&method=' + VAR_13\n", "VAR_31, VAR_32 = make_request(self.reactor, FakeSite(self.\n thumbnail_resource), 'GET', self.media_id + VAR_35, shorthand=False,\n await_result=False)\n", "self.pump()\n", "VAR_33 = {b'Content-Lengt...
[ "def _test_thumbnail(self, method, expected_body, expected_found):...\n", "params = '?width=32&height=32&method=' + method\n", "request, channel = make_request(self.reactor, FakeSite(self.\n thumbnail_resource), 'GET', self.media_id + params, shorthand=False,\n await_result=False)\n", "self.pump()\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "@FUNC_0...\n", "return SpamChecker(self)\n" ]
[ "@cache_in_self...\n", "return SpamChecker(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_11(self, VAR_56):...\n", "\"\"\"docstring\"\"\"\n", "VAR_82 = VAR_7.search\n", "self._kill_elements(VAR_56, lambda VAR_16: VAR_82(VAR_16.text), etree.Comment)\n" ]
[ "def kill_conditional_comments(self, doc):...\n", "\"\"\"docstring\"\"\"\n", "has_conditional_comment = _conditional_comment_re.search\n", "self._kill_elements(doc, lambda el: has_conditional_comment(el.text), etree\n .Comment)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_4(self):...\n", "\"\"\"Model with a callable concrete function.\"\"\"\n", "def __init__(self):...\n", "VAR_56 = def_function.function(self.multiply, input_signature=[tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.TensorSpec(\n shape=(), dtype=dtypes.float32)])\n", "se...
[ "def testShowAllWithPureConcreteFunction(self):...\n", "\"\"\"Model with a callable concrete function.\"\"\"\n", "def __init__(self):...\n", "function = def_function.function(self.multiply, input_signature=[\n tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.\n TensorSpec(shape=(), dt...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Return'" ]
[ "def FUNC_39(self):...\n", "VAR_131 = self.cleaned_data['expires']\n", "VAR_131 = VAR_131.replace(hour=23, minute=59, second=59, microsecond=999999)\n", "if VAR_131 < timezone.now():\n", "return VAR_131\n" ]
[ "def clean_expires(self):...\n", "expires = self.cleaned_data['expires']\n", "expires = expires.replace(hour=23, minute=59, second=59, microsecond=999999)\n", "if expires < timezone.now():\n", "return expires\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_27(VAR_0, VAR_1):...\n", "create_dir('random')\n", "create_dir('random2')\n", "VAR_8 = VAR_1.post('/folders/rename', data={'current_path': 'inexisting',\n 'new_name': 'random3'}, follow_redirects=True)\n", "assert b'Directory not found' in VAR_8.data\n", "VAR_8 = VAR_1.post('/folders/rename',...
[ "def test_invalid_inputs_fail_renaming(test_app, client):...\n", "create_dir('random')\n", "create_dir('random2')\n", "resp = client.post('/folders/rename', data={'current_path': 'inexisting',\n 'new_name': 'random3'}, follow_redirects=True)\n", "assert b'Directory not found' in resp.data\n", "resp = c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Assign'", "Assert'", "Assign'", "Assert'", "Assign'", "For", "Expr'", "Assign'", "Assert'" ]
[ "def FUNC_18(VAR_22, VAR_16):...\n", "VAR_40 = False\n", "VAR_22 = VAR_22 or '1'\n", "if not VAR_22.replace('.', '', 1).isdigit():\n", "flash(_('%(seriesindex)s is not a valid number, skipping', seriesindex=\n series_index), category='warning')\n", "if str(VAR_16.series_index) != VAR_22:\n", "return ...
[ "def edit_book_series_index(series_index, book):...\n", "modif_date = False\n", "series_index = series_index or '1'\n", "if not series_index.replace('.', '', 1).isdigit():\n", "flash(_('%(seriesindex)s is not a valid number, skipping', seriesindex=\n series_index), category='warning')\n", "if str(book....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Return'", "Assign'", "Return'", "Assign'" ]
[ "def __init__(self):...\n", "VAR_57 = def_function.function(self.multiply, input_signature=[tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.TensorSpec(\n shape=(), dtype=dtypes.float32)])\n", "self.pure_concrete_function = VAR_57.get_concrete_function()\n", "super(CLASS_2, self)._...
[ "def __init__(self):...\n", "function = def_function.function(self.multiply, input_signature=[\n tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32)])\n", "self.pure_concrete_function = function.get_concrete_function()\n", "super(DummyModel, ...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def __init__(self):...\n", "self.server_name = 'mock_server'\n", "self.key = signedjson.key.generate_signing_key(0)\n" ]
[ "def __init__(self):...\n", "self.server_name = 'mock_server'\n", "self.key = signedjson.key.generate_signing_key(0)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "@default('client_secret')...\n", "return os.getenv('GITHUB_CLIENT_SECRET', '')\n" ]
[ "@default('client_secret')...\n", "return os.getenv('GITHUB_CLIENT_SECRET', '')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_8(VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_17['is_paginated']:\n", "\"\"\" Initialize variables \"\"\"\n", "VAR_28 = VAR_29 = False\n", "VAR_30 = VAR_31 = range(0)\n", "if VAR_17['pages'] <= VAR_11:\n", "VAR_28 = VAR_29 = True\n", "if VAR_17['current_page_number'] <= VAR_13:\n", ...
[ "def setup_paginator(context):...\n", "\"\"\"docstring\"\"\"\n", "if context['is_paginated']:\n", "\"\"\" Initialize variables \"\"\"\n", "in_leading_range = in_trailing_range = False\n", "pages_outside_leading_range = pages_outside_trailing_range = range(0)\n", "if context['pages'] <= LEADING_PAGE_RANG...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "A...
[ "@transaction.non_atomic_requests...\n", "\"\"\"docstring\"\"\"\n", "VAR_38 = SlashSeparatedCourseKey.from_string(VAR_10)\n", "def FUNC_88(VAR_176, VAR_177):...\n", "return JsonResponse({'error': unicode(err)}, status=400)\n", "return JsonResponse()\n", "\"\"\"docstring\"\"\"\n", "VAR_207 = unicodecsv...
[ "@transaction.non_atomic_requests...\n", "\"\"\"docstring\"\"\"\n", "course_key = SlashSeparatedCourseKey.from_string(course_id)\n", "def validator(file_storage, file_to_validate):...\n", "return JsonResponse({'error': unicode(err)}, status=400)\n", "return JsonResponse()\n", "\"\"\"docstring\"\"\"\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "FunctionDef'", "Return'", "Return'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_7(self, VAR_11) ->str:...\n", "return VAR_11.getClientIP()\n" ]
[ "def get_ip_from_request(self, request) ->str:...\n", "return request.getClientIP()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_5(self):...\n", "self.set_doctype_roles()\n" ]
[ "def before_insert(self):...\n", "self.set_doctype_roles()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@property...\n", "return True\n" ]
[ "@property...\n", "return True\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@VAR_0.register...\n", "VAR_2 = pickle.loads(bz2.decompress(base64.urlsafe_b64decode(VAR_1)))\n", "VAR_3, VAR_4 = read_host_config(SESSION, VAR_2)\n", "if VAR_3 is not None:\n", "return VAR_4 + 'checked in successful'\n", "return VAR_4 + 'error checking in'\n" ]
[ "@XMLRPC.register...\n", "config = pickle.loads(bz2.decompress(base64.urlsafe_b64decode(pickledata)))\n", "r, message = read_host_config(SESSION, config)\n", "if r is not None:\n", "return message + 'checked in successful'\n", "return message + 'error checking in'\n" ]
[ 0, 5, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_65(self):...\n", "" ]
[ "def close(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_15(self, VAR_0):...\n", "VAR_40 = VAR_0 / 'foo'\n", "VAR_40.ensure()\n", "VAR_36 = QUrl.fromLocalFile(str(VAR_40))\n", "VAR_37 = QNetworkRequest(VAR_36)\n", "VAR_38 = filescheme.handler(VAR_37)\n", "assert VAR_38 is None\n" ]
[ "def test_file(self, tmpdir):...\n", "filename = tmpdir / 'foo'\n", "filename.ensure()\n", "url = QUrl.fromLocalFile(str(filename))\n", "req = QNetworkRequest(url)\n", "reply = filescheme.handler(req)\n", "assert reply is None\n" ]
[ 0, 0, 0, 0, 0, 3, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assert'" ]
[ "def FUNC_26(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_52 = self.meta.get_set_only_once_fields()\n", "if VAR_52 and self._doc_before_save:\n", "for field in VAR_52:\n", "return False\n", "VAR_97 = False\n", "VAR_26 = self.get(field.fieldname)\n", "VAR_53 = self._doc_before_save.get(field.fieldna...
[ "def validate_set_only_once(self):...\n", "\"\"\"docstring\"\"\"\n", "set_only_once_fields = self.meta.get_set_only_once_fields()\n", "if set_only_once_fields and self._doc_before_save:\n", "for field in set_only_once_fields:\n", "return False\n", "fail = False\n", "value = self.get(field.fieldname)\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "For", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_135(self, VAR_212):...\n", "if 'everybody' in VAR_212.can_read or not self.settings.manage_permissions:\n", "return True\n", "if self.auth.user:\n", "VAR_167 = self.settings.groups\n", "return False\n", "if 'wiki_editor' in VAR_167 or set(VAR_167).intersection(set(VAR_212.\n", "return True\n...
[ "def can_read(self, page):...\n", "if 'everybody' in page.can_read or not self.settings.manage_permissions:\n", "return True\n", "if self.auth.user:\n", "groups = self.settings.groups\n", "return False\n", "if 'wiki_editor' in groups or set(groups).intersection(set(page.can_read +\n", "return True\n" ...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Assign'", "Return'", "Condition", "Return'" ]
[ "def FUNC_19(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 = 'x1=np.ones([2,10])'\n", "VAR_31 = saved_model_cli.load_inputs_from_...
[ "def testInputParserBoth(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 = 'x1=np.ones([2,10])'\n", "feed_dict = saved_mo...
[ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "async def FUNC_13(self, VAR_6, VAR_11, VAR_12, VAR_13):...\n", "await super().on_rdata(VAR_6, VAR_11, VAR_12, VAR_13)\n", "for r in VAR_13:\n", "self.received_rdata_rows.append((VAR_6, VAR_12, r))\n" ]
[ "async def on_rdata(self, stream_name, instance_name, token, rows):...\n", "await super().on_rdata(stream_name, instance_name, token, rows)\n", "for r in rows:\n", "self.received_rdata_rows.append((stream_name, token, r))\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "For", "Expr'" ]
[ "def FUNC_75(self):...\n", "return self.renderer.header(self.inline(self.token['text']), self.token[\n 'level'], self.token['text'])\n" ]
[ "def output_heading(self):...\n", "return self.renderer.header(self.inline(self.token['text']), self.token[\n 'level'], self.token['text'])\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "async def FUNC_2(*, VAR_10: Dependant, VAR_11: Dict[str, Any], VAR_9: bool...\n", "assert VAR_10.call is not None, 'dependant.call must be a function'\n", "if VAR_9:\n", "return await VAR_10.call(**values)\n", "return await run_in_threadpool(VAR_10.call, **values)\n" ]
[ "async def run_endpoint_function(*, dependant: Dependant, values: Dict[str,...\n", "assert dependant.call is not None, 'dependant.call must be a function'\n", "if is_coroutine:\n", "return await dependant.call(**values)\n", "return await run_in_threadpool(dependant.call, **values)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assert'", "Condition", "Return'", "Return'" ]
[ "def __init__(self):...\n", "self._allowed = []\n", "self._exempt = []\n", "self.seted = False\n" ]
[ "def __init__(self):...\n", "self._allowed = []\n", "self._exempt = []\n", "self.seted = False\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'" ]
[ "def __init__(self, VAR_6='OMERO.web', VAR_7=False, VAR_8=False, VAR_9=True,...\n", "\"\"\"docstring\"\"\"\n", "self.useragent = VAR_6\n", "self.isAdmin = VAR_7\n", "self.isGroupOwner = VAR_8\n", "self.doConnectionCleanup = VAR_9\n", "self.omero_group = VAR_10\n", "self.allowPublic = VAR_11\n" ]
[ "def __init__(self, useragent='OMERO.web', isAdmin=False, isGroupOwner=False,...\n", "\"\"\"docstring\"\"\"\n", "self.useragent = useragent\n", "self.isAdmin = isAdmin\n", "self.isGroupOwner = isGroupOwner\n", "self.doConnectionCleanup = doConnectionCleanup\n", "self.omero_group = omero_group\n", "sel...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_34(self):...\n", "VAR_27 = widgets.AdminURLFieldWidget()\n", "self.assertHTMLEqual(conditional_escape(VAR_27.render('test',\n 'http://example-äüö.com')), 'string')\n" ]
[ "def test_render_idn(self):...\n", "w = widgets.AdminURLFieldWidget()\n", "self.assertHTMLEqual(conditional_escape(w.render('test',\n 'http://example-äüö.com')),\n '<p class=\"url\">Currently:<a href=\"http://xn--example--7za4pnc.com\">http://example-äüö.com</a><br />Change:<input class=\"vURLField\" name...
[ 0, 0, 2 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_3(self, *, VAR_4: str) ->Set[str]:...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = super().get_imports(VAR_4=prefix)\n", "VAR_8.update({'from datetime import date', 'from typing import cast'})\n", "return VAR_8\n" ]
[ "def get_imports(self, *, prefix: str) ->Set[str]:...\n", "\"\"\"docstring\"\"\"\n", "imports = super().get_imports(prefix=prefix)\n", "imports.update({'from datetime import date', 'from typing import cast'})\n", "return imports\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "@VAR_4.route('/images/<path:path>')...\n", "def FUNC_8(VAR_5):...\n", "import os\n", "VAR_28 = os.path.dirname(__file__)\n", "VAR_29 = VAR_5\n", "VAR_30 = os.path.join(VAR_28, VAR_29)\n", "return VAR_30\n" ]
[ "@app.route('/images/<path:path>')...\n", "def get_absolute_path(path):...\n", "import os\n", "script_dir = os.path.dirname(__file__)\n", "rel_path = path\n", "abs_file_path = os.path.join(script_dir, rel_path)\n", "return abs_file_path\n" ]
[ 0, 0, 0, 0, 0, 1, 0 ]
[ "Condition", "FunctionDef'", "Import'", "Assign'", "Assign'", "Assign'", "Return'" ]