lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "def FUNC_3(self) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "return False\n" ]
[ "def hasDirectory(self) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "return False\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_4(VAR_17):...\n", "VAR_39 = []\n", "for VAR_23, VAR_17 in pluginManager.get_hooks(VAR_17).items():\n", "return VAR_39\n", "VAR_128 = VAR_17()\n", "VAR_0.exception(f'Error fetching theming CSS to include from plugin {VAR_23}',\n extra={'plugin': name})\n", "if isinstance(VAR_128, (tuple, lis...
[ "def _add_additional_assets(hook):...\n", "result = []\n", "for name, hook in pluginManager.get_hooks(hook).items():\n", "return result\n", "assets = hook()\n", "_logger.exception(f'Error fetching theming CSS to include from plugin {name}',\n extra={'plugin': name})\n", "if isinstance(assets, (tuple,...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Return'", "Assign'", "Expr'", "Condition", "AugAssign'" ]
[ "def FUNC_11(VAR_11):...\n", "return os.path.join(VAR_3, VAR_11)\n" ]
[ "def _get_index_absolute_path(index):...\n", "return os.path.join(INDEXDIR, index)\n" ]
[ 0, 1 ]
[ "FunctionDef'", "Return'" ]
[ "@pytest.mark.linux...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = ['--temp-basedir'] + FUNC_0(VAR_4.config) + ['/home/user/föö.html']\n", "VAR_6.start(VAR_11, VAR_16={'LC_ALL': 'C'}, wait_focus=False)\n", "if not VAR_4.config.webengine:\n", "VAR_18 = VAR_6.wait_for(message=\n 'Error while loading *: Erro...
[ "@pytest.mark.linux...\n", "\"\"\"docstring\"\"\"\n", "args = ['--temp-basedir'] + _base_args(request.config) + ['/home/user/föö.html'\n ]\n", "quteproc_new.start(args, env={'LC_ALL': 'C'}, wait_focus=False)\n", "if not request.config.webengine:\n", "line = quteproc_new.wait_for(message=\n 'Error wh...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_46(VAR_134):...\n", "def FUNC_47(VAR_136, VAR_38):...\n", "return VAR_134(VAR_136, VAR_38)\n", "VAR_0.exception('Error while extracting sorting keys for template {}'.\n format(VAR_117))\n", "return FUNC_47\n", "return None\n" ]
[ "def create_safe_extractor(extractor):...\n", "def f(x, k):...\n", "return extractor(x, k)\n", "_logger.exception('Error while extracting sorting keys for template {}'.\n format(t))\n", "return f\n", "return None\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Return'", "Expr'", "Return'", "Return'" ]
[ "@staticmethod...\n", "VAR_26 = VAR_13(VAR_24.text)\n", "if not VAR_26:\n" ]
[ "@staticmethod...\n", "is_valid = function(document.text)\n", "if not is_valid:\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Condition" ]
[ "def FUNC_14(VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = QUrlQuery(VAR_3)\n", "VAR_24 = VAR_17.queryItemValue('option', QUrl.FullyDecoded)\n", "VAR_25 = VAR_17.queryItemValue('value', QUrl.FullyDecoded)\n", "if VAR_24 == 'content.javascript.enabled' and VAR_25 == 'false':\n", "VAR_40 = (\n 'R...
[ "def _qute_settings_set(url):...\n", "\"\"\"docstring\"\"\"\n", "query = QUrlQuery(url)\n", "option = query.queryItemValue('option', QUrl.FullyDecoded)\n", "value = query.queryItemValue('value', QUrl.FullyDecoded)\n", "if option == 'content.javascript.enabled' and value == 'false':\n", "msg = (\n 'Re...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Return'", "Return'", "Return'" ]
[ "def FUNC_44(self):...\n", "return json.dumps(audiotranscode.getEncoders())\n" ]
[ "def api_getencoders(self):...\n", "return json.dumps(audiotranscode.getEncoders())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_8.route('/api/', methods=['GET'])...\n", "VAR_50 = [type(inp) for inp in VAR_8.interface.input_components]\n", "VAR_51 = [type(out) for out in VAR_8.interface.output_components]\n", "VAR_52, VAR_53 = FUNC_11(VAR_50, 'input')\n", "VAR_54, VAR_55 = FUNC_11(VAR_51, 'output')\n", "VAR_56 = [type(inp).__...
[ "@app.route('/api/', methods=['GET'])...\n", "inputs = [type(inp) for inp in app.interface.input_components]\n", "outputs = [type(out) for out in app.interface.output_components]\n", "input_types_doc, input_types = get_types(inputs, 'input')\n", "output_types_doc, output_types = get_types(outputs, 'output')...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def __getstate__(self):...\n", "return self\n" ]
[ "def __getstate__(self):...\n", "return self\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_38(self):...\n", "from django.urls import reverse\n", "return str(reverse('helpdesk:list')) + '?kbitem=' + str(self.pk)\n" ]
[ "def query_url(self):...\n", "from django.urls import reverse\n", "return str(reverse('helpdesk:list')) + '?kbitem=' + str(self.pk)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_6['viewport_server'] = VAR_25 is not None and VAR_350('webindex'\n ) + VAR_25 or VAR_350('webindex')\n", "VAR_6['viewport_server'] = VAR_6['viewport_server'].rstrip('/')\n", "return webgateway_views.full_viewer(VAR_2, VAR_41, **kwargs)\n" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "kwargs['viewport_server'] = share_id is not None and reverse('webindex'\n ) + share_id or reverse('webindex')\n", "kwargs['viewport_server'] = kwargs['viewport_server'].rstrip('/')\n", "return webgateway_views.full_viewer(request, iid, **kwargs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "@VAR_2.route('/downloadlist')...\n", "if VAR_87.get_view_property('download', 'dir') == 'desc':\n", "VAR_10 = ub.User.name.desc()\n", "VAR_10 = ub.User.name.asc()\n", "VAR_109 = 0\n", "VAR_109 = 1\n", "if VAR_87.check_visibility(constants.SIDEBAR_DOWNLOAD) and VAR_87.role_admin():\n", "VAR_63 = ub.se...
[ "@web.route('/downloadlist')...\n", "if current_user.get_view_property('download', 'dir') == 'desc':\n", "order = ub.User.name.desc()\n", "order = ub.User.name.asc()\n", "order_no = 0\n", "order_no = 1\n", "if current_user.check_visibility(constants.SIDEBAR_DOWNLOAD\n", "entries = ub.session.query(ub....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_28(self):...\n", "self.parser = saved_model_cli.create_parser()\n", "VAR_9 = test.test_src_dir_path(VAR_0)\n", "VAR_41 = os.path.join(test.get_temp_dir(), 'new_dir')\n", "VAR_10 = self.parser.parse_args(['run', '--dir', VAR_9, '--tag_set',\n 'serve', '--signature_def', 'regress_x_to_y', '--inpu...
[ "def testRunCommandInputExamplesNotListError(self):...\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')\n", "args = self.parser.parse_args(['run', '--dir', base_path, '--tag_set',\n ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(self, VAR_1, VAR_2=None):...\n", "print('matched define search: not implemented')\n", "self.write('')\n" ]
[ "def get(self, arg, word=None):...\n", "print('matched define search: not implemented')\n", "self.write('')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_5(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_message(self.room1, self.u_alice, 't'))\n", "VAR_14 = self.get_success(self.store.get_event(VAR_16.event_id))\n", "self.assertObjectHasAttributes({'...
[ "def test_redact(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_message(self.room1, self.u_alice, 't')\n )\n", "event = self.get_success(self.store.get_event(msg_event.event_id))\n", "self.assertObject...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_17(self):...\n", "return {'id': self.id}\n" ]
[ "def to_json(self):...\n", "return {'id': self.id}\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(VAR_1: Type['pl.Trainer'], VAR_4: Union[ArgumentParser, Namespace]...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = VAR_4.parse_args() if isinstance(VAR_4, ArgumentParser) else VAR_4\n", "VAR_16 = {arg: (VAR_36, VAR_32) for arg, VAR_36, VAR_32 in FUNC_3(VAR_1)}\n", "VAR_17 = {}\n", "for VAR_28, VAR_...
[ "def parse_argparser(cls: Type['pl.Trainer'], arg_parser: Union[...\n", "\"\"\"docstring\"\"\"\n", "args = arg_parser.parse_args() if isinstance(arg_parser, ArgumentParser\n ) else arg_parser\n", "types_default = {arg: (arg_types, arg_default) for arg, arg_types,\n arg_default in get_init_arguments_and_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_4(VAR_9: Any, VAR_10: int) ->Any:...\n", "\"\"\"docstring\"\"\"\n", "if VAR_10 == 0:\n", "if isinstance(VAR_9, dict):\n", "return {key: FUNC_4(VAR_4, VAR_10 - 1) for key, VAR_4 in VAR_9.items()}\n", "if isinstance(VAR_9, list):\n", "return [FUNC_4(item, VAR_10 - 1) for item in VAR_9]\n", "if...
[ "def validate_json(json: Any, max_depth: int) ->Any:...\n", "\"\"\"docstring\"\"\"\n", "if max_depth == 0:\n", "if isinstance(json, dict):\n", "return {key: validate_json(value, max_depth - 1) for key, value in json.items()\n }\n", "if isinstance(json, list):\n", "return [validate_json(item, max_dept...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_117(VAR_10):...\n", "def FUNC_168(*VAR_9, **VAR_13):...\n", "VAR_27 = None\n", "VAR_27 = VAR_10(*VAR_9, **b)\n", "thread.start_new_thread(VAR_26, (VAR_27,))\n", "return FUNC_168\n", "return VAR_27\n" ]
[ "def _completion(f):...\n", "def __completion(*a, **b):...\n", "d = None\n", "d = f(*a, **b)\n", "thread.start_new_thread(callback, (d,))\n", "return __completion\n", "return d\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_29(VAR_90, VAR_51=False):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_1.flags.in_test:\n", "return\n", "if not isinstance(VAR_90, (tuple, list)):\n", "VAR_90 = VAR_90,\n", "VAR_90 = set(VAR_90)\n", "VAR_182 = set(FUNC_24())\n", "if not VAR_90.intersection(VAR_182):\n", "if VAR_51:\n", "F...
[ "def only_for(roles, message=False):...\n", "\"\"\"docstring\"\"\"\n", "if local.flags.in_test:\n", "return\n", "if not isinstance(roles, (tuple, list)):\n", "roles = roles,\n", "roles = set(roles)\n", "myroles = set(get_roles())\n", "if not roles.intersection(myroles):\n", "if message:\n", "msg...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Expr'" ]
[ "def FUNC_10(VAR_5, VAR_2, VAR_6, **VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_6:\n", "CLASS_15.objects.create(VAR_74=instance)\n" ]
[ "def create_usersettings(sender, instance, created, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "if created:\n", "UserSettings.objects.create(user=instance)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'" ]
[ "def FUNC_28(self):...\n", "VAR_11 = self.folder.t\n", "VAR_11.write(\"<p tal:define='p a//b' />\")\n", "VAR_11()\n" ]
[ "def testBadExpression(self):...\n", "t = self.folder.t\n", "t.write(\"<p tal:define='p a//b' />\")\n", "t()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "@defer.inlineCallbacks...\n", "self.mock_resource = MockHttpResource(prefix=PATH_PREFIX)\n", "self.mock_handler = Mock(spec=['get_displayname', 'set_displayname',\n 'get_avatar_url', 'set_avatar_url', 'check_profile_query_allowed'])\n", "self.mock_handler.get_displayname.return_value = defer.succeed(Mock(...
[ "@defer.inlineCallbacks...\n", "self.mock_resource = MockHttpResource(prefix=PATH_PREFIX)\n", "self.mock_handler = Mock(spec=['get_displayname', 'set_displayname',\n 'get_avatar_url', 'set_avatar_url', 'check_profile_query_allowed'])\n", "self.mock_handler.get_displayname.return_value = defer.succeed(Mock(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "AsyncFunctionDef'", "Return'" ]
[ "def FUNC_23(self):...\n", "VAR_19 = '{\"topic\":\"Seasons\",\"subtopic\":\"Summer\"}'\n", "VAR_22, VAR_23 = self.make_request('PUT', self.path, VAR_19)\n", "self.assertEquals(200, VAR_23.code, msg=channel.result['body'])\n", "VAR_22, VAR_23 = self.make_request('GET', self.path)\n", "self.assertEquals(200...
[ "def test_rooms_topic_with_extra_keys(self):...\n", "content = '{\"topic\":\"Seasons\",\"subtopic\":\"Summer\"}'\n", "request, channel = self.make_request('PUT', self.path, content)\n", "self.assertEquals(200, channel.code, msg=channel.result['body'])\n", "request, channel = self.make_request('GET', self.pa...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_2(VAR_4: Dict[str, Any]) ->Union[datetime, date]:...\n", "VAR_5: Union[datetime, date]\n", "VAR_5 = datetime.fromisoformat(VAR_0['aCamelDateTime'])\n", "VAR_5 = date.fromisoformat(VAR_0['aCamelDateTime'])\n", "return VAR_5\n", "return VAR_5\n" ]
[ "def _parse_a_camel_date_time(data: Dict[str, Any]) ->Union[datetime, date]:...\n", "a_camel_date_time: Union[datetime, date]\n", "a_camel_date_time = datetime.fromisoformat(d['aCamelDateTime'])\n", "a_camel_date_time = date.fromisoformat(d['aCamelDateTime'])\n", "return a_camel_date_time\n", "return a_ca...
[ 0, 5, 5, 5, 0, 0 ]
[ "FunctionDef'", "AnnAssign'", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_49(self, VAR_11=False):...\n", "\"\"\"docstring\"\"\"\n", "frappe.delete_doc(self.doctype, self.name, VAR_11=ignore_permissions, flags\n =self.flags)\n" ]
[ "def delete(self, ignore_permissions=False):...\n", "\"\"\"docstring\"\"\"\n", "frappe.delete_doc(self.doctype, self.name, ignore_permissions=\n ignore_permissions, flags=self.flags)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_51(VAR_21, VAR_26):...\n", "if VAR_26:\n", "if config.config_read_column:\n", "return VAR_21\n", "if VAR_26 == 'True':\n", "if VAR_26 == 'True':\n", "VAR_3.error(u'Custom Column No.%d is not existing in calibre database',\n config.config_read_column)\n", "VAR_21 = VAR_21.join(ub.ReadBook,...
[ "def adv_search_read_status(q, read_status):...\n", "if read_status:\n", "if config.config_read_column:\n", "return q\n", "if read_status == 'True':\n", "if read_status == 'True':\n", "log.error(u'Custom Column No.%d is not existing in calibre database',\n config.config_read_column)\n", "q = q.join...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "@staticmethod...\n", "return VAR_418.path.splitext(VAR_10)[-1].lower() in ('.png', '.jpg',\n '.jpeg', '.gif', '.tiff')\n" ]
[ "@staticmethod...\n", "return os.path.splitext(f)[-1].lower() in ('.png', '.jpg', '.jpeg', '.gif',\n '.tiff')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_39(self):...\n", "from zope.interface.verify import verifyObject\n", "from zope.tal.interfaces import ITALExpressionEngine\n", "verifyObject(ITALExpressionEngine, self._makeOne())\n" ]
[ "def test_instance_conforms_to_ITALExpressionEngine(self):...\n", "from zope.interface.verify import verifyObject\n", "from zope.tal.interfaces import ITALExpressionEngine\n", "verifyObject(ITALExpressionEngine, self._makeOne())\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "ImportFrom'", "Expr'" ]
[ "@FUNC_0...\n", "return RoomListHandler(self)\n" ]
[ "@cache_in_self...\n", "return RoomListHandler(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def __init__(self, VAR_25, VAR_26, VAR_11):...\n", "super().__init__()\n", "self.offendingText = VAR_25\n", "self.allTexts = VAR_26\n", "self.el = VAR_11\n" ]
[ "def __init__(self, offendingText, allTexts, el):...\n", "super().__init__()\n", "self.offendingText = offendingText\n", "self.allTexts = allTexts\n", "self.el = el\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_33(self):...\n", "\"\"\"docstring\"\"\"\n", "return json.dumps(cherry.config['media.playable'])\n" ]
[ "def api_getplayables(self):...\n", "\"\"\"docstring\"\"\"\n", "return json.dumps(cherry.config['media.playable'])\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_43(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def init_components(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_0():...\n", "return tornado.web.Application([('/autofuzzy(.*)', CLASS_2), ('/auto(.*)',\n CLASS_0), ('/fuzzy(.*)', CLASS_1), ('/define(.*)', CLASS_4), (\n '/nodeslike(.*)', CLASS_3), ('/(.*)', tornado.web.StaticFileHandler, {\n 'path': VAR_0, 'default_filename': 'rtxcomplete.html'})],\n comp...
[ "def make_https_app():...\n", "return tornado.web.Application([('/autofuzzy(.*)', autofuzzySearch), (\n '/auto(.*)', autoSearch), ('/fuzzy(.*)', fuzzySearch), ('/define(.*)',\n defineSearch), ('/nodeslike(.*)', nodesLikeSearch), ('/(.*)', tornado.\n web.StaticFileHandler, {'path': root, 'default_filename...
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_3(VAR_3, VAR_4, VAR_5):...\n", "VAR_9 = []\n", "for inp_element in VAR_5:\n", "VAR_83 = False\n", "return VAR_9\n", "for c_elements in VAR_3:\n", "if VAR_4 == 'languages':\n", "if not VAR_83:\n", "VAR_100 = c_elements.lang_code\n", "if VAR_4 == 'custom':\n", "VAR_9.append(inp_element)\...
[ "def search_objects_add(db_book_object, db_type, input_elements):...\n", "add_elements = []\n", "for inp_element in input_elements:\n", "found = False\n", "return add_elements\n", "for c_elements in db_book_object:\n", "if db_type == 'languages':\n", "if not found:\n", "type_elements = c_elements.la...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "For", "Condition", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_18(self):...\n", "self.assertFormfield(models.Member, 'gender', forms.Select)\n" ]
[ "def testFieldWithChoices(self):...\n", "self.assertFormfield(models.Member, 'gender', forms.Select)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@require_POST...\n", "VAR_3 = get_object_or_404(Topic, VAR_2=topic_id)\n", "VAR_4 = FavoriteForm(user=request.user, VAR_3=topic, data=request.POST)\n", "if VAR_4.is_valid():\n", "VAR_4.save()\n", "messages.error(VAR_0, utils.render_form_errors(VAR_4))\n", "return redirect(VAR_0.POST.get('next', VAR_3.g...
[ "@require_POST...\n", "topic = get_object_or_404(Topic, pk=topic_id)\n", "form = FavoriteForm(user=request.user, topic=topic, data=request.POST)\n", "if form.is_valid():\n", "form.save()\n", "messages.error(request, utils.render_form_errors(form))\n", "return redirect(request.POST.get('next', topic.get_...
[ 0, 0, 0, 0, 0, 0, 4 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_3(self, VAR_3):...\n", "os.umask(0)\n", "VAR_153 = 'helpdesk/attachments/kb/{category}/{kbi}'.format(VAR_99=self.\n kbitem.category, kbi=self.kbitem.id)\n", "VAR_154 = os.path.join(settings.MEDIA_ROOT, VAR_153)\n", "if settings.DEFAULT_FILE_STORAGE == 'django.core.files.storage.FileSystemStorag...
[ "def attachment_path(self, filename):...\n", "os.umask(0)\n", "path = 'helpdesk/attachments/kb/{category}/{kbi}'.format(category=self.\n kbitem.category, kbi=self.kbitem.id)\n", "att_path = os.path.join(settings.MEDIA_ROOT, path)\n", "if settings.DEFAULT_FILE_STORAGE == 'django.core.files.storage.FileSys...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Condition", "Condition", "Return'", "Expr'" ]
[ "def FUNC_9(self):...\n", "VAR_19 = meta_graph_pb2.TensorInfo()\n", "VAR_19.dtype = types_pb2.DT_FLOAT_REF\n", "saved_model_cli._print_tensor_info(VAR_19)\n", "self.assertTrue('DT_FLOAT_REF' in out.getvalue().strip())\n", "self.assertEqual(err.getvalue().strip(), '')\n" ]
[ "def testPrintREFTypeTensor(self):...\n", "ref_tensor_info = meta_graph_pb2.TensorInfo()\n", "ref_tensor_info.dtype = types_pb2.DT_FLOAT_REF\n", "saved_model_cli._print_tensor_info(ref_tensor_info)\n", "self.assertTrue('DT_FLOAT_REF' in out.getvalue().strip())\n", "self.assertEqual(err.getvalue().strip(),...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_25(self, VAR_23):...\n", "VAR_53.session['playlist'] = VAR_23\n" ]
[ "def api_rememberplaylist(self, playlist):...\n", "cherrypy.session['playlist'] = playlist\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_80(self, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "return self.handle_not_logged_in(VAR_2)\n" ]
[ "def get(self, request):...\n", "\"\"\"docstring\"\"\"\n", "return self.handle_not_logged_in(request)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_1(VAR_3: Inventory, VAR_4: (datetime.date | None)=None) ->Any:...\n", "\"\"\"docstring\"\"\"\n", "return cost_or_value_without_context(VAR_3, g.conversion, g.ledger.\n price_map, VAR_4)\n" ]
[ "def cost_or_value(inventory: Inventory, date: (datetime.date | None)=None...\n", "\"\"\"docstring\"\"\"\n", "return cost_or_value_without_context(inventory, g.conversion, g.ledger.\n price_map, date)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_38(VAR_47):...\n", "return VAR_47\n" ]
[ "def fake_wrapper_session(sess):...\n", "return sess\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_20(VAR_25, VAR_17, VAR_26=False, VAR_27=None):...\n", "VAR_59 = VAR_25.split(',')\n", "VAR_60 = []\n", "if not VAR_26:\n", "VAR_61 = isoLanguages.get_language_codes(get_locale(), VAR_59, VAR_60)\n", "VAR_61 = isoLanguages.get_valid_language_codes(get_locale(), VAR_59, VAR_60)\n", "for l in VAR...
[ "def edit_book_languages(languages, book, upload=False, invalid=None):...\n", "input_languages = languages.split(',')\n", "unknown_languages = []\n", "if not upload:\n", "input_l = isoLanguages.get_language_codes(get_locale(), input_languages,\n unknown_languages)\n", "input_l = isoLanguages.get_valid_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Expr'", "Condition", "Condition", "Condition", "Assign'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "async def FUNC_6(self):...\n", "if not hasattr(self, 'record_id'):\n", "self.record_id = await self.get_resolved_ref()\n", "VAR_36 = self.spec.split('zenodo')[0] + 'zenodo.' + self.record_id\n", "return VAR_36\n" ]
[ "async def get_resolved_spec(self):...\n", "if not hasattr(self, 'record_id'):\n", "self.record_id = await self.get_resolved_ref()\n", "resolved_spec = self.spec.split('zenodo')[0] + 'zenodo.' + self.record_id\n", "return resolved_spec\n" ]
[ 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_26(self):...\n", "VAR_9 = self._makeEngine()\n", "VAR_5 = self._makeContext()\n", "VAR_10 = VAR_5.evaluate(VAR_9.compile('string:x'))\n", "self.assertEqual(VAR_10, 'x')\n", "self.assertIsInstance(VAR_10, str)\n" ]
[ "def test_unicode(self):...\n", "eng = self._makeEngine()\n", "ec = self._makeContext()\n", "result = ec.evaluate(eng.compile('string:x'))\n", "self.assertEqual(result, 'x')\n", "self.assertIsInstance(result, str)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_0(VAR_2):...\n", "return Static(template('obj', VAR_2=Symbol(obj), mode='eval'))\n" ]
[ "def static(obj):...\n", "return Static(template('obj', obj=Symbol(obj), mode='eval'))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(VAR_6):...\n", "if isinstance(VAR_6, (UnicodeEncodeError, UnicodeTranslateError)):\n", "VAR_28 = []\n", "return xmlcharrefreplace_errors(VAR_6)\n", "VAR_29 = []\n", "VAR_30 = False\n", "for i, c in enumerate(VAR_6.object[VAR_6.start:VAR_6.end]):\n", "if VAR_30:\n", "for cp in VAR_29:\n",...
[ "def htmlentityreplace_errors(exc):...\n", "if isinstance(exc, (UnicodeEncodeError, UnicodeTranslateError)):\n", "res = []\n", "return xmlcharrefreplace_errors(exc)\n", "codepoints = []\n", "skip = False\n", "for i, c in enumerate(exc.object[exc.start:exc.end]):\n", "if skip:\n", "for cp in codepoin...
[ 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'", "Return'", "Assign'", "Assign'", "For", "Condition", "For", "Assign'", "Assign'", "Assign'", "Return'", "Condition", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "@CLASS_4('bindings')...\n", "\"\"\"docstring\"\"\"\n", "VAR_26 = {}\n", "VAR_27 = config.val.bindings.default\n", "VAR_28 = set(VAR_27.keys()).union(config.val.bindings.commands)\n", "VAR_28.remove('normal')\n", "VAR_28 = ['normal'] + sorted(list(VAR_28))\n", "for VAR_41 in VAR_28:\n", "VAR_26[VAR_...
[ "@add_handler('bindings')...\n", "\"\"\"docstring\"\"\"\n", "bindings = {}\n", "defaults = config.val.bindings.default\n", "modes = set(defaults.keys()).union(config.val.bindings.commands)\n", "modes.remove('normal')\n", "modes = ['normal'] + sorted(list(modes))\n", "for mode in modes:\n", "bindings...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_20(VAR_66: DecoratedCallable) ->DecoratedCallable:...\n", "self.add_api_route(VAR_26, VAR_66, VAR_29=response_model, VAR_13=\n status_code, VAR_30=tags, VAR_31=dependencies, VAR_32=summary, VAR_33=\n description, VAR_34=response_description, VAR_35=responses, VAR_36=\n deprecated, VAR_37=method...
[ "def decorator(func: DecoratedCallable) ->DecoratedCallable:...\n", "self.add_api_route(path, func, response_model=response_model, status_code=\n status_code, tags=tags, dependencies=dependencies, summary=summary,\n description=description, response_description=response_description,\n responses=responses...
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "@VAR_1.route('/<bfile>/statement/', methods=['GET'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_27 = request.args.get('entry_hash', '')\n", "VAR_28 = request.args.get('key', '')\n", "VAR_29 = g.ledger.statement_path(VAR_27, VAR_28)\n", "return send_file_inline(VAR_29)\n" ]
[ "@app.route('/<bfile>/statement/', methods=['GET'])...\n", "\"\"\"docstring\"\"\"\n", "entry_hash = request.args.get('entry_hash', '')\n", "key = request.args.get('key', '')\n", "document_path = g.ledger.statement_path(entry_hash, key)\n", "return send_file_inline(document_path)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_61(self):...\n", "\"\"\"docstring\"\"\"\n", "return self._blitzcon.getUser().omeName\n" ]
[ "def getName(self):...\n", "\"\"\"docstring\"\"\"\n", "return self._blitzcon.getUser().omeName\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_125(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_418.path.islink(VAR_10) and not self.in_base(VAR_10)\n" ]
[ "def issymlink_out(self, f):...\n", "\"\"\"docstring\"\"\"\n", "return os.path.islink(f) and not self.in_base(f)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_12(self):...\n", "" ]
[ "def finalize_options(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "\"\"\"\nDecorators for use with the webclient application.\n\"\"\"\n", "import logging\n", "import omeroweb.decorators\n", "from omero import constants\n", "from django.http import HttpResponse\n", "from django.conf import settings\n", "from django.core.urlresolvers import reverse\n", "from django.co...
[ "\"\"\"\nDecorators for use with the webclient application.\n\"\"\"\n", "import logging\n", "import omeroweb.decorators\n", "from omero import constants\n", "from django.http import HttpResponse\n", "from django.conf import settings\n", "from django.core.urlresolvers import reverse\n", "from django.co...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Ex...
[ "def FUNC_36(VAR_51):...\n", "for VAR_105 in VAR_51:\n", "VAR_16.write(VAR_105)\n", "yield VAR_105\n" ]
[ "def written_chunks(chunks):...\n", "for chunk in chunks:\n", "content_file.write(chunk)\n", "yield chunk\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'" ]
[ "def FUNC_7(VAR_0):...\n", "import subprocess\n", "from openapi_python_client import GeneratorData, Project\n", "VAR_12 = VAR_0.patch('subprocess.run')\n", "VAR_3 = VAR_0.MagicMock(autospec=GeneratorData, title='My Test API')\n", "VAR_8 = Project(VAR_3=openapi)\n", "VAR_8.project_dir = VAR_0.MagicMock(a...
[ "def test__reformat(mocker):...\n", "import subprocess\n", "from openapi_python_client import GeneratorData, Project\n", "sub_run = mocker.patch('subprocess.run')\n", "openapi = mocker.MagicMock(autospec=GeneratorData, title='My Test API')\n", "project = Project(openapi=openapi)\n", "project.project_dir...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Import'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@VAR_2.route('/ratings')...\n", "if VAR_87.check_visibility(constants.SIDEBAR_RATING):\n", "if VAR_87.get_view_property('ratings', 'dir') == 'desc':\n", "abort(404)\n", "VAR_10 = db.Ratings.rating.desc()\n", "VAR_10 = db.Ratings.rating.asc()\n", "VAR_109 = 0\n", "VAR_109 = 1\n", "VAR_63 = calibre_d...
[ "@web.route('/ratings')...\n", "if current_user.check_visibility(constants.SIDEBAR_RATING):\n", "if current_user.get_view_property('ratings', 'dir') == 'desc':\n", "abort(404)\n", "order = db.Ratings.rating.desc()\n", "order = db.Ratings.rating.asc()\n", "order_no = 0\n", "order_no = 1\n", "entries ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@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(), 'testRunCommand_inputs.npz')\n", "np.s...
[ "@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(), 'testRunCommand_inputs.n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "async def FUNC_9(self, VAR_14):...\n", "if 'notify' not in VAR_14['actions']:\n", "return True\n", "VAR_16 = push_rule_evaluator.tweaks_for_actions(VAR_14['actions'])\n", "VAR_17 = await push_tools.get_badge_count(self.hs.get_datastore(), self.\n user_id, group_by_room=self._group_unread_count_by_room)\...
[ "async def _process_one(self, push_action):...\n", "if 'notify' not in push_action['actions']:\n", "return True\n", "tweaks = push_rule_evaluator.tweaks_for_actions(push_action['actions'])\n", "badge = await push_tools.get_badge_count(self.hs.get_datastore(), self.\n user_id, group_by_room=self._group_un...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Condition", "For", "Return'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_37(self):...\n", "if not sys.platform.startswith('win') and sys.stdin.isatty():\n", "signal.signal(signal.SIGINT, self._handle_sigint)\n", "signal.signal(signal.SIGTERM, self._signal_stop)\n", "if hasattr(signal, 'SIGUSR1'):\n", "signal.signal(signal.SIGUSR1, self._signal_info)\n", "if hasattr...
[ "def init_signal(self):...\n", "if not sys.platform.startswith('win') and sys.stdin.isatty():\n", "signal.signal(signal.SIGINT, self._handle_sigint)\n", "signal.signal(signal.SIGTERM, self._signal_stop)\n", "if hasattr(signal, 'SIGUSR1'):\n", "signal.signal(signal.SIGUSR1, self._signal_info)\n", "if has...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "@contextlib.contextmanager...\n", "VAR_1, VAR_2 = StringIO(), StringIO()\n", "VAR_3, VAR_4 = VAR_8.stdout, VAR_8.stderr\n", "VAR_8.stdout, VAR_8.stderr = VAR_1, VAR_2\n", "VAR_8.stdout, VAR_8.stderr = VAR_3, VAR_4\n", "yield VAR_8.stdout, VAR_8.stderr\n" ]
[ "@contextlib.contextmanager...\n", "new_out, new_err = StringIO(), StringIO()\n", "old_out, old_err = sys.stdout, sys.stderr\n", "sys.stdout, sys.stderr = new_out, new_err\n", "sys.stdout, sys.stderr = old_out, old_err\n", "yield sys.stdout, sys.stderr\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_18(self):...\n", "self.reactor.advance(1000000000000)\n", "VAR_5 = self.helper.create_room_as(self.user_id)\n", "self.get_success(self.presence_handler.set_state(UserID.from_string(\n '@test:server'), {'presence': PresenceState.ONLINE}))\n", "self.get_success(self.presence_handler.set_state(Use...
[ "def test_remote_gets_presence_when_local_user_joins(self):...\n", "self.reactor.advance(1000000000000)\n", "room_id = self.helper.create_room_as(self.user_id)\n", "self.get_success(self.presence_handler.set_state(UserID.from_string(\n '@test:server'), {'presence': PresenceState.ONLINE}))\n", "self.get_s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_55(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_54 = json.dumps({'search_categories': {'room_events': {'search_term':\n 'label', 'filter': self.FILTER_NOT_LABELS}}})\n", "self._send_labelled_messages_in_room()\n", "VAR_22, VAR_23 = self.make_request('POST', '/search?access_token=%s' % self\n ...
[ "def test_search_filter_not_labels(self):...\n", "\"\"\"docstring\"\"\"\n", "request_data = json.dumps({'search_categories': {'room_events': {\n 'search_term': 'label', 'filter': self.FILTER_NOT_LABELS}}})\n", "self._send_labelled_messages_in_room()\n", "request, channel = self.make_request('POST', '/sea...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self) ->str:...\n", "\"\"\"docstring\"\"\"\n", "if self.required:\n", "return self.reference.class_name\n", "return f'Optional[{self.reference.class_name}]'\n" ]
[ "def get_type_string(self) ->str:...\n", "\"\"\"docstring\"\"\"\n", "if self.required:\n", "return self.reference.class_name\n", "return f'Optional[{self.reference.class_name}]'\n" ]
[ 0, 0, 5, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Return'" ]
[ "@ratelimit(field='email', rate='5/5m')...\n", "if VAR_7.method == 'POST' and VAR_7.is_limited():\n", "return redirect(reverse('spirit:user:auth:password-reset'))\n", "return VAR_3(VAR_7, **kwargs)\n" ]
[ "@ratelimit(field='email', rate='5/5m')...\n", "if request.method == 'POST' and request.is_limited():\n", "return redirect(reverse('spirit:user:auth:password-reset'))\n", "return _password_reset_view(request, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(VAR_18=16):...\n", "\"\"\"docstring\"\"\"\n", "random.seed()\n", "assert isinstance(VAR_18, int)\n", "VAR_27 = '%0' + str(2 * VAR_18) + 'x'\n", "return VAR_27 % random.getrandbits(VAR_18 * 8)\n" ]
[ "def generate_random_key(length=16):...\n", "\"\"\"docstring\"\"\"\n", "random.seed()\n", "assert isinstance(length, int)\n", "format_string = '%0' + str(2 * length) + 'x'\n", "return format_string % random.getrandbits(length * 8)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assert'", "Assign'", "Return'" ]
[ "def FUNC_1(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "self.mongo_query = {}\n", "self.ops = []\n", "self.current_value = None\n", "self.generic_visit(VAR_3)\n", "if self.mongo_query == {}:\n" ]
[ "def visit_Module(self, node):...\n", "\"\"\"docstring\"\"\"\n", "self.mongo_query = {}\n", "self.ops = []\n", "self.current_value = None\n", "self.generic_visit(node)\n", "if self.mongo_query == {}:\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Condition" ]
[ "import logging\n", "import urllib\n", "from collections import defaultdict\n", "import attr\n", "from signedjson.key import decode_verify_key_bytes, encode_verify_key_base64, is_signing_algorithm_supported\n", "from signedjson.sign import SignatureVerifyException, encode_canonical_json, signature_ids, ve...
[ "import logging\n", "import urllib\n", "from collections import defaultdict\n", "import attr\n", "from signedjson.key import decode_verify_key_bytes, encode_verify_key_base64, is_signing_algorithm_supported\n", "from signedjson.sign import SignatureVerifyException, encode_canonical_json, signature_ids, ve...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'",...
[ "@VAR_2.route('/admin/dbconfig', methods=['GET', 'POST'])...\n", "if request.method == 'POST':\n", "return FUNC_48()\n", "return FUNC_51()\n" ]
[ "@admi.route('/admin/dbconfig', methods=['GET', 'POST'])...\n", "if request.method == 'POST':\n", "return _db_configuration_update_helper()\n", "return _db_configuration_result()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_5(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertEqual(VAR_5.evaluate('one'), 1)\n" ]
[ "def test_evaluate_simple_path_binding(self):...\n", "ec = self._makeContext()\n", "self.assertEqual(ec.evaluate('one'), 1)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "\"\"\"Tests for SavedModelCLI tool.\"\"\"\n", "import contextlib\n", "import os\n", "import pickle\n", "import platform\n", "import shutil\n", "import sys\n", "from absl.testing import parameterized\n", "import numpy as np\n", "from six import StringIO\n", "from tensorflow.core.example import e...
[ "\"\"\"Tests for SavedModelCLI tool.\"\"\"\n", "import contextlib\n", "import os\n", "import pickle\n", "import platform\n", "import shutil\n", "import sys\n", "from absl.testing import parameterized\n", "import numpy as np\n", "from six import StringIO\n", "from tensorflow.core.example import e...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFro...
[ "def __call__(self):...\n", "" ]
[ "def __call__(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@VAR_0.route('/credentials')...\n", "\"\"\"docstring\"\"\"\n", "VAR_108 = FUNC_58('/internal/credentials', 'get')\n", "flash(str(err), 'danger')\n", "return render_template('credentials.html', credential_info_list=\n credentials_info)\n", "return redirect(url_for('dashboard'))\n" ]
[ "@gui.route('/credentials')...\n", "\"\"\"docstring\"\"\"\n", "credentials_info = query_internal_api('/internal/credentials', 'get')\n", "flash(str(err), 'danger')\n", "return render_template('credentials.html', credential_info_list=\n credentials_info)\n", "return redirect(url_for('dashboard'))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_30():...\n", "VAR_82 = FUNC_13(VAR_1[VAR_14], FUNC_26)\n", "VAR_107 = FUNC_25(VAR_82)\n", "VAR_108 = userManager.has_been_customized()\n", "VAR_43 = FUNC_9(VAR_82, VAR_2, VAR_3, VAR_21)\n", "VAR_43.update({'enableWebcam': VAR_54, 'enableTemperatureGraph': VAR_55,\n 'enableAccessControl': True...
[ "def default_view():...\n", "filtered_templates = _filter_templates(_templates[locale],\n default_template_filter)\n", "wizard = wizard_active(filtered_templates)\n", "accesscontrol_active = userManager.has_been_customized()\n", "render_kwargs = _get_render_kwargs(filtered_templates, _plugin_names,\n ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_8(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "self.current_value = VAR_3.n\n" ]
[ "def visit_Num(self, node):...\n", "\"\"\"docstring\"\"\"\n", "self.current_value = node.n\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'" ]
[ "@CLASS_4('javascript')...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = VAR_3.path()\n", "if VAR_15:\n", "VAR_15 = 'javascript' + os.sep.join(VAR_15.split('/'))\n", "return 'text/html', utils.read_file(VAR_15, binary=False)\n" ]
[ "@add_handler('javascript')...\n", "\"\"\"docstring\"\"\"\n", "path = url.path()\n", "if path:\n", "path = 'javascript' + os.sep.join(path.split('/'))\n", "return 'text/html', utils.read_file(path, binary=False)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_49(VAR_62):...\n", "import frappe.modules\n", "return frappe.modules.load_doctype_module(VAR_62)\n" ]
[ "def get_meta_module(doctype):...\n", "import frappe.modules\n", "return frappe.modules.load_doctype_module(doctype)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Import'", "Return'" ]
[ "def FUNC_0(VAR_0: Team, VAR_1: HttpRequest) ->bool:...\n", "VAR_3 = ['127.0.0.1', 'localhost']\n", "for VAR_2 in VAR_0.app_urls:\n", "VAR_7 = FUNC_2(VAR_2)\n", "VAR_4 = FUNC_2(VAR_1.headers.get('Origin'))\n", "if VAR_7:\n", "VAR_5 = FUNC_2(VAR_1.headers.get('Referer'))\n", "VAR_3.append(VAR_7)\n", ...
[ "def on_permitted_domain(team: Team, request: HttpRequest) ->bool:...\n", "permitted_domains = ['127.0.0.1', 'localhost']\n", "for url in team.app_urls:\n", "hostname = parse_domain(url)\n", "origin = parse_domain(request.headers.get('Origin'))\n", "if hostname:\n", "referer = parse_domain(request.heade...
[ 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 0, 4 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "For", "Condition", "Return'", "Assign'", "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_17(VAR_1):...\n", "VAR_6 = CLASS_1()\n", "VAR_6.name = 'admin'\n", "VAR_6.role = constants.ADMIN_USER_ROLES\n", "VAR_6.sidebar_view = constants.ADMIN_USER_SIDEBAR\n", "VAR_6.password = generate_password_hash(constants.DEFAULT_PASSWORD)\n", "VAR_1.add(VAR_6)\n", "VAR_1.commit()\n", "VAR_1.r...
[ "def create_admin_user(session):...\n", "user = User()\n", "user.name = 'admin'\n", "user.role = constants.ADMIN_USER_ROLES\n", "user.sidebar_view = constants.ADMIN_USER_SIDEBAR\n", "user.password = generate_password_hash(constants.DEFAULT_PASSWORD)\n", "session.add(user)\n", "session.commit()\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_20(self):...\n", "VAR_5 = {'not_rooms': ['!secretbase:unknown']}\n", "VAR_6 = FUNC_0(sender='@foo:bar', type='m.room.message', room_id=\n '!anothersecretbase:unknown')\n", "self.assertTrue(Filter(VAR_5).check(VAR_6))\n" ]
[ "def test_definition_not_rooms_works_with_unknowns(self):...\n", "definition = {'not_rooms': ['!secretbase:unknown']}\n", "event = MockEvent(sender='@foo:bar', type='m.room.message', room_id=\n '!anothersecretbase:unknown')\n", "self.assertTrue(Filter(definition).check(event))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def __setstate__(self, VAR_174):...\n", "self.update(VAR_174)\n" ]
[ "def __setstate__(self, d):...\n", "self.update(d)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_7(self):...\n", "VAR_53 = VAR_1(VAR_2, 'notebook', 'static', 'base', 'js', 'namespace.js')\n", "VAR_49 = f.readlines()\n", "VAR_59 = False\n", "for VAR_68 in VAR_49:\n", "if VAR_68.strip().startswith('Jupyter.version'):\n", "if not VAR_59:\n", "VAR_68 = ' Jupyter.version = \"{0}\";\\n'.fo...
[ "def run(self):...\n", "nsfile = pjoin(repo_root, 'notebook', 'static', 'base', 'js', 'namespace.js')\n", "lines = f.readlines()\n", "found = False\n", "for line in lines:\n", "if line.strip().startswith('Jupyter.version'):\n", "if not found:\n", "line = ' Jupyter.version = \"{0}\";\\n'.format(vers...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Condition", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_34(self):...\n", "return str(self.id)\n" ]
[ "def get_id(self):...\n", "return str(self.id)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_48(VAR_62, VAR_108=True):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.model.meta\n", "return frappe.model.meta.get_meta(VAR_62, VAR_108=cached)\n" ]
[ "def get_meta(doctype, cached=True):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.model.meta\n", "return frappe.model.meta.get_meta(doctype, cached=cached)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Return'" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = FUNC_1('/groups/%s/invited_users', VAR_30)\n", "return self.client.get_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'requester_user_id': requester_user_id}, VAR_15=True)\n" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "path = _create_v1_path('/groups/%s/invited_users', group_id)\n", "return self.client.get_json(destination=destination, path=path, args={\n 'requester_user_id': requester_user_id}, ignore_backoff=True)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_168(*VAR_9, **VAR_13):...\n", "VAR_27 = None\n", "VAR_27 = VAR_10(*VAR_9, **b)\n", "thread.start_new_thread(VAR_26, (VAR_27,))\n", "return VAR_27\n" ]
[ "def __completion(*a, **b):...\n", "d = None\n", "d = f(*a, **b)\n", "thread.start_new_thread(callback, (d,))\n", "return d\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_91(VAR_62, VAR_9, VAR_152=None, VAR_146=None, VAR_147=None,...\n", "from frappe.utils import scrub_urls\n", "if not VAR_152:\n", "VAR_152 = VAR_9\n", "VAR_152 = VAR_152.replace(' ', '').replace('/', '-')\n", "VAR_199 = VAR_12.get_singles_dict('Print Settings')\n", "VAR_200 = VAR_1.lang\n", "...
[ "def attach_print(doctype, name, file_name=None, print_format=None, style=...\n", "from frappe.utils import scrub_urls\n", "if not file_name:\n", "file_name = name\n", "file_name = file_name.replace(' ', '').replace('/', '-')\n", "print_settings = db.get_singles_dict('Print Settings')\n", "_lang = local...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "ImportFrom'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_33():...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = FUNC_5()\n", "VAR_79 = FUNC_3(apath('%s/ABOUT' % VAR_3, VAR_122=request))\n", "VAR_80 = FUNC_3(apath('%s/LICENSE' % VAR_3, VAR_122=request))\n", "return dict(VAR_3=app, VAR_79=MARKMIN(about), VAR_80=MARKMIN(license),\n VAR_6=report_progress(app...
[ "def about():...\n", "\"\"\"docstring\"\"\"\n", "app = get_app()\n", "about = safe_read(apath('%s/ABOUT' % app, r=request))\n", "license = safe_read(apath('%s/LICENSE' % app, r=request))\n", "return dict(app=app, about=MARKMIN(about), license=MARKMIN(license),\n progress=report_progress(app))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_109(VAR_170):...\n", "from frappe.utils import parse_json\n", "return FUNC_109(VAR_170)\n" ]
[ "def parse_json(val):...\n", "from frappe.utils import parse_json\n", "return parse_json(val)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "import re\n", "from twisted.internet.defer import Deferred\n", "from twisted.web.resource import Resource\n", "from synapse.api.errors import Codes, RedirectException, SynapseError\n", "from synapse.config.server import parse_listener_def\n", "from synapse.http.server import DirectServeHtmlResource, Json...
[ "import re\n", "from twisted.internet.defer import Deferred\n", "from twisted.web.resource import Resource\n", "from synapse.api.errors import Codes, RedirectException, SynapseError\n", "from synapse.config.server import parse_listener_def\n", "from synapse.http.server import DirectServeHtmlResource, Json...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "FunctionDef'", "Expr'", "...
[ "def FUNC_21(self):...\n", "return [self.cleaned_data['lang']]\n" ]
[ "def clean_lang(self):...\n", "return [self.cleaned_data['lang']]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@CLASS_4('configdiff')...\n", "\"\"\"docstring\"\"\"\n", "if VAR_3.path() == '/old':\n", "VAR_32 = config.instance.dump_userconfig().encode('utf-8')\n", "return 'text/html', configdiff.get_diff()\n", "VAR_8 = b'Failed to read old config: ' + str(e.strerror).encode('utf-8')\n", "return 'text/plain', VAR...
[ "@add_handler('configdiff')...\n", "\"\"\"docstring\"\"\"\n", "if url.path() == '/old':\n", "data = config.instance.dump_userconfig().encode('utf-8')\n", "return 'text/html', configdiff.get_diff()\n", "error = b'Failed to read old config: ' + str(e.strerror).encode('utf-8')\n", "return 'text/plain', dat...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Return'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_15(self, VAR_36: Failure) ->None:...\n", "if VAR_36.check(ResponseDone):\n", "self.deferred.callback(self.length)\n", "if VAR_36.check(PotentialDataLoss):\n", "self.deferred.callback(self.length)\n", "self.deferred.errback(VAR_36)\n" ]
[ "def connectionLost(self, reason: Failure) ->None:...\n", "if reason.check(ResponseDone):\n", "self.deferred.callback(self.length)\n", "if reason.check(PotentialDataLoss):\n", "self.deferred.callback(self.length)\n", "self.deferred.errback(reason)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "self.edit_unit('Hello, world!\\n', 'Nazdar svete!\\n')\n" ]
[ "def add_change(self):...\n", "self.edit_unit('Hello, world!\\n', 'Nazdar svete!\\n')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@VAR_7.route('/meta/<path:object_path>')...\n", "VAR_36 = FUNC_10(VAR_19)\n", "VAR_37 = dict()\n", "VAR_37['_gt_label'] = VAR_36.split('/')[-2]\n", "return jsonify(VAR_37)\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'" ]
[ "def FUNC_2(VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_20 = VAR_3.strip().split()\n", "if len(VAR_20) > 0:\n", "return ' ' + ' '.join(VAR_20) + ' '\n", "return ''\n" ]
[ "def pad_string(text):...\n", "\"\"\"docstring\"\"\"\n", "words = text.strip().split()\n", "if len(words) > 0:\n", "return ' ' + ' '.join(words) + ' '\n", "return ''\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Return'" ]
[ "async def FUNC_24(VAR_23):...\n", "self.assertEqual(VAR_23, {'server1': {FUNC_0(VAR_20): 1500}})\n", "return {'server1': {FUNC_0(VAR_20): FetchKeyResult(get_verify_key(VAR_20), \n 1200)}}\n" ]
[ "async def get_keys(keys_to_fetch):...\n", "self.assertEqual(keys_to_fetch, {'server1': {get_key_id(key1): 1500}})\n", "return {'server1': {get_key_id(key1): FetchKeyResult(get_verify_key(key1), \n 1200)}}\n" ]
[ 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "Return'" ]
[ "def __init__(self, *VAR_17, **VAR_18):...\n", "super(CLASS_0, self).__init__(*VAR_17, **kwargs)\n", "VAR_49 = self.spec.split('/')\n", "self.user, self.gist_id, *VAR_50 = VAR_49\n", "if len(VAR_49) > 2:\n", "self.unresolved_ref = VAR_49[2]\n", "self.unresolved_ref = ''\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super(RepoProvider, self).__init__(*args, **kwargs)\n", "parts = self.spec.split('/')\n", "self.user, self.gist_id, *_ = parts\n", "if len(parts) > 2:\n", "self.unresolved_ref = parts[2]\n", "self.unresolved_ref = ''\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]