lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "def FUNC_16(self, VAR_28: Dict[str, str]) ->str:...\n", "if self.hs.config.email_riot_base_url:\n", "return '%s/#/room/%s/%s' % (self.hs.config.email_riot_base_url, VAR_28[\n 'room_id'], VAR_28['event_id'])\n", "if self.app_name == 'Vector':\n", "return 'https://vector.im/beta/#/room/%s/%s' % (VAR_28['r...
[ "def make_notif_link(self, notif: Dict[str, str]) ->str:...\n", "if self.hs.config.email_riot_base_url:\n", "return '%s/#/room/%s/%s' % (self.hs.config.email_riot_base_url, notif[\n 'room_id'], notif['event_id'])\n", "if self.app_name == 'Vector':\n", "return 'https://vector.im/beta/#/room/%s/%s' % (noti...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_32(self):...\n", "VAR_112 = VAR_263.request.vars._next\n", "VAR_98 = VAR_263.request.env.http_host\n", "if isinstance(VAR_112, (list, tuple)):\n", "VAR_112 = VAR_112[0]\n", "if VAR_112 and self.settings.prevent_open_redirect_attacks:\n", "return self.prevent_open_redirect(VAR_112, VAR_98)\n", ...
[ "def get_vars_next(self):...\n", "next = current.request.vars._next\n", "host = current.request.env.http_host\n", "if isinstance(next, (list, tuple)):\n", "next = next[0]\n", "if next and self.settings.prevent_open_redirect_attacks:\n", "return self.prevent_open_redirect(next, host)\n", "return next o...
[ 0, 0, 4, 0, 0, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = self.client.post('/password_reset_from_email/', {'email':\n 'staffmember@example.com'})\n", "self.assertEqual(VAR_3.status_code, 302)\n", "self.assertEqual(len(mail.outbox), 1)\n", "self.assertEqual('staffmember@example.com', mail.outbox[0]....
[ "def test_email_found_custom_from(self):...\n", "\"\"\"docstring\"\"\"\n", "response = self.client.post('/password_reset_from_email/', {'email':\n 'staffmember@example.com'})\n", "self.assertEqual(response.status_code, 302)\n", "self.assertEqual(len(mail.outbox), 1)\n", "self.assertEqual('staffmember@e...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_21(VAR_28, VAR_17):...\n", "VAR_48 = False\n", "if VAR_28:\n", "VAR_86 = VAR_28.rstrip().strip()\n", "if len(VAR_17.publishers):\n", "if len(VAR_17.publishers) == 0 or len(VAR_17.publishers\n", "VAR_48 |= FUNC_7([], VAR_17.publishers, db.Publishers, calibre_db.session,\n 'publisher')\n", ...
[ "def edit_book_publisher(publishers, book):...\n", "changed = False\n", "if publishers:\n", "publisher = publishers.rstrip().strip()\n", "if len(book.publishers):\n", "if len(book.publishers) == 0 or len(book.publishers\n", "changed |= modify_database_object([], book.publishers, db.Publishers,\n cali...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "AugAssign'", "Return'", "AugAssign'" ]
[ "def FUNC_59(self):...\n", "VAR_61 = self._get_aliases(self.room_owner_tok)\n", "self.assertEqual(VAR_61['aliases'], [])\n" ]
[ "def test_no_aliases(self):...\n", "res = self._get_aliases(self.room_owner_tok)\n", "self.assertEqual(res['aliases'], [])\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_0(VAR_0: Any, *, VAR_1: bool, VAR_2: bool=False, VAR_3: bool=False...\n", "if isinstance(VAR_0, BaseModel):\n", "return VAR_0.dict(VAR_8=True, VAR_1=exclude_unset, VAR_2=exclude_defaults,\n VAR_3=exclude_none)\n", "if isinstance(VAR_0, list):\n", "return [FUNC_0(item, VAR_1=exclude_unset, VAR_2...
[ "def _prepare_response_content(res: Any, *, exclude_unset: bool,...\n", "if isinstance(res, BaseModel):\n", "return res.dict(by_alias=True, exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults, exclude_none=exclude_none)\n", "if isinstance(res, list):\n", "return [_prepare_response_content(it...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "@VAR_0.route('/query/<int:query_id>/meta')...\n", "VAR_14 = g.conn.session.query(Query).get(VAR_4)\n", "if not VAR_14:\n", "return Response('No such query id', status=404)\n", "return Response(json.dumps({'latest_run': VAR_14.latest_rev.latest_run,\n 'latest_rev': VAR_14.latest_rev, 'query': VAR_14}, de...
[ "@app.route('/query/<int:query_id>/meta')...\n", "query = g.conn.session.query(Query).get(query_id)\n", "if not query:\n", "return Response('No such query id', status=404)\n", "return Response(json.dumps({'latest_run': query.latest_rev.latest_run,\n 'latest_rev': query.latest_rev, 'query': query}, defaul...
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_20(VAR_2, *VAR_23, **VAR_24):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = VAR_21(VAR_2, *VAR_23, **kwargs)\n", "if isinstance(VAR_22, HttpResponseBase):\n", "return VAR_22\n", "VAR_37 = 'template' in VAR_22 and VAR_22['template'] or None\n", "VAR_37 = VAR_24.get('template', VAR_37)\n", "VAR_...
[ "def wrapper(request, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "context = f(request, *args, **kwargs)\n", "if isinstance(context, HttpResponseBase):\n", "return context\n", "template = 'template' in context and context['template'] or None\n", "template = kwargs.get('template', template)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_12(VAR_14, VAR_15, VAR_16, VAR_17, VAR_18, VAR_10, VAR_24, VAR_21,...\n", "\"\"\"docstring\"\"\"\n", "VAR_56 = list()\n", "VAR_19 = FUNC_10(VAR_14, VAR_15, VAR_16, VAR_17, VAR_18)\n", "VAR_56.append({'username': VAR_15, 'email': VAR_14, 'response': _(\n 'Username {user} already exists.').format...
[ "def create_and_enroll_user(email, username, name, country, password,...\n", "\"\"\"docstring\"\"\"\n", "errors = list()\n", "user = create_user_and_user_profile(email, username, name, country, password)\n", "errors.append({'username': username, 'email': email, 'response': _(\n 'Username {user} already e...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'", "Expr'" ]
[ "def FUNC_23(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_143 = ''\n", "if self.on_hold:\n", "VAR_143 = _(' - On Hold')\n", "VAR_144 = ''\n", "if not self.can_be_resolved:\n", "VAR_144 = _(' - Open dependencies')\n", "return u'%s%s%s' % (self.get_status_display(), VAR_143, VAR_144)\n" ]
[ "def _get_status(self):...\n", "\"\"\"docstring\"\"\"\n", "held_msg = ''\n", "if self.on_hold:\n", "held_msg = _(' - On Hold')\n", "dep_msg = ''\n", "if not self.can_be_resolved:\n", "dep_msg = _(' - Open dependencies')\n", "return u'%s%s%s' % (self.get_status_display(), held_msg, dep_msg)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_22(self):...\n", "VAR_22, VAR_23 = self.make_request('GET', self.path)\n", "self.assertEquals(404, VAR_23.code, msg=channel.result['body'])\n", "VAR_19 = '{\"topic\":\"Topic name\"}'\n", "VAR_22, VAR_23 = self.make_request('PUT', self.path, VAR_19)\n", "self.assertEquals(200, VAR_23.code, msg=ch...
[ "def test_rooms_topic(self):...\n", "request, channel = self.make_request('GET', self.path)\n", "self.assertEquals(404, channel.code, msg=channel.result['body'])\n", "content = '{\"topic\":\"Topic name\"}'\n", "request, channel = self.make_request('PUT', self.path, content)\n", "self.assertEquals(200, cha...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_31(VAR_10=None, VAR_62=None):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.cache_manager\n", "if VAR_62:\n", "frappe.cache_manager.clear_doctype_cache(VAR_62)\n", "if VAR_10:\n", "FUNC_38()\n", "frappe.cache_manager.clear_user_cache(VAR_10)\n", "from frappe import translate\n", "VAR_...
[ "def clear_cache(user=None, doctype=None):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.cache_manager\n", "if doctype:\n", "frappe.cache_manager.clear_doctype_cache(doctype)\n", "if user:\n", "reset_metadata_version()\n", "frappe.cache_manager.clear_user_cache(user)\n", "from frappe import trans...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "ImportFrom'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "For", "Expr'" ]
[ "def FUNC_31(self):...\n", "from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver\n", "from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver\n", "from zope.component import getUtility\n", "from zope.component import provideUtility\n", "p...
[ "def testDefaultResolver(self):...\n", "from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver\n", "from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver\n", "from zope.component import getUtility\n", "from zope.component import provideUtil...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "Expr'" ]
[ "@VAR_0.errorhandler(404)...\n", "return abort(401)\n" ]
[ "@app.errorhandler(404)...\n", "return abort(401)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_111(self, VAR_17=None, VAR_192=False):...\n", "def FUNC_165(VAR_215, VAR_224):...\n", "if not VAR_399:\n", "return None\n", "return serializers.json({'jsonrpc': '2.0', 'id': VAR_215, 'result': VAR_224})\n" ]
[ "def serve_jsonrpc2(self, data=None, batch_element=False):...\n", "def return_response(id, result):...\n", "if not must_respond:\n", "return None\n", "return serializers.json({'jsonrpc': '2.0', 'id': id, 'result': result})\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "from __future__ import unicode_literals, print_function\n", "from six import iteritems, binary_type, text_type, string_types, PY2\n", "from werkzeug.local import Local, release_local\n", "import os, sys, importlib, inspect, json\n", "from past.builtins import cmp\n", "import cli...
[ "\"\"\"\nFrappe - Low Code Open Source Framework in Python and JS\n\nFrappe, pronounced fra-pay, is a full stack, batteries-included, web\nframework written in Python and Javascript with MariaDB as the database.\nIt is the framework which powers ERPNext. It is pretty generic and can\nbe used to build database drive...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Condition", "...
[ "def FUNC_26(self):...\n", "self.parser = saved_model_cli.create_parser()\n", "VAR_9 = test.test_src_dir_path(VAR_0)\n", "VAR_10 = self.parser.parse_args(['run', '--dir', VAR_9, '--tag_set',\n 'serve', '--signature_def', 'regress_x2_to_y3', '--input_exprs',\n 'x2=np.ones((3,1))'])\n", "saved_model_cli...
[ "def testRunCommandInvalidInputKeyError(self):...\n", "self.parser = saved_model_cli.create_parser()\n", "base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n", "args = self.parser.parse_args(['run', '--dir', base_path, '--tag_set',\n 'serve', '--signature_def', 'regress_x2_to_y3', '--input_exprs',\n ...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "async def FUNC_17(self, VAR_22: List[str]) ->Tuple[List[str], int]:...\n", "\"\"\"docstring\"\"\"\n", "VAR_40 = []\n", "for VAR_4 in VAR_22:\n", "VAR_0.info(\"Deleting media with ID '%s'\", VAR_4)\n", "return VAR_40, len(VAR_40)\n", "VAR_48 = self.filepaths.local_media_filepath(VAR_4)\n", "os.remove(...
[ "async def _remove_local_media_from_disk(self, media_ids: List[str]) ->Tuple[...\n", "\"\"\"docstring\"\"\"\n", "removed_media = []\n", "for media_id in media_ids:\n", "logger.info(\"Deleting media with ID '%s'\", media_id)\n", "return removed_media, len(removed_media)\n", "full_path = self.filepaths.lo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Return'", "Assign'", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "async def FUNC_8(self, VAR_6: str, VAR_7: str) ->Optional[JsonDict]:...\n", "\"\"\"docstring\"\"\"\n", "VAR_47 = {'client_secret': VAR_6, 'sid': VAR_7}\n", "VAR_48 = None\n", "if self.hs.config.threepid_behaviour_email == ThreepidBehaviour.REMOTE:\n", "VAR_48 = await self.threepid_from_creds(self.hs.conf...
[ "async def validate_threepid_session(self, client_secret: str, sid: str...\n", "\"\"\"docstring\"\"\"\n", "threepid_creds = {'client_secret': client_secret, 'sid': sid}\n", "validation_session = None\n", "if self.hs.config.threepid_behaviour_email == ThreepidBehaviour.REMOTE:\n", "validation_session = awa...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_7, VAR_8):...\n", "if (DEMO_MODE or is_gae) and ('w' in VAR_8 or 'a' in VAR_8):\n", "def FUNC_64(self, VAR_2):...\n", "if PY2 or 'b' in VAR_8:\n", "def FUNC_65(self):...\n", "return open(VAR_7, VAR_8)\n", "return open(VAR_7, VAR_8, encoding='utf8')\n", "return CLASS_2()\n" ]
[ "def safe_open(a, b):...\n", "if (DEMO_MODE or is_gae) and ('w' in b or 'a' in b):\n", "def write(self, data):...\n", "if PY2 or 'b' in b:\n", "def close(self):...\n", "return open(a, b)\n", "return open(a, b, encoding='utf8')\n", "return tmp()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "FunctionDef'", "Condition", "FunctionDef'", "Return'", "Return'", "Return'" ]
[ "def FUNC_20(VAR_5, VAR_12, VAR_13, VAR_14, VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_12 == 'orphaned':\n", "return None\n", "VAR_72 = None\n", "if VAR_12 == 'experimenter':\n", "if VAR_14 in ['dataset', 'plate', 'tag']:\n", "if VAR_12 == 'project':\n", "return None\n", "if not VAR_72:\n"...
[ "def get_object_links(conn, parent_type, parent_id, child_type, child_ids):...\n", "\"\"\"docstring\"\"\"\n", "if parent_type == 'orphaned':\n", "return None\n", "link_type = None\n", "if parent_type == 'experimenter':\n", "if child_type in ['dataset', 'plate', 'tag']:\n", "if parent_type == 'project'...
[ 0, 0, 0, 0, 0, 0, 0, 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", "Condition", "Return'", "Assign'", "Condition", "Condition", "Condition", "Return'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Co...
[ "def FUNC_3(self, VAR_0=None):...\n", "__allow_access_to_unprotected_subobjects__ = 1\n", "def __call__(self):...\n", "return 'dummy'\n" ]
[ "def _makeContext(self, bindings=None):...\n", "__allow_access_to_unprotected_subobjects__ = 1\n", "def __call__(self):...\n", "return 'dummy'\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_2(VAR_12, VAR_13=None, VAR_14=None, VAR_15=None):...\n", "if VAR_13 is None:\n", "VAR_13 = request.base_url\n", "if VAR_14 is None:\n", "VAR_14 = g.locale.language if g.locale else 'en'\n", "VAR_38 = f'ui:{VAR_12}:{VAR_13}:{VAR_14}'\n", "if callable(VAR_15):\n", "return VAR_38\n", "VAR_127...
[ "def _cache_key(ui, url=None, locale=None, additional_key_data=None):...\n", "if url is None:\n", "url = request.base_url\n", "if locale is None:\n", "locale = g.locale.language if g.locale else 'en'\n", "k = f'ui:{ui}:{url}:{locale}'\n", "if callable(additional_key_data):\n", "return k\n", "ak = ad...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "Condition", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_7(VAR_9, VAR_6=0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_26 = ' ' * VAR_6\n", "def FUNC_30(VAR_27):...\n", "print(VAR_26 + VAR_27)\n", "FUNC_30(' dtype: ' + {VAR_31: key for key, VAR_31 in types_pb2.DataType.\n items()}[VAR_9.dtype])\n", "if VAR_9.tensor_shape.unknown_rank:\n", "VAR_...
[ "def _print_tensor_info(tensor_info, indent=0):...\n", "\"\"\"docstring\"\"\"\n", "indent_str = ' ' * indent\n", "def in_print(s):...\n", "print(indent_str + s)\n", "in_print(' dtype: ' + {value: key for key, value in types_pb2.DataType.\n items()}[tensor_info.dtype])\n", "if tensor_info.tensor_s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "FunctionDef'", "Expr'", "Expr'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_2(self):...\n", "self.room = self.helper.create_room_as(self.u_alice, tok=self.t_alice)\n", "VAR_5 = self.get_success(self.store.\n get_rooms_for_local_user_where_membership_is(self.u_alice, [Membership.\n JOIN]))\n", "self.assertEquals([self.room], [m.room_id for m in VAR_5])\n" ]
[ "def test_one_member(self):...\n", "self.room = self.helper.create_room_as(self.u_alice, tok=self.t_alice)\n", "rooms_for_user = self.get_success(self.store.\n get_rooms_for_local_user_where_membership_is(self.u_alice, [Membership.\n JOIN]))\n", "self.assertEquals([self.room], [m.room_id for m in rooms_...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_15():...\n", "random.seed(VAR_24)\n", "return list(map(lambda x: x + VAR_5 * VAR_41, sorted(random.sample(list(\n range(VAR_5)), VAR_40))))\n" ]
[ "def generate_mix_indices():...\n", "random.seed(seed)\n", "return list(map(lambda x: x + ITEMS_PER_ITERATION * iteration_count, sorted\n (random.sample(list(range(ITEMS_PER_ITERATION)), mix_per_iteration))))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_38(VAR_33):...\n", "if callable(VAR_65):\n", "return FUNC_19(VAR_33)\n", "VAR_34 = VAR_65()\n", "VAR_0.exception(\n 'Error while trying to retrieve custom LastModified value for plugin {}'\n .format(VAR_8))\n", "if VAR_34:\n", "return VAR_34\n" ]
[ "def compute_lastmodified(files):...\n", "if callable(custom_lastmodified):\n", "return _compute_date(files)\n", "lastmodified = custom_lastmodified()\n", "_logger.exception(\n 'Error while trying to retrieve custom LastModified value for plugin {}'\n .format(key))\n", "if lastmodified:\n", "retur...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Expr'", "Condition", "Return'" ]
[ "def FUNC_57():...\n", "VAR_3 = request.args(0)\n", "VAR_116 = request.vars.source\n", "VAR_96 = request.vars.plugin\n", "if not (VAR_116 and VAR_3):\n", "if not VAR_116.lower().split('://')[0] in ('http', 'https'):\n", "VAR_26 = SQLFORM.factory()\n", "VAR_110 = None\n", "if VAR_26.process().accepte...
[ "def install_plugin():...\n", "app = request.args(0)\n", "source = request.vars.source\n", "plugin = request.vars.plugin\n", "if not (source and app):\n", "if not source.lower().split('://')[0] in ('http', 'https'):\n", "form = SQLFORM.factory()\n", "result = None\n", "if form.process().accepted:\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_62(self):...\n", "VAR_66 = self._random_alias()\n", "VAR_67 = self._random_alias()\n", "self._set_alias_via_directory(VAR_66)\n", "self._set_alias_via_directory(VAR_67)\n", "VAR_61 = self._get_aliases(self.room_owner_tok)\n", "self.assertEqual(set(VAR_61['aliases']), {VAR_66, VAR_67})\n" ]
[ "def test_with_aliases(self):...\n", "alias1 = self._random_alias()\n", "alias2 = self._random_alias()\n", "self._set_alias_via_directory(alias1)\n", "self._set_alias_via_directory(alias2)\n", "res = self._get_aliases(self.room_owner_tok)\n", "self.assertEqual(set(res['aliases']), {alias1, alias2})\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2, 2),...\n", "return VAR_44 + 2\n" ]
[ "@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2, 2),...\n", "return x + 2\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_40():...\n", "VAR_90 = util.flask.check_lastmodified(VAR_103)\n", "VAR_89 = util.flask.check_etag(VAR_104)\n", "return VAR_90 and VAR_89\n" ]
[ "def check_etag_and_lastmodified():...\n", "lastmodified_ok = util.flask.check_lastmodified(current_lastmodified)\n", "etag_ok = util.flask.check_etag(current_etag)\n", "return lastmodified_ok and etag_ok\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_21(VAR_43, VAR_44=False):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import touch_file\n", "if not os.path.exists(VAR_43):\n", "os.makedirs(VAR_43)\n", "if VAR_44:\n", "touch_file(os.path.join(VAR_43, '__init__.py'))\n" ]
[ "def create_folder(path, with_init=False):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import touch_file\n", "if not os.path.exists(path):\n", "os.makedirs(path)\n", "if with_init:\n", "touch_file(os.path.join(path, '__init__.py'))\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "@app.route('/user/edit', methods=['GET', 'POST'])...\n", "VAR_9 = forms.UserForm()\n", "if VAR_9.validate_on_submit():\n", "VAR_33 = get_db()\n", "VAR_9.username.data = current_user.username\n", "VAR_33.update({'username': VAR_9.username.data, 'hashed_password':\n generate_password_hash(VAR_9.password...
[ "@app.route('/user/edit', methods=['GET', 'POST'])...\n", "form = forms.UserForm()\n", "if form.validate_on_submit():\n", "db = get_db()\n", "form.username.data = current_user.username\n", "db.update({'username': form.username.data, 'hashed_password':\n generate_password_hash(form.password.data)}, doc_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'", "Expr'", "Return'" ]
[ "def FUNC_37(VAR_99=None, VAR_100=None):...\n", "\"\"\"docstring\"\"\"\n", "import hashlib, time\n", "from .utils import random_string\n", "VAR_186 = hashlib.sha224(((VAR_99 or '') + repr(time.time()) + repr(\n random_string(8))).encode()).hexdigest()\n", "if VAR_100:\n", "VAR_186 = VAR_186[:VAR_100]...
[ "def generate_hash(txt=None, length=None):...\n", "\"\"\"docstring\"\"\"\n", "import hashlib, time\n", "from .utils import random_string\n", "digest = hashlib.sha224(((txt or '') + repr(time.time()) + repr(\n random_string(8))).encode()).hexdigest()\n", "if length:\n", "digest = digest[:length]\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "ImportFrom'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_7(self, VAR_16, VAR_17, VAR_5):...\n", "return self.widget.value_from_datadict(VAR_16, VAR_17, VAR_5)\n" ]
[ "def value_from_datadict(self, data, files, name):...\n", "return self.widget.value_from_datadict(data, files, name)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/video_feed/<unique_id>')...\n", "\"\"\"docstring\"\"\"\n", "VAR_40 = Camera.query.filter(Camera.unique_id == VAR_9).first()\n", "VAR_41 = import_module('mycodo.mycodo_flask.camera.camera_' + VAR_40.library\n ).Camera\n", "VAR_41.set_camera_options(VAR_40)\n", "return Response(FUNC_7(VAR...
[ "@blueprint.route('/video_feed/<unique_id>')...\n", "\"\"\"docstring\"\"\"\n", "camera_options = Camera.query.filter(Camera.unique_id == unique_id).first()\n", "camera_stream = import_module('mycodo.mycodo_flask.camera.camera_' +\n camera_options.library).Camera\n", "camera_stream.set_camera_options(came...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_23(self, VAR_81):...\n", "if self.additional_payload:\n", "if callable(self.additional_payload):\n", "return VAR_81\n", "VAR_81 = self.additional_payload(VAR_81)\n", "if isinstance(self.additional_payload, dict):\n", "VAR_81.update(self.additional_payload)\n" ]
[ "def alter_payload(self, payload):...\n", "if self.additional_payload:\n", "if callable(self.additional_payload):\n", "return payload\n", "payload = self.additional_payload(payload)\n", "if isinstance(self.additional_payload, dict):\n", "payload.update(self.additional_payload)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "Assign'", "Condition", "Expr'" ]
[ "@VAR_0.route('/api/query/run', methods=['POST'])...\n", "if get_user() is None:\n", "return 'Authentication required', 401\n", "VAR_21 = request.form['text']\n", "VAR_14 = g.conn.session.query(Query).filter(Query.id == request.form[\n 'query_id']).one()\n", "if VAR_14.user_id != get_user().id or g.con...
[ "@app.route('/api/query/run', methods=['POST'])...\n", "if get_user() is None:\n", "return 'Authentication required', 401\n", "text = request.form['text']\n", "query = g.conn.session.query(Query).filter(Query.id == request.form['query_id']\n ).one()\n", "if query.user_id != get_user().id or g.conn.sess...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'...
[ "@method_decorator(sensitive_post_parameters('password', 'csrfmiddlewaretoken'))...\n", "\"\"\"docstring\"\"\"\n", "return super(CLASS_1, self).dispatch(*VAR_116, **kwargs)\n" ]
[ "@method_decorator(sensitive_post_parameters('password', 'csrfmiddlewaretoken'))...\n", "\"\"\"docstring\"\"\"\n", "return super(LoginView, self).dispatch(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_11(self, VAR_11):...\n", "VAR_60 = self.download_check_files(VAR_11)\n", "if VAR_60 == 'not_permitted':\n", "return 'You are not allowed to download files.'\n", "if VAR_60 == 'invalid_file':\n", "return 'Error: invalid filename found in {list}'.format(list=filelist)\n", "if VAR_60 == 'too_big'...
[ "def api_downloadcheck(self, filelist):...\n", "status = self.download_check_files(filelist)\n", "if status == 'not_permitted':\n", "return 'You are not allowed to download files.'\n", "if status == 'invalid_file':\n", "return 'Error: invalid filename found in {list}'.format(list=filelist)\n", "if statu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Return'", "Return'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_5(self):...\n", "if not self.current_cell:\n", "self.form = None\n", "VAR_4 = {'layout_cell': self.current_cell, 'theme': self.view_config.theme,\n 'request': self.request}\n", "return\n", "if self.request.method == 'POST':\n", "VAR_4['data'] = self.request.POST\n", "self.form = LayoutCel...
[ "def build_form(self):...\n", "if not self.current_cell:\n", "self.form = None\n", "kwargs = {'layout_cell': self.current_cell, 'theme': self.view_config.theme,\n 'request': self.request}\n", "return\n", "if self.request.method == 'POST':\n", "kwargs['data'] = self.request.POST\n", "self.form = Lay...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "from mock import Mock, patch\n", "from parameterized import parameterized\n", "from synapse.app.generic_worker import GenericWorkerServer\n", "from synapse.app.homeserver import SynapseHomeServer\n", "from synapse.config.server import parse_listener_def\n", "from tests.server import make_request\n", "f...
[ "from mock import Mock, patch\n", "from parameterized import parameterized\n", "from synapse.app.generic_worker import GenericWorkerServer\n", "from synapse.app.homeserver import SynapseHomeServer\n", "from synapse.config.server import parse_listener_def\n", "from tests.server import make_request\n", "f...
[ 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Return'" ]
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = CourseKey.from_string(VAR_10)\n", "VAR_89 = False\n", "VAR_179 = int(VAR_9.POST['total_registration_codes'])\n", "VAR_179 = int(float(VAR_9.POST['total_registration_codes']))\n", "VAR_88 = VAR_9.POST['company_name']\n", "VAR_90 = VAR_9.P...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = CourseKey.from_string(course_id)\n", "invoice_copy = False\n", "course_code_number = int(request.POST['total_registration_codes'])\n", "course_code_number = int(float(request.POST['total_registration_codes']))\n", "company_name = 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, 0, 0, 0, 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'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", ...
[ "def FUNC_45(VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "VAR_109 = VAR_18.split('\"')\n", "VAR_110 = len(VAR_109) != 0 and VAR_109[0] or ''\n", "VAR_111 = 1\n", "while VAR_111 < len(VAR_109):\n", "VAR_171 = FUNC_44(VAR_109[VAR_111])\n", "return VAR_110\n", "if VAR_171 == '':\n", "VAR_110 += '\"' +...
[ "def make_links(traceback):...\n", "\"\"\"docstring\"\"\"\n", "lwords = traceback.split('\"')\n", "result = len(lwords) != 0 and lwords[0] or ''\n", "i = 1\n", "while i < len(lwords):\n", "link = make_link(lwords[i])\n", "return result\n", "if link == '':\n", "result += '\"' + lwords[i]\n", "res...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "AugAssign'", "AugAssign'", "Assign'", "Condition", "AugAssign'", "Assign'" ]
[ "@VAR_3.on('connect', namespace='/pty')...\n", "\"\"\"docstring\"\"\"\n", "if VAR_0.config['CHILD_PID'] and current_user.is_authenticated:\n", "VAR_3.start_background_task(target=read_and_forward_pty_output)\n", "return\n" ]
[ "@socketio.on('connect', namespace='/pty')...\n", "\"\"\"docstring\"\"\"\n", "if gui.config['CHILD_PID'] and current_user.is_authenticated:\n", "socketio.start_background_task(target=read_and_forward_pty_output)\n", "return\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Expr'", "Return'" ]
[ "def FUNC_13(VAR_30=True):...\n", "return FUNC_10().set_value('flag_print_sql', VAR_30)\n" ]
[ "def print_sql(enable=True):...\n", "return cache().set_value('flag_print_sql', enable)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "async def FUNC_11(self, VAR_12: str) ->List[EventBase]:...\n", "VAR_1 = await self.store.get_event(VAR_12)\n", "VAR_89 = await self.store.get_auth_chain(list(VAR_1.auth_event_ids()),\n include_given=True)\n", "return list(VAR_89)\n" ]
[ "async def on_event_auth(self, event_id: str) ->List[EventBase]:...\n", "event = await self.store.get_event(event_id)\n", "auth = await self.store.get_auth_chain(list(event.auth_event_ids()),\n include_given=True)\n", "return list(auth)\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_11(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = object()\n", "self.assertEqual(format_value(VAR_17), VAR_17.__str__())\n" ]
[ "def test_format_value_object(self):...\n", "\"\"\"docstring\"\"\"\n", "obj = object()\n", "self.assertEqual(format_value(obj), obj.__str__())\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_2(VAR_20, VAR_16, VAR_18, VAR_21):...\n", "VAR_63 = ''\n", "VAR_37 = []\n", "VAR_64 = 0\n", "while 1:\n", "VAR_84, VAR_85 = None, None\n", "for regex in VAR_16:\n", "VAR_93 = VAR_64\n", "if VAR_84 is None:\n", "while 1:\n", "if VAR_37:\n", "VAR_60 = VAR_84.group(0)\n", "VAR_100 = r...
[ "def _link_text(text, link_regexes, avoid_hosts, factory):...\n", "leading_text = ''\n", "links = []\n", "last_pos = 0\n", "while 1:\n", "best_match, best_pos = None, None\n", "for regex in link_regexes:\n", "regex_pos = last_pos\n", "if best_match is None:\n", "while 1:\n", "if links:\n", "li...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "For", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Assert'", "Assert'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Return'", "A...
[ "def FUNC_0(VAR_1):...\n", "VAR_19 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n", "def FUNC_7(VAR_1):...\n", "VAR_20.throw(_('Invalid Search Field {0}').format(VAR_1), VAR_20.DataError)\n", "if len(VAR_1) == 1:\n", "VAR_24 = re.compile('^.*[=;*,\\\\\\'\"$\\\\-+%#@()_].*')\n", ...
[ "def sanitize_searchfield(searchfield):...\n", "blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n 'or', 'like']\n", "def _raise_exception(searchfield):...\n", "frappe.throw(_('Invalid Search Field {0}').format(searchfield), frappe.\n DataError)\n", "if len(searchfield) == ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "FunctionDef'", "Expr'", "Condition", "Assign'", "Condition", "Condition", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "For", "Expr'", "For", "Expr'", "Assign'", "For", "Expr'" ]
[ "def FUNC_9(self):...\n", "return 'zenodo-{}'.format(self.record_id)\n" ]
[ "def get_build_slug(self):...\n", "return 'zenodo-{}'.format(self.record_id)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "assert escaping.escape_attribute('') == ''\n", "assert escaping.escape_text('') == ''\n" ]
[ "def test_htmllib_integration(register_builtin_html):...\n", "assert escaping.escape_attribute('') == ''\n", "assert escaping.escape_text('') == ''\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Assert'" ]
[ "@VAR_0.route('/ajax/xchange', methods=['POST'])...\n", "VAR_81 = VAR_33.get_json().get('xchange')\n", "if VAR_81:\n", "for val in VAR_81:\n", "return ''\n", "VAR_40 = False\n", "return json.dumps({'success': True})\n", "VAR_16 = calibre_db.get_book(val)\n", "VAR_115 = VAR_16.title\n", "VAR_116 = ...
[ "@editbook.route('/ajax/xchange', methods=['POST'])...\n", "vals = request.get_json().get('xchange')\n", "if vals:\n", "for val in vals:\n", "return ''\n", "modif_date = False\n", "return json.dumps({'success': True})\n", "book = calibre_db.get_book(val)\n", "authors = book.title\n", "entries = ca...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "For", "Return'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'", "Condition", "Assign'", "Expr'...
[ "def FUNC_3(VAR_8=CLASS_3, VAR_9=True):...\n", "VAR_39 = CLASS_8()\n", "VAR_39.iteratorFactory = CLASS_10\n", "for pt in VAR_8._default_type_names:\n", "VAR_39.registerType(pt, VAR_8)\n", "VAR_39.registerType('string', CLASS_11)\n", "VAR_39.registerType('python', ZRPythonExpr.PythonExpr)\n", "VAR_39.r...
[ "def createZopeEngine(zpe=ZopePathExpr, untrusted=True):...\n", "e = ZopeEngine()\n", "e.iteratorFactory = PathIterator\n", "for pt in zpe._default_type_names:\n", "e.registerType(pt, zpe)\n", "e.registerType('string', UnicodeAwareStringExpr)\n", "e.registerType('python', ZRPythonExpr.PythonExpr)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "async def FUNC_5(VAR_25: WebSocket) ->None:...\n", "VAR_53 = await solve_dependencies(VAR_24=websocket, VAR_10=dependant,\n VAR_22=dependency_overrides_provider)\n", "VAR_11, VAR_51, VAR_56, VAR_57, VAR_58 = VAR_53\n", "if VAR_51:\n", "await VAR_25.close(code=WS_1008_POLICY_VIOLATION)\n", "assert VAR_...
[ "async def app(websocket: WebSocket) ->None:...\n", "solved_result = await solve_dependencies(request=websocket, dependant=\n dependant, dependency_overrides_provider=dependency_overrides_provider)\n", "values, errors, _, _2, _3 = solved_result\n", "if errors:\n", "await websocket.close(code=WS_1008_POLI...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Assert'", "Expr'" ]
[ "@VAR_0.route('/query/new')...\n", "if get_user() is None:\n", "return redirect('/login?next=/query/new')\n", "VAR_14 = Query()\n", "VAR_14.user = get_user()\n", "g.conn.session.add(VAR_14)\n", "g.conn.session.commit()\n", "return redirect(url_for('query_show', VAR_4=query.id))\n" ]
[ "@app.route('/query/new')...\n", "if get_user() is None:\n", "return redirect('/login?next=/query/new')\n", "query = Query()\n", "query.user = get_user()\n", "g.conn.session.add(query)\n", "g.conn.session.commit()\n", "return redirect(url_for('query_show', query_id=query.id))\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_35(self, VAR_23):...\n", "\"\"\"docstring\"\"\"\n", "if not self.docstatus:\n", "self.docstatus = 0\n", "if VAR_23 == 0:\n", "if self.docstatus == 0:\n", "if VAR_23 == 1:\n", "self._action = 'save'\n", "if self.docstatus == 1:\n", "if self.docstatus == 1:\n", "if VAR_23 == 2:\n", "se...
[ "def check_docstatus_transition(self, docstatus):...\n", "\"\"\"docstring\"\"\"\n", "if not self.docstatus:\n", "self.docstatus = 0\n", "if docstatus == 0:\n", "if self.docstatus == 0:\n", "if docstatus == 1:\n", "self._action = 'save'\n", "if self.docstatus == 1:\n", "if self.docstatus == 1:\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_61(VAR_24: int, VAR_25: str=''):...\n", "\"\"\"docstring\"\"\"\n", "VAR_79, VAR_26 = pty.fork()\n", "if VAR_79 == 0:\n", "VAR_118 = os.environ.copy()\n", "VAR_0.config['FD'] = VAR_26\n", "VAR_118['WEB_CLI'] = 'True'\n", "VAR_0.config['CHILD_PID'] = VAR_79\n", "VAR_118['INTERNAL_PORT'] = st...
[ "def start_ganga(internal_port: int, args: str=''):...\n", "\"\"\"docstring\"\"\"\n", "child_pid, fd = pty.fork()\n", "if child_pid == 0:\n", "ganga_env = os.environ.copy()\n", "gui.config['FD'] = fd\n", "ganga_env['WEB_CLI'] = 'True'\n", "gui.config['CHILD_PID'] = child_pid\n", "ganga_env['INTERNAL...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_3(VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_44 = {}\n", "for config_file in VAR_8:\n", "VAR_76 = yaml.safe_load(file_stream)\n", "if 'server_name' not in VAR_44:\n", "if not isinstance(VAR_76, dict):\n", "if 'report_stats' not in VAR_44:\n", "VAR_77 = \"File %r is empty or doesn't par...
[ "def read_config_files(config_files):...\n", "\"\"\"docstring\"\"\"\n", "specified_config = {}\n", "for config_file in config_files:\n", "yaml_config = yaml.safe_load(file_stream)\n", "if 'server_name' not in specified_config:\n", "if not isinstance(yaml_config, dict):\n", "if 'report_stats' not in sp...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Expr'", "Return'", "Expr'" ]
[ "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 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 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Assign'" ]
[ "def FUNC_37(self):...\n", "for VAR_21 in self.get_all_children():\n", "if not VAR_21.name:\n", "FUNC_17(VAR_21)\n" ]
[ "def set_name_in_children(self):...\n", "for d in self.get_all_children():\n", "if not d.name:\n", "set_new_name(d)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Expr'" ]
[ "def FUNC_19(self, VAR_3):...\n", "return VAR_3.path\n" ]
[ "def render(self, request):...\n", "return request.path\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@FUNC_2.__func__...\n", "\"\"\"docstring\"\"\"\n", "self.docstatus = 2\n", "self.save()\n" ]
[ "@whitelist.__func__...\n", "\"\"\"docstring\"\"\"\n", "self.docstatus = 2\n", "self.save()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = 'something@somewhere.com'\n", "self.assertEqual(format_value(VAR_15),\n '<a href=\"mailto:something@somewhere.com\">something@somewhere.com</a>')\n" ]
[ "def test_format_value_string_email(self):...\n", "\"\"\"docstring\"\"\"\n", "email = 'something@somewhere.com'\n", "self.assertEqual(format_value(email),\n '<a href=\"mailto:something@somewhere.com\">something@somewhere.com</a>')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_7(VAR_6, VAR_4, VAR_9, VAR_7, VAR_5):...\n", "if not isinstance(VAR_6, list):\n", "VAR_6 = [x for x in VAR_6 if x != '']\n", "VAR_8 = FUNC_2(VAR_4, VAR_5, VAR_6)\n", "VAR_10 = FUNC_3(VAR_4, VAR_5, VAR_6)\n", "VAR_48 = FUNC_4(VAR_4, VAR_7, VAR_8)\n", "if len(VAR_10) > 0:\n", "VAR_48 |= FUNC_5...
[ "def modify_database_object(input_elements, db_book_object, db_object,...\n", "if not isinstance(input_elements, list):\n", "input_elements = [x for x in input_elements if x != '']\n", "del_elements = search_objects_remove(db_book_object, db_type, input_elements)\n", "add_elements = search_objects_add(db_bo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "AugAssign'", "Return'" ]
[ "@VAR_0.route('/shelf/<int:shelf_id>', defaults={'sort_param': 'order',...\n", "return FUNC_15(1, VAR_3, VAR_6, VAR_8)\n" ]
[ "@shelf.route('/shelf/<int:shelf_id>', defaults={'sort_param': 'order',...\n", "return render_show_shelf(1, shelf_id, page, sort_param)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_80(VAR_31, VAR_136, VAR_138=None, VAR_5=None, VAR_139=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_67 = FUNC_37(VAR_100=8)\n", "VAR_51 = {'context': VAR_5 or {}, 'http_status_code': VAR_138 or 200}\n", "VAR_51['context'].update({'header': VAR_31, 'title': VAR_31, 'message':\n VAR_136})\n", "...
[ "def redirect_to_message(title, html, http_status_code=None, context=None,...\n", "\"\"\"docstring\"\"\"\n", "message_id = generate_hash(length=8)\n", "message = {'context': context or {}, 'http_status_code': http_status_code or\n 200}\n", "message['context'].update({'header': title, 'title': title, 'mes...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Return'", "Assign'" ]
[ "@FUNC_0...\n", "return Secrets()\n" ]
[ "@cache_in_self...\n", "return Secrets()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_118(VAR_120=None):...\n", "VAR_184 = {}\n", "for VAR_219 in ([VAR_120] if VAR_120 else FUNC_64(VAR_122=True)):\n", "VAR_219 = 'frappe' if VAR_219 == 'webnotes' else VAR_219\n", "return VAR_184\n", "VAR_226 = FUNC_55(VAR_219 + '.hooks')\n", "if VAR_1.flags.in_install_app:\n", "for VAR_46 in d...
[ "def load_app_hooks(app_name=None):...\n", "hooks = {}\n", "for app in ([app_name] if app_name else get_installed_apps(sort=True)):\n", "app = 'frappe' if app == 'webnotes' else app\n", "return hooks\n", "app_hooks = get_module(app + '.hooks')\n", "if local.flags.in_install_app:\n", "for key in dir(ap...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Condition", "For", "Expr'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_81(VAR_9, VAR_38, VAR_44):...\n", "\"\"\"docstring\"\"\"\n", "VAR_46 = CertificateInvalidation.objects.get(VAR_44=generated_certificate)\n", "VAR_46.deactivate()\n", "VAR_40 = VAR_46.generated_certificate.user\n", "instructor_task.api.generate_certificates_for_students(VAR_9, VAR_38,\n studen...
[ "def re_validate_certificate(request, course_key, generated_certificate):...\n", "\"\"\"docstring\"\"\"\n", "certificate_invalidation = CertificateInvalidation.objects.get(\n generated_certificate=generated_certificate)\n", "certificate_invalidation.deactivate()\n", "student = certificate_invalidation.ge...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "from __future__ import unicode_literals, print_function\n", "from six import iteritems, binary_type, text_type, string_types, PY2\n", "from werkzeug.local import Local, release_local\n", "import os, sys, importlib, inspect, json\n", "from past.builtins import cmp\n", "import cli...
[ "\"\"\"\nFrappe - Low Code Open Source Framework in Python and JS\n\nFrappe, pronounced fra-pay, is a full stack, batteries-included, web\nframework written in Python and Javascript with MariaDB as the database.\nIt is the framework which powers ERPNext. It is pretty generic and can\nbe used to build database drive...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Condition", "...
[ "def FUNC_2(self, VAR_12, VAR_13):...\n", "run_as_background_process('http_pusher.on_new_receipts', self._update_badge)\n" ]
[ "def on_new_receipts(self, min_stream_id, max_stream_id):...\n", "run_as_background_process('http_pusher.on_new_receipts', self._update_badge)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_10(VAR_26):...\n", "\"\"\"docstring\"\"\"\n", "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(callback):...\n", "\"\"\"docstring\"\"\"\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, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def __init__(self, VAR_1):...\n", "self.config = VAR_1\n", "VAR_42 = 'res/dist/main.html'\n", "VAR_43 = 'res/login.html'\n", "VAR_44 = 'res/firstrun.html'\n", "self.mainpage = readRes(VAR_42)\n", "self.loginpage = readRes(VAR_43)\n", "self.firstrunpage = readRes(VAR_44)\n", "self.handlers = {'searc...
[ "def __init__(self, config):...\n", "self.config = config\n", "template_main = 'res/dist/main.html'\n", "template_login = 'res/login.html'\n", "template_firstrun = 'res/firstrun.html'\n", "self.mainpage = readRes(template_main)\n", "self.loginpage = readRes(template_login)\n", "self.firstrunpage = rea...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_21(self):...\n", "self._original_modified = self.modified\n", "self.modified = now()\n", "self.modified_by = frappe.session.user\n", "if not self.creation:\n", "self.creation = self.modified\n", "if not self.owner:\n", "self.owner = self.modified_by\n", "for VAR_21 in self.get_all_children...
[ "def set_user_and_timestamp(self):...\n", "self._original_modified = self.modified\n", "self.modified = now()\n", "self.modified_by = frappe.session.user\n", "if not self.creation:\n", "self.creation = self.modified\n", "if not self.owner:\n", "self.owner = self.modified_by\n", "for d in self.get_al...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "For", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Condition", "Assign'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_132 = VAR_8.getObject('Dataset', VAR_34)\n", "return VAR_132.simpleMarshal()\n" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "ds = conn.getObject('Dataset', did)\n", "return ds.simpleMarshal()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_11(VAR_27, VAR_28=lambda VAR_30: VAR_30, VAR_29=False):...\n", "VAR_193 = datetime.datetime.utcnow() if VAR_29 else datetime.datetime.now()\n", "if isinstance(VAR_27, datetime.datetime):\n", "VAR_321 = VAR_193 - VAR_27\n", "if isinstance(VAR_27, datetime.date):\n", "if VAR_321.days < 0:\n", "V...
[ "def prettydate(d, T=lambda x: x, utc=False):...\n", "now = datetime.datetime.utcnow() if utc else datetime.datetime.now()\n", "if isinstance(d, datetime.datetime):\n", "dt = now - d\n", "if isinstance(d, datetime.date):\n", "if dt.days < 0:\n", "dt = now.date() - d\n", "if not d:\n", "suffix = ' fr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Return'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return...
[ "def FUNC_5(self):...\n", "self.assertFormfield(models.Event, 'link', widgets.AdminURLFieldWidget)\n" ]
[ "def testURLField(self):...\n", "self.assertFormfield(models.Event, 'link', widgets.AdminURLFieldWidget)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@pytest.fixture(scope='session')...\n", "from openapi_python_client import utils\n", "VAR_0 = {'snakecase': utils.snake_case, 'spinalcase': utils.spinal_case}\n", "VAR_1 = Environment(loader=PackageLoader('openapi_python_client'),\n trim_blocks=True, lstrip_blocks=True)\n", "VAR_1.filters.update(VAR_0)\...
[ "@pytest.fixture(scope='session')...\n", "from openapi_python_client import utils\n", "TEMPLATE_FILTERS = {'snakecase': utils.snake_case, 'spinalcase': utils.\n spinal_case}\n", "env = Environment(loader=PackageLoader('openapi_python_client'),\n trim_blocks=True, lstrip_blocks=True)\n", "env.filters.u...
[ 0, 0, 1, 0, 0, 0 ]
[ "Condition", "ImportFrom'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_11(self):...\n", "VAR_7 = '/users/<int:user_id>/roles/<string:slug>'\n", "assert get_param_tuples(VAR_7) == [('int', 'user_id'), ('string', 'slug')]\n" ]
[ "def test_multiple(self):...\n", "path = '/users/<int:user_id>/roles/<string:slug>'\n", "assert get_param_tuples(path) == [('int', 'user_id'), ('string', 'slug')]\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'" ]
[ "def __post_init__(self) ->None:...\n", "self.python_name = utils.snake_case(self.name)\n" ]
[ "def __post_init__(self) ->None:...\n", "self.python_name = utils.snake_case(self.name)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "@property...\n", "return FUNC_0(self.time_spent)\n" ]
[ "@property...\n", "return format_time_spent(self.time_spent)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@VAR_25.whitelist(allow_guest=True)...\n", "VAR_25.local.login_manager.logout()\n", "VAR_25.db.commit()\n", "VAR_25.respond_as_web_page(_('Logged Out'), _(\n 'You have been successfully logged out'), indicator_color='green')\n" ]
[ "@frappe.whitelist(allow_guest=True)...\n", "frappe.local.login_manager.logout()\n", "frappe.db.commit()\n", "frappe.respond_as_web_page(_('Logged Out'), _(\n 'You have been successfully logged out'), indicator_color='green')\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_3(self):...\n", "\"\"\"Model with callable polymorphic functions specified.\"\"\"\n", "@def_function.function...\n", "if VAR_55:\n", "return VAR_53 + VAR_54\n", "return VAR_53 * VAR_54\n" ]
[ "def testShowAllWithFunctions(self):...\n", "\"\"\"Model with callable polymorphic functions specified.\"\"\"\n", "@def_function.function...\n", "if c:\n", "return a + b\n", "return a * b\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_30(self):...\n", "self.kernel_spec_manager = self.kernel_spec_manager_class(parent=self)\n", "self.kernel_manager = self.kernel_manager_class(parent=self, VAR_19=self.\n log, connection_dir=self.runtime_dir, VAR_17=self.kernel_spec_manager)\n", "self.contents_manager = self.contents_manager_class...
[ "def init_configurables(self):...\n", "self.kernel_spec_manager = self.kernel_spec_manager_class(parent=self)\n", "self.kernel_manager = self.kernel_manager_class(parent=self, log=self.log,\n connection_dir=self.runtime_dir, kernel_spec_manager=self.\n kernel_spec_manager)\n", "self.contents_manager = s...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_21(VAR_20):...\n", "\"\"\"docstring\"\"\"\n", "from tensorflow.python.compiler.tensorrt import trt_convert as trt\n", "if not VAR_20.convert_tf1_model:\n", "VAR_73 = trt.DEFAULT_TRT_CONVERSION_PARAMS._replace(max_workspace_size_bytes\n =args.max_workspace_size_bytes, precision_mode=args.precisi...
[ "def convert_with_tensorrt(args):...\n", "\"\"\"docstring\"\"\"\n", "from tensorflow.python.compiler.tensorrt import trt_convert as trt\n", "if not args.convert_tf1_model:\n", "params = trt.DEFAULT_TRT_CONVERSION_PARAMS._replace(max_workspace_size_bytes\n =args.max_workspace_size_bytes, precision_mode=ar...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "@VAR_0.route('/jobs/<int:job_id>')...\n", "\"\"\"docstring\"\"\"\n", "VAR_54 = None\n", "VAR_55 = None\n", "VAR_94 = FUNC_58(f'/internal/jobs/{VAR_9}', 'get')\n", "flash(str(err), 'danger')\n", "return render_template('job.html', title=f'Job {job_id}', VAR_94=job_info,\n VAR_5=status_color, attribut...
[ "@gui.route('/jobs/<int:job_id>')...\n", "\"\"\"docstring\"\"\"\n", "stdout = None\n", "stderr = None\n", "job_info = query_internal_api(f'/internal/jobs/{job_id}', 'get')\n", "flash(str(err), 'danger')\n", "return render_template('job.html', title=f'Job {job_id}', job_info=job_info,\n status_color=s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Return'", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_23(VAR_48, VAR_49=VAR_29):...\n", "return VAR_49 is not None and (len(VAR_48) > VAR_49 and '%s...' % VAR_48[:\n max(0, VAR_49 - 3)]) or VAR_48\n" ]
[ "def trim_url(x, limit=trim_url_limit):...\n", "return limit is not None and (len(x) > limit and '%s...' % x[:max(0, limit -\n 3)]) or x\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_11(VAR_37):...\n", "VAR_4, VAR_39 = VAR_37\n", "VAR_25.write(VAR_4)\n", "return VAR_39\n" ]
[ "def write_to(r):...\n", "data, response = r\n", "output_stream.write(data)\n", "return response\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\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_25 = self.get_success(self.inject_redaction(self.room1, VAR_16.event_id,...
[ "def test_redact_redaction(self):...\n", "\"\"\"docstring\"\"\"\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", "first_redact_event = self.get_success(self.inject_re...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_39(self):...\n", "VAR_85 = self.allowed_tags or ''\n", "return [t.strip() for t in VAR_85.split(',')]\n" ]
[ "def list_allowed_tags(self):...\n", "mct = self.allowed_tags or ''\n", "return [t.strip() for t in mct.split(',')]\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "import os\n", "import jwt\n", "import json\n", "import requests\n", "import time\n", "import select\n", "import termios\n", "import struct\n", "import fcntl\n", "import subprocess\n", "import pty\n", "import sys\n", "import datetime\n", "from functools import wraps\n", "from werkzeug.ut...
[ "import os\n", "import jwt\n", "import json\n", "import requests\n", "import time\n", "import select\n", "import termios\n", "import struct\n", "import fcntl\n", "import subprocess\n", "import pty\n", "import sys\n", "import datetime\n", "from functools import wraps\n", "from werkzeug.ut...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom...
[ "def FUNC_30(self, VAR_44):...\n", "VAR_82 = VAR_44.group(1)\n", "if self._parse_inline_html and VAR_82 in VAR_6:\n", "VAR_14 = VAR_44.group(3)\n", "VAR_64 = VAR_44.group(0)\n", "if VAR_82 == 'a':\n", "return self.renderer.inline_html(VAR_64)\n", "self._in_link = True\n", "VAR_14 = self.output(VAR_1...
[ "def output_inline_html(self, m):...\n", "tag = m.group(1)\n", "if self._parse_inline_html and tag in _inline_tags:\n", "text = m.group(3)\n", "html = m.group(0)\n", "if tag == 'a':\n", "return self.renderer.inline_html(html)\n", "self._in_link = True\n", "text = self.output(text, rules=self.inline_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@VAR_1.route('/' + VAR_0.victim_path)...\n", "VAR_3 = urllib2.build_opener()\n", "VAR_4 = victim_headers()\n", "VAR_3.addheaders = VAR_4\n", "VAR_5 = victim_inject_code(VAR_3.open(VAR_0.url_to_clone).read(), 'lure')\n", "return VAR_5\n" ]
[ "@app.route('/' + trape.victim_path)...\n", "opener = urllib2.build_opener()\n", "headers = victim_headers()\n", "opener.addheaders = headers\n", "html = victim_inject_code(opener.open(trape.url_to_clone).read(), 'lure')\n", "return html\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2():...\n", "if 'auth_token' in g:\n", "return g.get('auth_token')\n", "return None\n" ]
[ "def get_auth_token():...\n", "if 'auth_token' in g:\n", "return g.get('auth_token')\n", "return None\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_3(self) ->Optional[JsonDict]:...\n", "if self.json_callback:\n", "return self.json_callback()\n", "return self.json\n" ]
[ "def get_json(self) ->Optional[JsonDict]:...\n", "if self.json_callback:\n", "return self.json_callback()\n", "return self.json\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_165(VAR_215, VAR_224):...\n", "if not VAR_399:\n", "return None\n", "return serializers.json({'jsonrpc': '2.0', 'id': VAR_215, 'result': VAR_224})\n" ]
[ "def return_response(id, result):...\n", "if not must_respond:\n", "return None\n", "return serializers.json({'jsonrpc': '2.0', 'id': id, 'result': result})\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(VAR_7, VAR_8, VAR_9, VAR_6=()):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_6:\n", "warnings.warn('string', DeprecationWarning)\n", "return [FUNC_0('%s/(?P<pk>\\\\d+)/$' % VAR_7, VAR_8 % 'Edit', VAR_3=\n name_template % 'edit', VAR_6=(name_template % 'edit',)), FUNC_0(\n '%s/new/$' % VAR_7, ...
[ "def get_edit_and_list_urls(url_prefix, view_template, name_template,...\n", "\"\"\"docstring\"\"\"\n", "if permissions:\n", "warnings.warn(\n 'Warning! `get_edit_and_list_urls` permissions attribute will be deprecated in Shuup 2.0 as unused for this util.'\n , DeprecationWarning)\n", "return [admin_u...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Return'" ]
[ "def FUNC_172(VAR_354):...\n", "return VAR_354 + ' ' + VAR_354.replace('icon', 'glyphicon')\n" ]
[ "def rename(icon):...\n", "return icon + ' ' + icon.replace('icon', 'glyphicon')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_108(VAR_169, VAR_7='utf-8'):...\n", "" ]
[ "def safe_decode(param, encoding='utf-8'):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]