lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "VAR_57 = VAR_9.POST.get('action')\n", "VAR_58 = VAR_9.POST.get('identifiers')\n", "VAR_59 = FUNC_64(VAR_58)\n", "VAR_61 = VAR_9.POST.get('email_students') in ['true', 'True', True...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "action = request.POST.get('action')\n", "identifiers_raw = request.POST.get('identifiers')\n", "identifiers = _split_input_list(identifiers_raw)\n", "email_students = reques...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Return'", "Assign'", "Assign'", "E...
[ "def FUNC_2(VAR_7, VAR_8):...\n", "" ]
[ "def delete_user_session(user_id, session_key):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_15(self, VAR_5, VAR_10, VAR_16):...\n", "VAR_16 = ElementTree.fromstring(VAR_16)\n", "VAR_29 = 'ami'\n", "VAR_30 = 'machine'\n", "VAR_43 = VAR_16.find('machine_configuration/kernel_id').text\n", "VAR_43 = None\n", "VAR_44 = VAR_16.find('machine_configuration/ramdisk_id').text\n", "VAR_44 = N...
[ "def _s3_parse_manifest(self, context, metadata, manifest):...\n", "manifest = ElementTree.fromstring(manifest)\n", "image_format = 'ami'\n", "image_type = 'machine'\n", "kernel_id = manifest.find('machine_configuration/kernel_id').text\n", "kernel_id = None\n", "ramdisk_id = manifest.find('machine_conf...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "...
[ "def FUNC_16():...\n", "VAR_46 = FORM.confirm(T('Upgrade'), {T('Cancel'): URL('site')})\n", "if VAR_46.accepted:\n", "VAR_124, VAR_125 = upgrade(request)\n", "return dict(VAR_46=dialog)\n", "if VAR_124:\n", "session.flash = T('web2py upgraded; please restart it')\n", "session.flash = T('unable to upgr...
[ "def upgrade_web2py():...\n", "dialog = FORM.confirm(T('Upgrade'), {T('Cancel'): URL('site')})\n", "if dialog.accepted:\n", "success, error = upgrade(request)\n", "return dict(dialog=dialog)\n", "if success:\n", "session.flash = T('web2py upgraded; please restart it')\n", "session.flash = T('unable to...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_89(*VAR_79, **VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.utils.formatters\n", "return frappe.utils.formatters.format_value(*VAR_79, **kwargs)\n" ]
[ "def format(*args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.utils.formatters\n", "return frappe.utils.formatters.format_value(*args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Return'" ]
[ "@VAR_0.route('/pid_mod_unique_id/<unique_id>/<state>')...\n", "\"\"\"docstring\"\"\"\n", "if not utils_general.user_has_permission('edit_controllers'):\n", "return 'Insufficient user permissions to manipulate PID'\n", "VAR_70 = PID.query.filter(PID.unique_id == VAR_9).first()\n", "VAR_69 = DaemonControl(...
[ "@blueprint.route('/pid_mod_unique_id/<unique_id>/<state>')...\n", "\"\"\"docstring\"\"\"\n", "if not utils_general.user_has_permission('edit_controllers'):\n", "return 'Insufficient user permissions to manipulate PID'\n", "pid = PID.query.filter(PID.unique_id == unique_id).first()\n", "daemon = DaemonCon...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Condition", "Expr...
[ "def FUNC_15(self):...\n", "VAR_230 = self.API_URI\n", "VAR_231 = self.options.pop('hl', None)\n", "if VAR_231:\n", "VAR_230 = self.API_URI + '?hl=%s' % VAR_231\n", "VAR_57 = self.public_key\n", "self.options['sitekey'] = VAR_57\n", "VAR_232 = DIV(SCRIPT(_src=api_uri, _async='', _defer=''), DIV(_class...
[ "def xml(self):...\n", "api_uri = self.API_URI\n", "hl = self.options.pop('hl', None)\n", "if hl:\n", "api_uri = self.API_URI + '?hl=%s' % hl\n", "public_key = self.public_key\n", "self.options['sitekey'] = public_key\n", "captcha = DIV(SCRIPT(_src=api_uri, _async='', _defer=''), DIV(_class=\n 'g-r...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_4(self, VAR_0, VAR_1, VAR_3):...\n", "VAR_19 = self.helper.create_room_as(self.user_id)\n", "VAR_20, VAR_21 = self.make_request('PUT', b'directory/list/room/%s' % (\n VAR_19.encode('ascii'),), b'{}')\n", "self.assertEquals(200, VAR_21.code, VAR_21.result)\n", "self.room_list_handler = VAR_3.get...
[ "def prepare(self, reactor, clock, hs):...\n", "room_id = self.helper.create_room_as(self.user_id)\n", "request, channel = self.make_request('PUT', b'directory/list/room/%s' % (\n room_id.encode('ascii'),), b'{}')\n", "self.assertEquals(200, channel.code, channel.result)\n", "self.room_list_handler = hs....
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_12(self):...\n", "async def FUNC_18(VAR_3):...\n", "VAR_3.write(b'response')\n", "VAR_3.finish()\n", "VAR_5 = CLASS_2.TestResource()\n", "VAR_5.callback = VAR_10\n", "VAR_7, VAR_6 = make_request(self.reactor, FakeSite(VAR_5), b'GET', b'/path')\n", "self.assertEqual(VAR_6.result['code'], b'20...
[ "def test_good_response(self):...\n", "async def callback(request):...\n", "request.write(b'response')\n", "request.finish()\n", "res = WrapHtmlRequestHandlerTests.TestResource()\n", "res.callback = callback\n", "_, channel = make_request(self.reactor, FakeSite(res), b'GET', b'/path')\n", "self.assert...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "AsyncFunctionDef'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_86():...\n", "from frappe.utils import cint\n", "return VAR_19.mute_emails or cint(VAR_13.get('mute_emails') or 0) or False\n" ]
[ "def are_emails_muted():...\n", "from frappe.utils import cint\n", "return flags.mute_emails or cint(conf.get('mute_emails') or 0) or False\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "def FUNC_13(self):...\n", "VAR_20 = 'inputx=file[[v1]v2'\n", "saved_model_cli.preprocess_inputs_arg_string(VAR_20)\n", "VAR_20 = 'inputx:file'\n", "saved_model_cli.preprocess_inputs_arg_string(VAR_20)\n", "VAR_20 = 'inputx:np.zeros((5))'\n", "saved_model_cli.preprocess_input_exprs_arg_string(VAR_20)\n"...
[ "def testInputPreProcessErrorBadFormat(self):...\n", "input_str = 'inputx=file[[v1]v2'\n", "saved_model_cli.preprocess_inputs_arg_string(input_str)\n", "input_str = 'inputx:file'\n", "saved_model_cli.preprocess_inputs_arg_string(input_str)\n", "input_str = 'inputx:np.zeros((5))'\n", "saved_model_cli.pre...
[ 0, 0, 0, 0, 0, 0, 5 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@VAR_0.route('/query/runs/all')...\n", "VAR_23 = g.conn.session.query(Query).join(Query.latest_rev).join(QueryRevision\n .latest_run)\n", "VAR_24 = 'all'\n", "if request.args.get('published') == 'true':\n", "VAR_23 = VAR_23.filter(Query.published)\n", "VAR_13 = int(request.args.get('limit', VAR_0.conf...
[ "@app.route('/query/runs/all')...\n", "queries = g.conn.session.query(Query).join(Query.latest_rev).join(QueryRevision\n .latest_run)\n", "queries_filter = 'all'\n", "if request.args.get('published') == 'true':\n", "queries = queries.filter(Query.published)\n", "limit = int(request.args.get('limit', ap...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_19(self):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_80():...\n", "VAR_84 = self.as_dict()\n", "for VAR_43, VAR_26 in iteritems(VAR_84):\n", "if VAR_26 == None:\n", "return VAR_84\n", "VAR_84[VAR_43] = ''\n" ]
[ "def set_title_field(self):...\n", "\"\"\"docstring\"\"\"\n", "def get_values():...\n", "values = self.as_dict()\n", "for key, value in iteritems(values):\n", "if value == None:\n", "return values\n", "values[key] = ''\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Assign'" ]
[ "def FUNC_110(VAR_171, VAR_172=1, VAR_173='en'):...\n", "VAR_203 = []\n", "VAR_204 = VAR_0.Faker(VAR_173)\n", "if VAR_171 not in dir(VAR_204):\n", "for i in range(VAR_172):\n", "from frappe.chat.util import squashify\n", "VAR_224 = getattr(VAR_204, VAR_171)()\n", "return squashify(VAR_203)\n", "VAR_...
[ "def mock(type, size=1, locale='en'):...\n", "results = []\n", "fake = faker.Faker(locale)\n", "if type not in dir(fake):\n", "for i in range(size):\n", "from frappe.chat.util import squashify\n", "data = getattr(fake, type)()\n", "return squashify(results)\n", "results.append(data)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "For", "ImportFrom'", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_85(self, *VAR_0, **VAR_1):...\n", "VAR_73 = []\n", "VAR_25 = VAR_6.__name__\n", "VAR_91 = frappe.get_doc_hooks()\n", "for handler in (VAR_91.get(self.doctype, {}).get(VAR_25, []) + VAR_91.get(\n", "VAR_73.append(frappe.get_attr(handler))\n", "VAR_92 = FUNC_84(VAR_6, *VAR_73)\n", "return VAR_...
[ "def composer(self, *args, **kwargs):...\n", "hooks = []\n", "method = f.__name__\n", "doc_events = frappe.get_doc_hooks()\n", "for handler in (doc_events.get(self.doctype, {}).get(method, []) +\n", "hooks.append(frappe.get_attr(handler))\n", "composed = compose(f, *hooks)\n", "return composed(self, m...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_39(self):...\n", "VAR_53.lib.sessions.expire()\n" ]
[ "def api_logout(self):...\n", "cherrypy.lib.sessions.expire()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "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_42 = os.path.join(test.get_temp_dir(), 'new_dir' + ('tfrt' if VAR_5 else\n ''))\n", "VAR_11 = self.parser.parse_args(['run', '--dir', VAR_10, '-...
[ "@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", "output_dir = os.path.join(test.get_temp_dir(), 'new_dir' + ('tfrt' if\n use_tfrt else ''))\n", "args = self.parser.parse_args(['run', ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_28(self, VAR_33, VAR_34=None, VAR_35=None, VAR_36=None, VAR_37=...\n", "VAR_79 = FUNC_5(VAR_33.url)\n", "VAR_15 = Response()\n", "VAR_15.status_code = 200\n", "VAR_15.url = VAR_33.url\n", "VAR_98 = os.stat(VAR_79)\n", "VAR_15.status_code = 404\n", "VAR_99 = email.utils.formatdate(VAR_98.st_m...
[ "def send(self, request, stream=None, timeout=None, verify=None, cert=None,...\n", "pathname = url_to_path(request.url)\n", "resp = Response()\n", "resp.status_code = 200\n", "resp.url = request.url\n", "stats = os.stat(pathname)\n", "resp.status_code = 404\n", "modified = email.utils.formatdate(stats...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_5(VAR_0):...\n", "VAR_0.DEBUG = True\n", "VAR_6 = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentKwargs' parent=view pk=99\"\n )\n", "VAR_7 = unicorn(None, VAR_6)\n", "VAR_10 = CLASS_0(component_name='test', component_id='asdf')\n", "VAR_8 = {'view':...
[ "def test_unicorn_render_parent_with_pk(settings):...\n", "settings.DEBUG = True\n", "token = Token(TokenType.TEXT,\n \"unicorn 'tests.templatetags.test_unicorn_render.FakeComponentKwargs' parent=view pk=99\"\n )\n", "unicorn_node = unicorn(None, token)\n", "view = FakeComponentParent(component_name='...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assert'" ]
[ "def FUNC_11(self):...\n", "VAR_15 = ClearableFileInput()\n", "assert 'accept' not in VAR_15.render(name='file', value='test.jpg')\n", "assert ['starts-with', '$Content-Type', ''] in VAR_15.get_conditions(None)\n", "VAR_15 = ClearableFileInput(attrs={'accept': 'image/*'})\n", "assert 'accept=\"image/*\"' ...
[ "def test_accept(self):...\n", "widget = ClearableFileInput()\n", "assert 'accept' not in widget.render(name='file', value='test.jpg')\n", "assert ['starts-with', '$Content-Type', ''] in widget.get_conditions(None)\n", "widget = ClearableFileInput(attrs={'accept': 'image/*'})\n", "assert 'accept=\"image/*...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'", "Assert'", "Assign'", "Assert'", "Assert'", "Assign'", "Assert'", "Assert'", "Assign'", "Assert'", "Assert'", "Assert'" ]
[ "async def FUNC_14(VAR_14, VAR_15, VAR_16, VAR_17=None, VAR_18=None):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_15(VAR_37):...\n", "VAR_39, VAR_23 = VAR_37\n", "VAR_16.write(VAR_39)\n", "return VAR_23\n" ]
[ "async def get_file(destination, path, output_stream, args=None, max_size=None):...\n", "\"\"\"docstring\"\"\"\n", "def write_to(r):...\n", "data, response = r\n", "output_stream.write(data)\n", "return response\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def __call__(self):...\n", "" ]
[ "def __call__(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@require_POST...\n", "\"\"\"docstring\"\"\"\n", "VAR_142 = VAR_5.getObject('Image', VAR_26)\n", "VAR_169 = VAR_142.getSizeC()\n", "VAR_170 = {}\n", "VAR_171 = {}\n", "for VAR_318 in range(VAR_169):\n", "VAR_297 = VAR_2.POST.get('channel%d' % VAR_318, None)\n", "if VAR_2.POST.get('confirm_apply', No...
[ "@require_POST...\n", "\"\"\"docstring\"\"\"\n", "image = conn.getObject('Image', imageId)\n", "sizeC = image.getSizeC()\n", "channelNames = {}\n", "nameDict = {}\n", "for i in range(sizeC):\n", "cname = request.POST.get('channel%d' % i, None)\n", "if request.POST.get('confirm_apply', None) is not 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 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'"...
[ "@pytest.mark.not_frozen...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = ['-m', 'qutebrowser', '--version'] + FUNC_0(VAR_4.config)\n", "VAR_19 = QProcess()\n", "VAR_19.setProcessChannelMode(QProcess.SeparateChannels)\n", "VAR_19.start(sys.executable, VAR_11)\n", "VAR_20 = VAR_19.waitForStarted(2000)\n", "...
[ "@pytest.mark.not_frozen...\n", "\"\"\"docstring\"\"\"\n", "args = ['-m', 'qutebrowser', '--version'] + _base_args(request.config)\n", "proc = QProcess()\n", "proc.setProcessChannelMode(QProcess.SeparateChannels)\n", "proc.start(sys.executable, args)\n", "ok = proc.waitForStarted(2000)\n", "assert ok\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assert'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assert'", "Assert'", "Assert'" ]
[ "def FUNC_69(self):...\n", "if not self.tokens:\n", "return None\n", "self.token = self.tokens.pop()\n", "return self.token\n" ]
[ "def pop(self):...\n", "if not self.tokens:\n", "return None\n", "self.token = self.tokens.pop()\n", "return self.token\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_15(self):...\n", "self.assertFormfield(models.Band, 'members', widgets.FilteredSelectMultiple,\n VAR_55=['members'])\n" ]
[ "def testFilteredManyToMany(self):...\n", "self.assertFormfield(models.Band, 'members', widgets.FilteredSelectMultiple,\n filter_vertical=['members'])\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_0(*VAR_0, **VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_0:\n", "if isinstance(VAR_0[0], BaseDocument):\n", "if len(VAR_0) < 2 and VAR_1:\n", "return VAR_0[0]\n", "if isinstance(VAR_0[0], string_types):\n", "if 'doctype' in VAR_1:\n", "VAR_5 = get_controller(VAR_2)\n", "VAR_2 = VAR_...
[ "def get_doc(*args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "if args:\n", "if isinstance(args[0], BaseDocument):\n", "if len(args) < 2 and kwargs:\n", "return args[0]\n", "if isinstance(args[0], string_types):\n", "if 'doctype' in kwargs:\n", "controller = get_controller(doctype)\n", "doctype...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Condition", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'" ]
[ "@property...\n", "VAR_26 = ['calendar.js', 'admin/DateTimeShortcuts.js']\n", "return forms.Media(VAR_26=[static('admin/js/%s' % path) for path in js])\n" ]
[ "@property...\n", "js = ['calendar.js', 'admin/DateTimeShortcuts.js']\n", "return forms.Media(js=[static('admin/js/%s' % path) for path in js])\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Return'" ]
[ "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", "VAR_3 = VAR_0.MagicMock()\n", "VAR_4 = VAR_0.patch('openapi_python_client.parser.GeneratorData.from_dict',\n return_value=openapi)\n", "VAR_5 = VAR_0....
[ "def test__get_project_for_url_or_path(mocker):...\n", "data_dict = mocker.MagicMock()\n", "_get_document = mocker.patch('openapi_python_client._get_document',\n return_value=data_dict)\n", "openapi = mocker.MagicMock()\n", "from_dict = mocker.patch('openapi_python_client.parser.GeneratorData.from_dict'\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "ImportFrom'", "Assign'", "Expr'", "Expr'", "Expr'", "Assert'" ]
[ "def FUNC_7(self, VAR_6):...\n", "VAR_13 = UploadForm(data={'file': ''}, instance=filemodel)\n", "assert VAR_13.is_valid()\n", "assert VAR_13.cleaned_data['file'] == VAR_6.file\n" ]
[ "def test_initial_fallback(self, filemodel):...\n", "form = UploadForm(data={'file': ''}, instance=filemodel)\n", "assert form.is_valid()\n", "assert form.cleaned_data['file'] == filemodel.file\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'", "Assert'" ]
[ "def FUNC_12(self):...\n", "VAR_5 = self.get_counts('json')\n", "self.assertEqual(VAR_5.status_code, 200)\n", "self.assertJSONEqual(VAR_5.content.decode(), VAR_0)\n" ]
[ "def test_counts_view_json(self):...\n", "response = self.get_counts('json')\n", "self.assertEqual(response.status_code, 200)\n", "self.assertJSONEqual(response.content.decode(), COUNTS_DATA)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_50(self):...\n", "\"\"\"docstring\"\"\"\n", "self.load_doc_before_save()\n", "self.reset_seen()\n", "if self._action in ('save', 'submit'):\n", "self.run_method('before_validate')\n", "if self.flags.ignore_validate:\n", "return\n", "if self._action == 'save':\n", "self.run_method('valida...
[ "def run_before_save_methods(self):...\n", "\"\"\"docstring\"\"\"\n", "self.load_doc_before_save()\n", "self.reset_seen()\n", "if self._action in ('save', 'submit'):\n", "self.run_method('before_validate')\n", "if self.flags.ignore_validate:\n", "return\n", "if self._action == 'save':\n", "self.ru...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Return'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_13(self):...\n", "VAR_20 = 'inputx=file[[v1]v2'\n", "saved_model_cli.preprocess_inputs_arg_string(VAR_20)\n", "VAR_20 = 'inputx:file'\n", "saved_model_cli.preprocess_inputs_arg_string(VAR_20)\n", "VAR_20 = 'inputx:np.zeros((5))'\n", "saved_model_cli.preprocess_input_exprs_arg_string(VAR_20)\n"...
[ "def testInputPreProcessErrorBadFormat(self):...\n", "input_str = 'inputx=file[[v1]v2'\n", "saved_model_cli.preprocess_inputs_arg_string(input_str)\n", "input_str = 'inputx:file'\n", "saved_model_cli.preprocess_inputs_arg_string(input_str)\n", "input_str = 'inputx:np.zeros((5))'\n", "saved_model_cli.pre...
[ 0, 0, 0, 0, 0, 0, 5 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@wraps(VAR_3)...\n", "if current_user.role_upload() or current_user.role_admin():\n", "return VAR_3(*VAR_46, **kwargs)\n", "abort(403)\n" ]
[ "@wraps(f)...\n", "if current_user.role_upload() or current_user.role_admin():\n", "return f(*args, **kwargs)\n", "abort(403)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Expr'" ]
[ "def FUNC_78(VAR_259, VAR_11):...\n", "VAR_300 = 0\n", "VAR_301 = 1000\n", "while VAR_300 < len(VAR_11):\n", "VAR_301 = min(VAR_301, len(VAR_11) - VAR_300)\n", "VAR_322 = VAR_259.slice(VAR_252, VAR_11[VAR_300:VAR_300 + VAR_301])\n", "VAR_300 += VAR_301\n", "yield [[col.values[row] for col in VAR_322.c...
[ "def row_generator(table, h):...\n", "idx = 0\n", "batch = 1000\n", "while idx < len(h):\n", "batch = min(batch, len(h) - idx)\n", "res = table.slice(col_indices, h[idx:idx + batch])\n", "idx += batch\n", "yield [[col.values[row] for col in res.columns] for row in range(0, len(res\n .rowNumbers))]\...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "AugAssign'", "Expr'" ]
[ "from html import escape as html_escape\n", "import re\n", "from typing import Union\n", "from six import ensure_str\n", "from cmk.gui.utils.html import HTML\n", "VAR_0 = Union[None, int, HTML, str]\n", "VAR_1 = re.compile(\n '&lt;(/?)(h1|h2|b|tt|i|u|br(?: /)?|nobr(?: /)?|pre|a|sup|p|li|ul|ol)&gt;')\...
[ "from html import escape as html_escape\n", "import re\n", "from typing import Union\n", "from six import ensure_str\n", "from cmk.gui.utils.html import HTML\n", "EscapableEntity = Union[None, int, HTML, str]\n", "_UNESCAPER_TEXT = re.compile(\n '&lt;(/?)(h1|h2|b|tt|i|u|br(?: /)?|nobr(?: /)?|pre|a|su...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'",...
[ "def FUNC_10(self):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import has_common\n", "VAR_17 = [d.role for d in frappe.get_all('Has Role', fields=['role'], VAR_6\n ={'parent': self.name})]\n", "VAR_18 = get_custom_allowed_roles('report', self.name)\n", "VAR_17.extend(VAR_18)\n", "if not VAR...
[ "def is_permitted(self):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import has_common\n", "allowed = [d.role for d in frappe.get_all('Has Role', fields=['role'],\n filters={'parent': self.name})]\n", "custom_roles = get_custom_allowed_roles('report', self.name)\n", "allowed.extend(custom_role...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Assign'", "Assign'", "Expr'", "Condition", "Return'", "Condition", "Return'" ]
[ "def __call__(self, *VAR_14, **VAR_9):...\n", "assert self.request is None\n", "self.request = SynapseRequest(*VAR_14, **kwargs)\n", "return self.request\n" ]
[ "def __call__(self, *args, **kwargs):...\n", "assert self.request is None\n", "self.request = SynapseRequest(*args, **kwargs)\n", "return self.request\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Assign'", "Return'" ]
[ "import os\n", "import attr\n", "import pytest\n", "import bs4\n", "from PyQt5.QtCore import QUrl\n", "from PyQt5.QtNetwork import QNetworkRequest\n", "from qutebrowser.browser.webkit.network import filescheme\n", "from qutebrowser.utils import urlutils, utils\n", "@pytest.mark.parametrize('create_f...
[ "import os\n", "import attr\n", "import pytest\n", "import bs4\n", "from PyQt5.QtCore import QUrl\n", "from PyQt5.QtNetwork import QNetworkRequest\n", "from qutebrowser.browser.webkit.network import filescheme\n", "from qutebrowser.utils import urlutils, utils\n", "@pytest.mark.parametrize('create_f...
[ 0, 0, 0, 0, 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Docstring", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assert'", "Condition", "Assert'", "Condition", "Assert'", "Condition", "Ass...
[ "def FUNC_28(self):...\n", "VAR_13 = self.cleaned_data['instructions']\n", "self.spam_check(VAR_13)\n", "return VAR_13\n" ]
[ "def clean_instructions(self):...\n", "value = self.cleaned_data['instructions']\n", "self.spam_check(value)\n", "return value\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_37(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.votes > 0:\n", "return self.recommendations / self.votes * 10\n", "return _('Unrated')\n" ]
[ "def _score(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.votes > 0:\n", "return self.recommendations / self.votes * 10\n", "return _('Unrated')\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Return'" ]
[ "def FUNC_59(self):...\n", "\"\"\"docstring\"\"\"\n", "return self._blitzcon.canBeAdmin()\n" ]
[ "def canBeAdmin(self):...\n", "\"\"\"docstring\"\"\"\n", "return self._blitzcon.canBeAdmin()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "super().__init__(*VAR_6, **kwargs)\n", "self.helper = FormHelper(self)\n", "self.helper.form_tag = False\n", "self.helper.layout = Layout(Field('style'), Field('period'), Div(\n 'start_date', 'end_date', css_class='input-group input-daterange',\n data_prov...
[ "def __init__(self, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n", "self.helper = FormHelper(self)\n", "self.helper.form_tag = False\n", "self.helper.layout = Layout(Field('style'), Field('period'), Div(\n 'start_date', 'end_date', css_class='input-group input-daterange',\n data_provi...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "print('checking package data')\n", "for pkg, data in VAR_9.items():\n", "VAR_45 = VAR_1(*pkg.split('.'))\n", "for d in data:\n", "VAR_14 = VAR_1(VAR_45, d)\n", "if '*' in VAR_14:\n", "assert len(glob(VAR_14)) > 0, 'No files match pattern %s' % V...
[ "def check_package_data(package_data):...\n", "\"\"\"docstring\"\"\"\n", "print('checking package data')\n", "for pkg, data in package_data.items():\n", "pkg_root = pjoin(*pkg.split('.'))\n", "for d in data:\n", "path = pjoin(pkg_root, d)\n", "if '*' in path:\n", "assert len(glob(path)) > 0, 'No fil...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "For", "Assign'", "For", "Assign'", "Condition", "Assert'", "Assert'" ]
[ "def FUNC_13(self):...\n", "VAR_62 = self.useroptions.forUser(self.getUserId())\n", "VAR_63 = VAR_62.getChangableOptions()\n", "if VAR_53.session['admin']:\n", "VAR_63['media'].update({'may_download': True})\n", "VAR_63['media'].update({'may_download': VAR_62.getOptionValue(\n 'media.may_download')})\n...
[ "def api_getuseroptions(self):...\n", "uo = self.useroptions.forUser(self.getUserId())\n", "uco = uo.getChangableOptions()\n", "if cherrypy.session['admin']:\n", "uco['media'].update({'may_download': True})\n", "uco['media'].update({'may_download': uo.getOptionValue('media.may_download')})\n", "return u...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "@VAR_0.simple_tag...\n", "\"\"\"docstring\"\"\"\n", "VAR_52 = reverse('rest_framework:login')\n", "return ''\n", "VAR_41 = \"<li><a href='{href}?next={next}'>Log in</a></li>\"\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 ''\n", "snippet = \"<li><a href='{href}?next={next}'>Log in</a></li>\"\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_3(VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "return force_text(urllib_parse.unquote_plus(force_str(VAR_15)))\n" ]
[ "def urlunquote_plus(quoted_url):...\n", "\"\"\"docstring\"\"\"\n", "return force_text(urllib_parse.unquote_plus(force_str(quoted_url)))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __init__(self, VAR_2: IReactorTime):...\n", "super().__init__()\n", "self.reactor = VAR_2\n", "self._pull_to_push_producer = None\n" ]
[ "def __init__(self, reactor: IReactorTime):...\n", "super().__init__()\n", "self.reactor = reactor\n", "self._pull_to_push_producer = None\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "\"\"\"string\"\"\"\n", "import re\n", "import inspect\n", "__version__ = '0.8'\n", "__author__ = 'Hsiaoming Yang <me@lepture.com>'\n", "__all__ = ['BlockGrammar', 'BlockLexer', 'InlineGrammar', 'InlineLexer',\n 'Renderer', 'Markdown', 'markdown', 'escape']\n", "VAR_0 = re.compile('\\\\s+')\n", "VA...
[ "\"\"\"\n mistune\n ~~~~~~~\n\n The fastest markdown parser in pure Python with renderer feature.\n\n :copyright: (c) 2014 - 2017 by Hsiaoming Yang.\n\"\"\"\n", "import re\n", "import inspect\n", "__version__ = '0.8'\n", "__author__ = 'Hsiaoming Yang <me@lepture.com>'\n", "__all__ = ['BlockGra...
[ 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_1(VAR_1):...\n", "return open(FUNC_0(VAR_1)).read()\n" ]
[ "def read(fname):...\n", "return open(fpath(fname)).read()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(*, VAR_0: Optional[str], VAR_1: Optional[Path]) ->Sequence[...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = FUNC_0(VAR_0=url, VAR_1=path)\n", "if isinstance(VAR_4, GeneratorError):\n", "return [VAR_4]\n", "return VAR_4.update()\n" ]
[ "def update_existing_client(*, url: Optional[str], path: Optional[Path]...\n", "\"\"\"docstring\"\"\"\n", "project = _get_project_for_url_or_path(url=url, path=path)\n", "if isinstance(project, GeneratorError):\n", "return [project]\n", "return project.update()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(self, VAR_2):...\n", "return parse.urlparse(VAR_2).scheme == 'https'\n" ]
[ "def issecure(self, url):...\n", "return parse.urlparse(url).scheme == 'https'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2():...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = [VAR_1('static', 'components'), VAR_1('static', '*', 'less'),\n VAR_1('static', '*', 'node_modules')]\n", "VAR_22 = os.getcwd()\n", "os.chdir('notebook')\n", "VAR_23 = []\n", "for parent, VAR_54, VAR_65 in os.walk('static'):\n", "if any(fnm...
[ "def find_package_data():...\n", "\"\"\"docstring\"\"\"\n", "excludes = [pjoin('static', 'components'), pjoin('static', '*', 'less'),\n pjoin('static', '*', 'node_modules')]\n", "cwd = os.getcwd()\n", "os.chdir('notebook')\n", "static_data = []\n", "for parent, dirs, files in os.walk('static'):\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "For", "For", "For", "Assign'", "For", "Expr'", "Assign'", "Expr'", "Expr'", "For", "For", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "For", "For", "Assign'", ...
[ "def FUNC_88(*VAR_79, **VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.utils.formatters\n", "return frappe.utils.formatters.format_value(*VAR_79, **kwargs)\n" ]
[ "def format_value(*args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.utils.formatters\n", "return frappe.utils.formatters.format_value(*args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Return'" ]
[ "def FUNC_9(self):...\n", "self._record_users()\n", "VAR_15 = {'display_name': 'new display'}\n", "self.get_success(self.handler.update_device(VAR_0, 'abc', VAR_15))\n", "VAR_10 = self.get_success(self.handler.get_device(VAR_0, 'abc'))\n", "self.assertEqual(VAR_10['display_name'], 'new display')\n" ]
[ "def test_update_device(self):...\n", "self._record_users()\n", "update = {'display_name': 'new display'}\n", "self.get_success(self.handler.update_device(user1, 'abc', update))\n", "res = self.get_success(self.handler.get_device(user1, 'abc'))\n", "self.assertEqual(res['display_name'], 'new display')\n" ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_3(VAR_3, VAR_5=None, VAR_6=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_6 is None:\n", "VAR_41 = VAR_7.search(VAR_3)\n", "if VAR_41:\n", "VAR_42 = VAR_41.group(1).lower()\n", "VAR_101 = auto_decode(f.read())\n", "return VAR_3, VAR_101\n", "if VAR_42 == 'file' and VAR_5 and VAR_5.starts...
[ "def get_file_content(url, comes_from=None, session=None):...\n", "\"\"\"docstring\"\"\"\n", "if session is None:\n", "match = _scheme_re.search(url)\n", "if match:\n", "scheme = match.group(1).lower()\n", "content = auto_decode(f.read())\n", "return url, content\n", "if scheme == 'file' and comes_f...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_3(self):...\n", "if self.request.protocol == 'http':\n", "if self.request.host == 'rtxcomplete.ixlab.org':\n", "self.redirect('https://' + self.request.host, permanent=False)\n" ]
[ "def prepare(self):...\n", "if self.request.protocol == 'http':\n", "if self.request.host == 'rtxcomplete.ixlab.org':\n", "self.redirect('https://' + self.request.host, permanent=False)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'" ]
[ "@VAR_2.route('/search', methods=['GET'])...\n", "VAR_17 = request.args.get('query')\n", "if VAR_17:\n", "return redirect(url_for('web.books_list', VAR_8='search', VAR_20='stored',\n VAR_56=term))\n", "return render_title_template('search.html', VAR_35='', VAR_77=0, VAR_150=_(\n u'Search'), VAR_9='sea...
[ "@web.route('/search', methods=['GET'])...\n", "term = request.args.get('query')\n", "if term:\n", "return redirect(url_for('web.books_list', data='search', sort_param=\n 'stored', query=term))\n", "return render_title_template('search.html', searchterm='', result_count=0,\n title=_(u'Search'), page='...
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_26(self, VAR_22):...\n", "return CLASS_7(self)\n" ]
[ "def buildProtocol(self, addr):...\n", "return FakeRedisPubSubProtocol(self)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_40):...\n", "self.is_authenticated = True\n", "self.is_active = True\n", "self.is_anonymous = False\n", "self.id = VAR_40\n" ]
[ "def __init__(self, id):...\n", "self.is_authenticated = True\n", "self.is_active = True\n", "self.is_anonymous = False\n", "self.id = id\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_13(VAR_22, VAR_23: Element) ->Union[Any, Type[NoValue]]:...\n", "VAR_23.component_instance.component_name = self.name\n", "VAR_23.component_instance.form_id = current_form_id(VAR_22)\n", "if self.url is not None:\n", "VAR_23.component_instance.url = self.url\n", "def FUNC_14():...\n", "VAR_23....
[ "def marshall_component(dg, element: Element) ->Union[Any, Type[NoValue]]:...\n", "element.component_instance.component_name = self.name\n", "element.component_instance.form_id = current_form_id(dg)\n", "if self.url is not None:\n", "element.component_instance.url = self.url\n", "def marshall_element_args...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "FunctionDef'", "Assign'", "Expr'", "Condition", "Expr'", "FunctionDef'", "Return'" ]
[ "@def_function.function...\n", "if VAR_56:\n", "return VAR_54 + VAR_55\n", "return VAR_54 * VAR_55\n" ]
[ "@def_function.function...\n", "if c:\n", "return a + b\n", "return a * b\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "async def FUNC_4(VAR_5, VAR_6, VAR_7, VAR_8=None, VAR_9=0):...\n", "if VAR_6.startswith('/_matrix/federation/v1/get_missing_events/'):\n", "return {'events': []}\n", "self.http_client.post_json = FUNC_4\n", "VAR_3 = self.get_success(self.store.get_la...
[ "def test_cant_hide_direct_ancestors(self):...\n", "\"\"\"docstring\"\"\"\n", "async def post_json(destination, path, data, headers=None, timeout=0):...\n", "if path.startswith('/_matrix/federation/v1/get_missing_events/'):\n", "return {'events': []}\n", "self.http_client.post_json = post_json\n", "most...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "AsyncFunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def __init__(self, **VAR_24):...\n", "for name, value in VAR_24.items():\n", "if not hasattr(self, name):\n", "if self.inline_style is None and 'inline_style' not in VAR_24:\n", "setattr(self, name, value)\n", "self.inline_style = self.style\n" ]
[ "def __init__(self, **kw):...\n", "for name, value in kw.items():\n", "if not hasattr(self, name):\n", "if self.inline_style is None and 'inline_style' not in kw:\n", "setattr(self, name, value)\n", "self.inline_style = self.style\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Condition", "Expr'", "Assign'" ]
[ "def FUNC_32(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_27 = widgets.AdminDateWidget()\n", "self.assertHTMLEqual(conditional_escape(VAR_27.render('test', datetime(2007,\n 12, 1, 9, 30))),\n '<input value=\"2007-12-01\" type=\"text\" class=\"vDateField\" name=\"test\" size=\"10\" />'\n )\n", "VAR...
[ "def test_attrs(self):...\n", "\"\"\"docstring\"\"\"\n", "w = widgets.AdminDateWidget()\n", "self.assertHTMLEqual(conditional_escape(w.render('test', datetime(2007, 12,\n 1, 9, 30))),\n '<input value=\"2007-12-01\" type=\"text\" class=\"vDateField\" name=\"test\" size=\"10\" />'\n )\n", "w = widget...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@cached_property...\n", "return str(pathlib.PurePosixPath(self.upload_path, base64.urlsafe_b64encode\n (uuid.uuid4().bytes).decode('utf-8').rstrip('=\\n')))\n" ]
[ "@cached_property...\n", "return str(pathlib.PurePosixPath(self.upload_path, base64.urlsafe_b64encode\n (uuid.uuid4().bytes).decode('utf-8').rstrip('=\\n')))\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_36(self):...\n", "VAR_30 = models.Inventory.objects.create(barcode=86, name='Apple')\n", "models.Inventory.objects.create(barcode=22, name='Pear')\n", "VAR_31 = models.Inventory.objects.create(barcode=87, name='Core', parent=apple)\n", "VAR_29 = models.Inventory._meta.get_field('parent').rel\n", ...
[ "def test_relations_to_non_primary_key(self):...\n", "apple = models.Inventory.objects.create(barcode=86, name='Apple')\n", "models.Inventory.objects.create(barcode=22, name='Pear')\n", "core = models.Inventory.objects.create(barcode=87, name='Core', parent=apple)\n", "rel = models.Inventory._meta.get_field...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_3(VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_4 not in ['instructor', 'staff']:\n", "def FUNC_84(VAR_1):...\n", "def FUNC_83(*VAR_2, **VAR_3):...\n", "VAR_9 = VAR_2[0]\n", "VAR_65 = get_course_by_id(CourseKey.from_string(VAR_3['course_id']))\n", "if has_access(VAR_9.user, VAR_4, VAR_65...
[ "def require_level(level):...\n", "\"\"\"docstring\"\"\"\n", "if level not in ['instructor', 'staff']:\n", "def decorator(func):...\n", "def wrapped(*args, **kwargs):...\n", "request = args[0]\n", "course = get_course_by_id(CourseKey.from_string(kwargs['course_id']))\n", "if has_access(request.user, l...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "FunctionDef'", "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_3(VAR_10: Dependant, VAR_12: Optional[ModelField]=None, VAR_13:...\n", "assert VAR_10.call is not None, 'dependant.call must be a function'\n", "VAR_9 = asyncio.iscoroutinefunction(VAR_10.call)\n", "VAR_23 = VAR_12 and isinstance(VAR_12.field_info, params.Form)\n", "if isinstance(VAR_14, DefaultPl...
[ "def get_request_handler(dependant: Dependant, body_field: Optional[...\n", "assert dependant.call is not None, 'dependant.call must be a function'\n", "is_coroutine = asyncio.iscoroutinefunction(dependant.call)\n", "is_body_form = body_field and isinstance(body_field.field_info, params.Form)\n", "if isinst...
[ 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assert'", "Assign'", "Assign'", "Condition", "AnnAssign'", "Assign'", "AsyncFunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Condition", "Condition", "Assign'", "Condition", "...
[ "def FUNC_14():...\n", "VAR_43 = f.readline()\n", "VAR_43 = '/'.join(VAR_43.split('/')[:-2])\n", "VAR_33 = []\n", "for c in VAR_32:\n", "VAR_33.append(FUNC_10(VAR_43 + '/' + c.strip()))\n", "return VAR_33\n" ]
[ "def get_class_path():...\n", "dataset_path = f.readline()\n", "dataset_path = '/'.join(dataset_path.split('/')[:-2])\n", "class_paths = []\n", "for c in classes_list:\n", "class_paths.append(_get_obj_absolute_path(dataset_path + '/' + c.strip()))\n", "return class_paths\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_26(self, VAR_15, VAR_13):...\n", "VAR_25 = []\n", "for row in VAR_15:\n", "if isinstance(row, (list, tuple)):\n", "return VAR_25\n", "VAR_42 = frappe._dict()\n", "if isinstance(row, dict):\n", "for VAR_43, val in enumerate(row):\n", "VAR_42 = frappe._dict(row)\n", "VAR_25.append(VAR_42)\...
[ "def build_data_dict(self, result, columns):...\n", "data = []\n", "for row in result:\n", "if isinstance(row, (list, tuple)):\n", "return data\n", "_row = frappe._dict()\n", "if isinstance(row, dict):\n", "for i, val in enumerate(row):\n", "_row = frappe._dict(row)\n", "data.append(_row)\n", "_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Assign'", "Condition", "For", "Assign'", "Expr'", "Assign'" ]
[ "@VAR_2.route('/tasks')...\n", "VAR_51 = WorkerThread.getInstance().tasks\n", "VAR_88 = render_task_status(VAR_51)\n", "return render_title_template('tasks.html', VAR_63=answer, VAR_149=_(\n u'Tasks'), VAR_9='tasks')\n" ]
[ "@web.route('/tasks')...\n", "tasks = WorkerThread.getInstance().tasks\n", "answer = render_task_status(tasks)\n", "return render_title_template('tasks.html', entries=answer, title=_(u'Tasks'\n ), page='tasks')\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_10, VAR_11='detail', VAR_12=None, VAR_13=None, VAR_14=None,...\n", "\"\"\"docstring\"\"\"\n", "for module in get_modules():\n", "VAR_18 = module.get_model_url(VAR_10, VAR_11, VAR_14)\n", "if not VAR_18:\n", "if VAR_12 is None:\n", "return VAR_18\n", "from shuup.utils.django_compat impo...
[ "def get_model_url(object, kind='detail', user=None, required_permissions=...\n", "\"\"\"docstring\"\"\"\n", "for module in get_modules():\n", "url = module.get_model_url(object, kind, shop)\n", "if not url:\n", "if user is None:\n", "return url\n", "from shuup.utils.django_compat import Resolver404, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "For", "Assign'", "Condition", "Condition", "Return'", "ImportFrom'", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "ImportFrom'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "ImportFrom'", "Assign'" ]
[ "@VAR_2.route('/advsearch', methods=['POST'])...\n", "VAR_89 = dict(request.form)\n", "VAR_90 = ['include_tag', 'exclude_tag', 'include_serie', 'exclude_serie',\n 'include_shelf', 'exclude_shelf', 'include_language',\n 'exclude_language', 'include_extension', 'exclude_extension']\n", "for VAR_110 in VAR...
[ "@web.route('/advsearch', methods=['POST'])...\n", "values = dict(request.form)\n", "params = ['include_tag', 'exclude_tag', 'include_serie', 'exclude_serie',\n 'include_shelf', 'exclude_shelf', 'include_language',\n 'exclude_language', 'include_extension', 'exclude_extension']\n", "for param in params:...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6(self):...\n", "self.get_success(self.inject_room_member(self.room1, self.u_alice,\n Membership.JOIN))\n", "VAR_16 = self.get_success(self.inject_room_member(self.room1, self.u_bob,\n Membership.JOIN, VAR_7={'blue': 'red'}))\n", "VAR_14 = self.get_success(self.store.get_event(VAR_16.event_id)...
[ "def test_redact_join(self):...\n", "self.get_success(self.inject_room_member(self.room1, self.u_alice,\n Membership.JOIN))\n", "msg_event = self.get_success(self.inject_room_member(self.room1, self.u_bob,\n Membership.JOIN, extra_content={'blue': 'red'}))\n", "event = self.get_success(self.store.get_ev...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_19():...\n", "VAR_84 = VAR_1\n", "VAR_1 = None\n", "if VAR_84:\n", "VAR_84.close()\n", "if VAR_84.bind:\n", "VAR_84.bind.dispose()\n" ]
[ "def dispose():...\n", "old_session = session\n", "session = None\n", "if old_session:\n", "old_session.close()\n", "if old_session.bind:\n", "old_session.bind.dispose()\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "from __future__ import division, print_function, unicode_literals\n", "import os\n", "from datetime import datetime\n", "import json\n", "import mimetypes\n", "import chardet\n", "import copy\n", "from babel.dates import format_date\n", "from babel import Locale as LC\n", "from babel.core import ...
[ "from __future__ import division, print_function, unicode_literals\n", "import os\n", "from datetime import datetime\n", "import json\n", "import mimetypes\n", "import chardet\n", "import copy\n", "from babel.dates import format_date\n", "from babel import Locale as LC\n", "from babel.core import ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'"...
[ "async def FUNC_9(self, VAR_23: str, VAR_31: Any, VAR_24: Optional[...\n", "\"\"\"docstring\"\"\"\n", "VAR_48 = encode_canonical_json(VAR_31)\n", "VAR_0.debug('HTTP POST %s -> %s', VAR_48, VAR_23)\n", "VAR_46 = {b'Content-Type': [b'application/json'], b'User-Agent': [self.\n user_agent], b'Accept': [b'ap...
[ "async def post_json_get_json(self, uri: str, post_json: Any, headers:...\n", "\"\"\"docstring\"\"\"\n", "json_str = encode_canonical_json(post_json)\n", "logger.debug('HTTP POST %s -> %s', json_str, uri)\n", "actual_headers = {b'Content-Type': [b'application/json'], b'User-Agent': [\n self.user_agent], ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_3(self, *, VAR_4: str) ->Set[str]:...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = super().get_imports(VAR_4=prefix)\n", "VAR_8.update(self.inner_property.get_imports(VAR_4=prefix))\n", "VAR_8.add('from typing import List')\n", "if self.default is not None:\n", "VAR_8.add('from dataclasses import f...
[ "def get_imports(self, *, prefix: str) ->Set[str]:...\n", "\"\"\"docstring\"\"\"\n", "imports = super().get_imports(prefix=prefix)\n", "imports.update(self.inner_property.get_imports(prefix=prefix))\n", "imports.add('from typing import List')\n", "if self.default is not None:\n", "imports.add('from data...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Return'", "Expr'" ]
[ "def __call__(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_56 = VAR_263.request\n", "VAR_11 = VAR_56.args\n", "if not VAR_11:\n", "redirect(self.url(VAR_11='login', VAR_96=request.vars))\n", "if VAR_11[0] in self.settings.actions_disabled:\n", "if VAR_11[0] in ('login', 'logout', 'register', 'verify_...
[ "def __call__(self):...\n", "\"\"\"docstring\"\"\"\n", "request = current.request\n", "args = request.args\n", "if not args:\n", "redirect(self.url(args='login', vars=request.vars))\n", "if args[0] in self.settings.actions_disabled:\n", "if args[0] in ('login', 'logout', 'register', 'verify_email',\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 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Condition", "Condition", "Condition", "Return'", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Cond...
[ "def FUNC_45(VAR_136):...\n", "VAR_28 = VAR_18[VAR_117]['entries'][VAR_136]\n", "VAR_140 = FUNC_44(VAR_28, 'order', VAR_122=None)\n", "return VAR_140 is None, sv(VAR_140), sv(VAR_134(VAR_28, VAR_135))\n" ]
[ "def key_func(x):...\n", "config = templates[t]['entries'][x]\n", "entry_order = config_extractor(config, 'order', default_value=None)\n", "return entry_order is None, sv(entry_order), sv(extractor(config, sort_key))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_1(self, VAR_3, VAR_4, VAR_6):...\n", "self.user_id = self.register_user('user', 'pass')\n", "self.access_token = self.login('user', 'pass')\n", "self.other_user_id = self.register_user('otheruser', 'pass')\n", "self.other_access_token = self.login('otheruser', 'pass')\n", "self.room = self.helpe...
[ "def prepare(self, reactor, clock, hs):...\n", "self.user_id = self.register_user('user', 'pass')\n", "self.access_token = self.login('user', 'pass')\n", "self.other_user_id = self.register_user('otheruser', 'pass')\n", "self.other_access_token = self.login('otheruser', 'pass')\n", "self.room = self.helpe...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@VAR_1.route('/<bfile>/help/', defaults={'page_slug': '_index'})...\n", "\"\"\"docstring\"\"\"\n", "if VAR_21 not in HELP_PAGES:\n", "abort(404)\n", "VAR_32 = markdown2.markdown_path(resource_path('help') / (VAR_21 + '.md'),\n extras=['fenced-code-blocks', 'tables', 'header-ids'])\n", "return render_t...
[ "@app.route('/<bfile>/help/', defaults={'page_slug': '_index'})...\n", "\"\"\"docstring\"\"\"\n", "if page_slug not in HELP_PAGES:\n", "abort(404)\n", "html = markdown2.markdown_path(resource_path('help') / (page_slug + '.md'),\n extras=['fenced-code-blocks', 'tables', 'header-ids'])\n", "return render...
[ 0, 0, 0, 0, 0, 2 ]
[ "Condition", "Docstring", "Condition", "Expr'", "Assign'", "Return'" ]
[ "\"\"\"Proxy AMI-related calls from cloud controller to objectstore service.\"\"\"\n", "import binascii\n", "import os\n", "import shutil\n", "import tarfile\n", "import tempfile\n", "from xml.etree import ElementTree\n", "import boto.s3.connection\n", "import eventlet\n", "from nova import crypto...
[ "\"\"\"Proxy AMI-related calls from cloud controller to objectstore service.\"\"\"\n", "import binascii\n", "import os\n", "import shutil\n", "import tarfile\n", "import tempfile\n", "from xml.etree import ElementTree\n", "import boto.s3.connection\n", "import eventlet\n", "from nova import crypto...
[ 0, 0, 0, 0, 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'", "ImportFrom'", "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = VAR_2.session['connector'].server_id\n", "VAR_64 = FUNC_13(VAR_2, VAR_6, VAR_19=server_id, VAR_8=conn)\n", "if VAR_64 is None:\n", "VAR_92, VAR_16 = VAR_64\n", "VAR_60 = webgateway_cache.getImage(VAR_2, VAR_19, VAR_92, VAR_22, VAR_23)\n", ...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "server_id = request.session['connector'].server_id\n", "pi = _get_prepared_image(request, iid, server_id=server_id, conn=conn)\n", "if pi is None:\n", "img, compress_quality = pi\n", "jpeg_data = webgateway_cache.getImage(request, server_id, img, z, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assi...
[ "def FUNC_3(self, VAR_13):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_13\n" ]
[ "def to_python(self, value):...\n", "\"\"\"docstring\"\"\"\n", "return value\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_34(VAR_38, VAR_39):...\n", "if VAR_38 != _(u'Unknown') and VAR_39 != _(u'Unknown'):\n", "VAR_96 = calibre_db.check_exists_book(VAR_39, VAR_38)\n", "VAR_63 = VAR_39.split('&')\n", "if VAR_96:\n", "VAR_63 = list(map(lambda it: it.strip().replace(',', '|'), VAR_63))\n", "VAR_1.info('Uploaded book...
[ "def prepare_authors_on_upload(title, authr):...\n", "if title != _(u'Unknown') and authr != _(u'Unknown'):\n", "entry = calibre_db.check_exists_book(authr, title)\n", "input_authors = authr.split('&')\n", "if entry:\n", "input_authors = list(map(lambda it: it.strip().replace(',', '|'),\n input_authors...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'...
[ "def FUNC_0(self, VAR_1, VAR_2, VAR_3, **VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "for k in VAR_4:\n", "setattr(CLASS_25, k, VAR_4[k])\n", "VAR_16 = CLASS_25(VAR_1, admin.site)\n", "VAR_17 = VAR_16.formfield_for_dbfield(VAR_1._meta.get_field(VAR_2), request\n =None)\n", "if isinstance(VAR_17.widget,...
[ "def assertFormfield(self, model, fieldname, widgetclass, **admin_overrides):...\n", "\"\"\"docstring\"\"\"\n", "for k in admin_overrides:\n", "setattr(MyModelAdmin, k, admin_overrides[k])\n", "ma = MyModelAdmin(model, admin.site)\n", "ff = ma.formfield_for_dbfield(model._meta.get_field(fieldname), reques...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_2(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = wikiutil.getLocalizedPage(VAR_0, 'HelpOnMacros')\n", "VAR_6 = VAR_5.get_raw_body()\n", "VAR_7 = re.compile('\\\\|\\\\|(<.*?>)?\\\\{\\\\{\\\\{' +\n '<<(?P<prototype>(?P<macro>\\\\w*).*)>>' + '\\\\}\\\\}\\\\}\\\\s*\\\\|\\\\|' +\n '[^|]*\\\\|...
[ "def get_macro_help(request):...\n", "\"\"\"docstring\"\"\"\n", "helppage = wikiutil.getLocalizedPage(request, 'HelpOnMacros')\n", "content = helppage.get_raw_body()\n", "macro_re = re.compile('\\\\|\\\\|(<.*?>)?\\\\{\\\\{\\\\{' +\n '<<(?P<prototype>(?P<macro>\\\\w*).*)>>' + '\\\\}\\\\}\\\\}\\\\s*\\\\|\\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'" ]
[ "def FUNC_8(VAR_20):...\n", "\"\"\"docstring\"\"\"\n", "return FUNC_7(VAR_20)\n" ]
[ "def parse_http_date_safe(date):...\n", "\"\"\"docstring\"\"\"\n", "return parse_http_date(date)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_81(VAR_62, VAR_143=True):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.desk.reportview\n", "return frappe.desk.reportview.build_match_conditions(VAR_62, VAR_143=\n as_condition)\n" ]
[ "def build_match_conditions(doctype, as_condition=True):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.desk.reportview\n", "return frappe.desk.reportview.build_match_conditions(doctype, as_condition=\n as_condition)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Return'" ]
[ "def FUNC_146(self, VAR_215):...\n", "VAR_56, VAR_244, VAR_101 = VAR_263.request, VAR_263.response, self.auth.db\n", "VAR_340 = VAR_101.wiki_media(VAR_215)\n", "if VAR_340:\n", "if self.settings.manage_permissions:\n", "VAR_212 = VAR_101.wiki_page(VAR_340.wiki_page)\n", "VAR_56.args = [VAR_340.filename]...
[ "def media(self, id):...\n", "request, response, db = current.request, current.response, self.auth.db\n", "media = db.wiki_media(id)\n", "if media:\n", "if self.settings.manage_permissions:\n", "page = db.wiki_page(media.wiki_page)\n", "request.args = [media.filename]\n", "if not self.can_read(page):\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_5(self, VAR_7):...\n", "signedjson.sign.sign_json(VAR_7, self.server_name, self.key)\n" ]
[ "def sign_response(self, res):...\n", "signedjson.sign.sign_json(res, self.server_name, self.key)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "import os\n", "import re\n", "import pipes\n", "import shutil\n", "import sys\n", "from distutils import log\n", "from distutils.cmd import Command\n", "from fnmatch import fnmatch\n", "from glob import glob\n", "from multiprocessing.pool import ThreadPool\n", "from su...
[ "\"\"\"\nThis module defines the things that are used in setup.py for building the notebook\n\nThis includes:\n\n * Functions for finding things like packages, package data, etc.\n * A function for checking dependencies.\n\"\"\"\n", "import os\n", "import re\n", "import pipes\n", "import shutil\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "For", "ImportFrom'", "FunctionDef'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Expr'", ...
[ "def FUNC_15(VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "VAR_39 = FUNC_14(VAR_18)\n", "for VAR_68, example_list in VAR_39.items():\n", "if not isinstance(example_list, list):\n", "return VAR_39\n", "VAR_39[VAR_68] = [FUNC_16(VAR_41) for VAR_41 in example_list]\n" ]
[ "def preprocess_input_examples_arg_string(input_examples_str):...\n", "\"\"\"docstring\"\"\"\n", "input_dict = preprocess_input_exprs_arg_string(input_examples_str)\n", "for input_key, example_list in input_dict.items():\n", "if not isinstance(example_list, list):\n", "return input_dict\n", "input_dict[...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Assign'" ]
[ "def FUNC_15(self, VAR_44):...\n", "self.tokens.append({'type': 'block_quote_start'})\n", "VAR_45 = VAR_4.sub('', VAR_44.group(0))\n", "self.parse(VAR_45)\n", "self.tokens.append({'type': 'block_quote_end'})\n" ]
[ "def parse_block_quote(self, m):...\n", "self.tokens.append({'type': 'block_quote_start'})\n", "cap = _block_quote_leading_pattern.sub('', m.group(0))\n", "self.parse(cap)\n", "self.tokens.append({'type': 'block_quote_end'})\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_83(VAR_62, *VAR_79, **VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "VAR_42['ignore_permissions'] = True\n", "if not 'limit_page_length' in VAR_42:\n", "VAR_42['limit_page_length'] = 0\n", "return FUNC_82(VAR_62, *VAR_79, **kwargs)\n" ]
[ "def get_all(doctype, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "kwargs['ignore_permissions'] = True\n", "if not 'limit_page_length' in kwargs:\n", "kwargs['limit_page_length'] = 0\n", "return get_list(doctype, *args, **kwargs)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'" ]
[ "@VAR_1.route('/admin/book/<int:book_id>', methods=['GET', 'POST'])...\n", "VAR_39 = False\n", "calibre_db.update_title_sort(config)\n", "VAR_2.debug_or_exception(e)\n", "if VAR_32.method != 'POST':\n", "calibre_db.session.rollback()\n", "return FUNC_14(VAR_15)\n", "VAR_17 = calibre_db.get_filtered_bo...
[ "@editbook.route('/admin/book/<int:book_id>', methods=['GET', 'POST'])...\n", "modif_date = False\n", "calibre_db.update_title_sort(config)\n", "log.debug_or_exception(e)\n", "if request.method != 'POST':\n", "calibre_db.session.rollback()\n", "return render_edit_book(book_id)\n", "book = calibre_db.g...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Condition", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Return'", "Assign'", "Condition", "Expr'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Return'", "Assign'", "Condition",...
[ "def FUNC_2(self, VAR_5, VAR_7):...\n", "return nova.db.api.s3_image_create(VAR_5, VAR_7)['id']\n" ]
[ "def _create_image_id(self, context, image_uuid):...\n", "return nova.db.api.s3_image_create(context, image_uuid)['id']\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_20(VAR_41, VAR_10=False, **VAR_42):...\n", "if VAR_10 == False:\n", "VAR_10 = VAR_18.user\n", "FUNC_93('eval_js', VAR_41, VAR_10=user, **kwargs)\n" ]
[ "def emit_js(js, user=False, **kwargs):...\n", "if user == False:\n", "user = session.user\n", "publish_realtime('eval_js', js, user=user, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'" ]