lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "@VAR_0.route('/run/<int:qrun_id>/status')...\n", "VAR_27 = g.conn.session.query(QueryRun).get(VAR_7)\n", "if not VAR_27:\n", "return Response('No such query_run id', status=404)\n", "return Response(json.dumps({'status': VAR_27.status_message, 'extra': json.\n loads(VAR_27.extra_info or '{}'), 'timestam...
[ "@app.route('/run/<int:qrun_id>/status')...\n", "qrun = g.conn.session.query(QueryRun).get(qrun_id)\n", "if not qrun:\n", "return Response('No such query_run id', status=404)\n", "return Response(json.dumps({'status': qrun.status_message, 'extra': json.\n loads(qrun.extra_info or '{}'), 'timestamp': qrun...
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Return'" ]
[ "async def FUNC_18(VAR_3):...\n", "VAR_3.write(b'response')\n", "VAR_3.finish()\n" ]
[ "async def callback(request):...\n", "request.write(b'response')\n", "request.finish()\n" ]
[ 0, 0, 0 ]
[ "AsyncFunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_9(self):...\n", "if not self.get('roles') and self.is_standard == 'No':\n", "VAR_5 = frappe.get_meta(self.ref_doctype)\n", "if not VAR_5.istable:\n", "VAR_35 = [{'role': d.role} for d in VAR_5.permissions if d.permlevel == 0]\n", "self.set('roles', VAR_35)\n" ]
[ "def set_doctype_roles(self):...\n", "if not self.get('roles') and self.is_standard == 'No':\n", "meta = frappe.get_meta(self.ref_doctype)\n", "if not meta.istable:\n", "roles = [{'role': d.role} for d in meta.permissions if d.permlevel == 0]\n", "self.set('roles', roles)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_82(VAR_62, *VAR_79, **VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.model.db_query\n", "return frappe.model.db_query.DatabaseQuery(VAR_62).execute(None, *VAR_79,\n **kwargs)\n" ]
[ "def get_list(doctype, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "import frappe.model.db_query\n", "return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **\n kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Return'" ]
[ "@VAR_0.route('/api/preferences/set/<key>/<value>')...\n", "if get_user() is None:\n", "return 'Authentication required', 401\n", "VAR_31()[VAR_10] = None if VAR_11 == 'null' else VAR_11\n", "return Response(json.dumps({'key': VAR_10, 'success': ''})), 201\n" ]
[ "@app.route('/api/preferences/set/<key>/<value>')...\n", "if get_user() is None:\n", "return 'Authentication required', 401\n", "get_preferences()[key] = None if value == 'null' else value\n", "return Response(json.dumps({'key': key, 'success': ''})), 201\n" ]
[ 0, 0, 0, 0, 2 ]
[ "Condition", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_4(self):...\n", "self.edit_unit('Hello, world!\\n', 'Nazdar svete2!\\n')\n", "self.test_credits_one(VAR_1=2)\n" ]
[ "def test_credits_more(self):...\n", "self.edit_unit('Hello, world!\\n', 'Nazdar svete2!\\n')\n", "self.test_credits_one(expected_count=2)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_23(self):...\n", "self.parser = saved_model_cli.create_parser()\n", "VAR_9 = test.test_src_dir_path(VAR_0)\n", "VAR_44 = np.array([[1], [2]])\n", "VAR_45 = np.zeros((6, 3))\n", "VAR_31 = os.path.join(test.get_temp_dir(), 'testRunCommand_inputs.npz')\n", "np.savez(VAR_31, VAR_26=x, VAR_27=x_not...
[ "def testRunCommandExistingOutdir(self):...\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.npz')\n", "n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_0(self, VAR_0, VAR_1):...\n", "VAR_4 = self.setup_test_homeserver(http_client=None, homeserver_to_use=\n GenericWorkerServer)\n", "return VAR_4\n" ]
[ "def make_homeserver(self, reactor, clock):...\n", "hs = self.setup_test_homeserver(http_client=None, homeserver_to_use=\n GenericWorkerServer)\n", "return hs\n" ]
[ 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_5, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "if salt.utils.is_windows():\n", "return True\n", "import pwd\n", "VAR_38 = pwd.getpwnam(VAR_6)\n", "VAR_49 = (\n 'Failed to prepare the Salt environment for user {0}. The user is not available.\\n'\n .format(VAR_6))\n", "for fn_ in VA...
[ "def verify_files(files, user):...\n", "\"\"\"docstring\"\"\"\n", "if salt.utils.is_windows():\n", "return True\n", "import pwd\n", "pwnam = pwd.getpwnam(user)\n", "err = (\n 'Failed to prepare the Salt environment for user {0}. The user is not available.\\n'\n .format(user))\n", "for fn_ in fil...
[ 0, 0, 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'", "Import'", "Assign'", "Assign'", "For", "Assign'", "Expr'", "Assign'", "Return'", "Expr'", "Condition", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Condition", "Condition", "Expr'", "Assign'...
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "VAR_7['widget'] = forms.HiddenInput\n", "super().__init__(*VAR_6, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "kwargs['widget'] = forms.HiddenInput\n", "super().__init__(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_6(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertEqual(VAR_5.evaluate('d/one'), 1)\n" ]
[ "def test_evaluate_simple_path_dict_key_int_value(self):...\n", "ec = self._makeContext()\n", "self.assertEqual(ec.evaluate('d/one'), 1)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "import argparse\n", "import errno\n", "import os\n", "import time\n", "import urllib.parse\n", "from collections import OrderedDict\n", "from hashlib import sha256\n", "from textwrap import dedent\n", "from typing import Any, Callable, Iterable, List, MutableMapping, Optional\n", "import attr\n",...
[ "import argparse\n", "import errno\n", "import os\n", "import time\n", "import urllib.parse\n", "from collections import OrderedDict\n", "from hashlib import sha256\n", "from textwrap import dedent\n", "from typing import Any, Callable, Iterable, List, MutableMapping, Optional\n", "import attr\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docst...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_145 = VAR_2.session.get('rdef')\n", "VAR_15 = None\n", "if VAR_145 is None:\n", "VAR_144 = VAR_2.session.get('fromid', None)\n", "return {'rdef': VAR_145}\n", "if VAR_144 is not None:\n", "VAR_15 = VAR_8.getObject('Image', VAR_144)\n", "if ...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "rdef = request.session.get('rdef')\n", "image = None\n", "if rdef is None:\n", "fromid = request.session.get('fromid', None)\n", "return {'rdef': rdef}\n", "if fromid is not None:\n", "image = conn.getObject('Image', fromid)\n", "if image is no...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_0(VAR_4):...\n", "if VAR_2(VAR_4):\n", "return None\n", "return VAR_3(VAR_4)\n" ]
[ "def _is_javascript_scheme(s):...\n", "if _is_image_dataurl(s):\n", "return None\n", "return _is_possibly_malicious_scheme(s)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_12(VAR_15, VAR_17, VAR_18, VAR_14):...\n", "if VAR_15:\n", "if VAR_17:\n", "if VAR_17:\n", "return json.dumps([VAR_18, {'location': url_for('editbook.edit_book',\n VAR_14=book_id), 'type': 'success', 'format': VAR_15, 'message': _(\n 'Book Format Successfully Deleted')}])\n", "flash(_('Boo...
[ "def render_delete_book_result(book_format, jsonResponse, warning, book_id):...\n", "if book_format:\n", "if jsonResponse:\n", "if jsonResponse:\n", "return json.dumps([warning, {'location': url_for('editbook.edit_book',\n book_id=book_id), 'type': 'success', 'format': book_format, 'message':\n _('Boo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Condition", "Return'", "Expr'", "Return'", "Expr'", "Return'", "Return'" ]
[ "@VAR_0.route('/index_page')...\n", "\"\"\"docstring\"\"\"\n", "if not flask_login.current_user.index_page:\n", "VAR_1.error('User may not be logged in. Clearing cookie auth.')\n", "return clear_cookie_auth()\n", "return FUNC_0()\n", "if flask_login.current_user.index_page == 'landing':\n", "return FU...
[ "@blueprint.route('/index_page')...\n", "\"\"\"docstring\"\"\"\n", "if not flask_login.current_user.index_page:\n", "logger.error('User may not be logged in. Clearing cookie auth.')\n", "return clear_cookie_auth()\n", "return home()\n", "if flask_login.current_user.index_page == 'landing':\n", "return...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Expr'", "Return'", "Return'", "Condition", "Return'", "Condition", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "@contextmanager...\n", "VAR_2 = VAR_0.find_element(By.TAG_NAME, 'html')\n", "yield\n", "WebDriverWait(VAR_0, VAR_1).until(staleness_of(VAR_2))\n" ]
[ "@contextmanager...\n", "old_page = driver.find_element(By.TAG_NAME, 'html')\n", "yield\n", "WebDriverWait(driver, timeout).until(staleness_of(old_page))\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "Expr'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_93 = getIntOrDefault(VAR_2, 'index', 0)\n", "VAR_53 = dict()\n", "VAR_106 = VAR_23 == 'image' and list(VAR_5.getObjects('Image', [VAR_24])\n ) or list()\n", "VAR_107 = VAR_23 == 'dataset' and list(VAR_5.getObjects('Dataset', [VAR_24])\n ) or ...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "index = getIntOrDefault(request, 'index', 0)\n", "context = dict()\n", "images = c_type == 'image' and list(conn.getObjects('Image', [c_id])) or list()\n", "datasets = c_type == 'dataset' and list(conn.getObjects('Dataset', [c_id])\n ) or list()\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Assign'"...
[ "def FUNC_17(self, VAR_26: str, *, VAR_29: Optional[Type[Any]]=None, VAR_13:...\n", "return self.api_route(VAR_26=path, 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 deprecate...
[ "def head(self, path: str, *, response_model: Optional[Type[Any]]=None,...\n", "return self.api_route(path=path, response_model=response_model, status_code\n =status_code, tags=tags, dependencies=dependencies, summary=summary,\n description=description, response_description=response_description,\n respon...
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@VAR_0.filter...\n", "\"\"\"docstring\"\"\"\n", "if VAR_17 is None:\n", "return []\n", "return VAR_17.items()\n" ]
[ "@register.filter...\n", "\"\"\"docstring\"\"\"\n", "if value is None:\n", "return []\n", "return value.items()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Return'" ]
[ "@staticmethod...\n", "VAR_27 = FieldId.from_string(VAR_16)\n", "VAR_28 = VAR_27.click_type.startswith('file')\n", "VAR_29 = VAR_27.click_type.startswith('path')\n", "VAR_30 = VAR_16 in request.files\n", "if VAR_28:\n", "if VAR_30:\n", "if VAR_29:\n", "VAR_5 = CLASS_2(VAR_27)\n", "VAR_5 = CLASS_3(...
[ "@staticmethod...\n", "field_id = FieldId.from_string(key)\n", "is_file = field_id.click_type.startswith('file')\n", "is_path = field_id.click_type.startswith('path')\n", "is_uploaded = key in request.files\n", "if is_file:\n", "if is_uploaded:\n", "if is_path:\n", "field_info = FieldFileInfo(field_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_19(VAR_43):...\n", "VAR_54 = json.loads(VAR_43)\n", "VAR_55 = next(item for item in VAR_54['dates'] if item['type'] == 'modified')[\n 'start_date']\n", "VAR_55 = VAR_55.split('.')[0]\n", "VAR_56 = datetime.strptime(VAR_55, '%Y-%m-%dT%H:%M:%S')\n", "VAR_57 = VAR_56.replace(tzinfo=timezone(time...
[ "def parse_date(json_body):...\n", "json_response = json.loads(json_body)\n", "date = next(item for item in json_response['dates'] if item['type'] ==\n 'modified')['start_date']\n", "date = date.split('.')[0]\n", "parsed_date = datetime.strptime(date, '%Y-%m-%dT%H:%M:%S')\n", "epoch = parsed_date.repla...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(self, VAR_2, VAR_3, VAR_4):...\n", "self.store = VAR_4.get_datastore()\n", "self.hs = VAR_4\n", "self.media_repo = VAR_4.get_media_repository_resource()\n", "self.download_resource = self.media_repo.children[b'download']\n", "self.upload_resource = self.media_repo.children[b'upload']\n", "se...
[ "def prepare(self, reactor, clock, hs):...\n", "self.store = hs.get_datastore()\n", "self.hs = hs\n", "self.media_repo = hs.get_media_repository_resource()\n", "self.download_resource = self.media_repo.children[b'download']\n", "self.upload_resource = self.media_repo.children[b'upload']\n", "self.image_...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_97(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "self.rss_procedures[VAR_10.__name__] = VAR_10\n", "return VAR_10\n" ]
[ "def rss(self, f):...\n", "\"\"\"docstring\"\"\"\n", "self.rss_procedures[f.__name__] = f\n", "return f\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_128(self, VAR_208=160):...\n", "if self.filenames:\n", "return SPAN(H3('Files'), TABLE(*[TR(TD(A(VAR_10, _href=URL(args=self.args +\n [f]))), TD(IMG(_src=URL(args=self.args + [f]), _style='max-width:%spx' %\n width) if VAR_208 and self.isimage(VAR_10) else '')) for VAR_10 in self\n .filenames...
[ "def table_files(self, width=160):...\n", "if self.filenames:\n", "return SPAN(H3('Files'), TABLE(*[TR(TD(A(f, _href=URL(args=self.args + [f])\n )), TD(IMG(_src=URL(args=self.args + [f]), _style='max-width:%spx' %\n width) if width and self.isimage(f) else '')) for f in self.filenames],\n **dict(_class...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_39(VAR_33, VAR_34, VAR_101=None):...\n", "if callable(VAR_64):\n", "if VAR_34 and not isinstance(VAR_34, str):\n", "VAR_143 = VAR_64()\n", "VAR_0.exception(\n 'Error while trying to retrieve custom ETag value for plugin {}'.format\n (VAR_8))\n", "from werkzeug.http import http_date\n", "...
[ "def compute_etag(files, lastmodified, additional=None):...\n", "if callable(custom_etag):\n", "if lastmodified and not isinstance(lastmodified, str):\n", "etag = custom_etag()\n", "_logger.exception(\n 'Error while trying to retrieve custom ETag value for plugin {}'.format\n (key))\n", "from werkze...
[ 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", "Condition", "Assign'", "Expr'", "ImportFrom'", "Condition", "Condition", "Assign'", "Assign'", "Import'", "Return'", "Assign'", "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "For", "Expr'", "Return'" ]
[ "def FUNC_2(self, VAR_5):...\n", "VAR_7 = self.register_user(VAR_5, 'pass')\n", "VAR_8 = self.login(VAR_5, 'pass')\n", "VAR_9 = self.get_success(self.hs.get_datastore().get_user_by_access_token(\n VAR_8))\n", "VAR_10 = VAR_9.token_id\n", "self.get_success(self.hs.get_pusherpool().add_pusher(VAR_7=user_...
[ "def _create_pusher_and_send_msg(self, localpart):...\n", "user_id = self.register_user(localpart, 'pass')\n", "access_token = self.login(localpart, 'pass')\n", "user_dict = self.get_success(self.hs.get_datastore().\n get_user_by_access_token(access_token))\n", "token_id = user_dict.token_id\n", "self....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_18(self):...\n", "" ]
[ "def ensure_requester_left_room(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_166(VAR_215, VAR_309, VAR_37=None, VAR_17=None):...\n", "VAR_394 = {'code': VAR_309}\n", "if VAR_309 in CLASS_5.jsonrpc_errors:\n", "VAR_394['message'] = CLASS_5.jsonrpc_errors[VAR_309][0]\n", "if VAR_37 is not None:\n", "VAR_394['data'] = CLASS_5.jsonrpc_errors[VAR_309][1]\n", "VAR_394['messa...
[ "def return_error(id, code, message=None, data=None):...\n", "error = {'code': code}\n", "if code in Service.jsonrpc_errors:\n", "error['message'] = Service.jsonrpc_errors[code][0]\n", "if message is not None:\n", "error['data'] = Service.jsonrpc_errors[code][1]\n", "error['message'] = message\n", "if...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_26(VAR_57, VAR_58):...\n", "if VAR_57 == 'tab':\n", "return VAR_58 != 'timelapse' or VAR_51\n", "return True\n" ]
[ "def default_template_filter(template_type, template_key):...\n", "if template_type == 'tab':\n", "return template_key != 'timelapse' or enable_timelapse\n", "return True\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(VAR_2, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_33 = saved_model_utils.get_meta_graph_def(VAR_2, VAR_3)\n", "return VAR_33.signature_def\n" ]
[ "def get_signature_def_map(saved_model_dir, tag_set):...\n", "\"\"\"docstring\"\"\"\n", "meta_graph = saved_model_utils.get_meta_graph_def(saved_model_dir, tag_set)\n", "return meta_graph.signature_def\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_17(self):...\n", "VAR_5 = {'rooms': ['!secretbase:unknown']}\n", "VAR_6 = FUNC_0(sender='@foo:bar', type='m.room.message', room_id=\n '!secretbase:unknown')\n", "self.assertTrue(Filter(VAR_5).check(VAR_6))\n" ]
[ "def test_definition_rooms_works_with_literals(self):...\n", "definition = {'rooms': ['!secretbase:unknown']}\n", "event = MockEvent(sender='@foo:bar', type='m.room.message', room_id=\n '!secretbase:unknown')\n", "self.assertTrue(Filter(definition).check(event))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_1(self, VAR_3, VAR_4, VAR_11):...\n", "self.user_id = self.register_user('test', 'test')\n", "self.tok = self.login('test', 'test')\n", "self.displayname = 'test user'\n", "VAR_53 = {'displayname': self.displayname}\n", "VAR_54 = json.dumps(VAR_53)\n", "VAR_22, VAR_23 = self.make_request('PUT'...
[ "def prepare(self, reactor, clock, homeserver):...\n", "self.user_id = self.register_user('test', 'test')\n", "self.tok = self.login('test', 'test')\n", "self.displayname = 'test user'\n", "data = {'displayname': self.displayname}\n", "request_data = json.dumps(data)\n", "request, channel = self.make_re...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_24(VAR_45=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_1.session:\n", "return ['Guest']\n", "import frappe.permissions\n", "return frappe.permissions.get_roles(VAR_45 or VAR_1.session.user)\n" ]
[ "def get_roles(username=None):...\n", "\"\"\"docstring\"\"\"\n", "if not local.session:\n", "return ['Guest']\n", "import frappe.permissions\n", "return frappe.permissions.get_roles(username or local.session.user)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Import'", "Return'" ]
[ "def FUNC_1(self):...\n", "VAR_6 = super().default_config()\n", "VAR_6['start_pushers'] = False\n", "return VAR_6\n" ]
[ "def default_config(self):...\n", "conf = super().default_config()\n", "conf['start_pushers'] = False\n", "return conf\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_155():...\n", "def FUNC_172(VAR_354):...\n", "return VAR_354 + ' ' + VAR_354.replace('icon', 'glyphicon')\n" ]
[ "def bootstrap3():...\n", "def rename(icon):...\n", "return icon + ' ' + icon.replace('icon', 'glyphicon')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Return'" ]
[ "@property...\n", "return super().index()\n" ]
[ "@property...\n", "return super().index()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@staticmethod...\n", "return 'user/files', f'upload-{VAR_39.name}'\n" ]
[ "@staticmethod...\n", "return 'user/files', f'upload-{field.name}'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_67(self, VAR_42=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_42:\n", "VAR_42 = frappe.session.user\n", "if self.meta.track_seen:\n", "VAR_95 = self.get('_seen') or []\n", "VAR_95 = frappe.parse_json(VAR_95)\n", "if VAR_42 not in VAR_95:\n", "VAR_95.append(VAR_42)\n", "frappe.db.s...
[ "def add_seen(self, user=None):...\n", "\"\"\"docstring\"\"\"\n", "if not user:\n", "user = frappe.session.user\n", "if self.meta.track_seen:\n", "_seen = self.get('_seen') or []\n", "_seen = frappe.parse_json(_seen)\n", "if user not in _seen:\n", "_seen.append(user)\n", "frappe.db.set_value(self....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_43(self, VAR_25, *VAR_0, **VAR_1):...\n", "return self.run_method(VAR_25, *VAR_0, **kwargs)\n" ]
[ "def run_trigger(self, method, *args, **kwargs):...\n", "return self.run_method(method, *args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_13(self, VAR_5: str) ->RoomAlias:...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = RoomAlias.from_string(VAR_5)\n", "self.get_success(self.store.create_room_alias_association(VAR_13, self.\n room_id, ['test'], self.admin_user))\n", "return VAR_13\n" ]
[ "def _add_alias(self, alias: str) ->RoomAlias:...\n", "\"\"\"docstring\"\"\"\n", "room_alias = RoomAlias.from_string(alias)\n", "self.get_success(self.store.create_room_alias_association(room_alias, self.\n room_id, ['test'], self.admin_user))\n", "return room_alias\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(self):...\n", "" ]
[ "def test_limits_are_applied(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_84(VAR_14):...\n", "for VAR_13 in VAR_43:\n", "VAR_21 = getattr(self.rules, VAR_13)\n", "return False\n", "VAR_44 = VAR_21.match(VAR_14)\n", "if not VAR_44:\n", "self.line_match = VAR_44\n", "VAR_87 = getattr(self, 'output_%s' % VAR_13)(VAR_44)\n", "if VAR_87 is not None:\n", "return VAR...
[ "def manipulate(text):...\n", "for key in rules:\n", "pattern = getattr(self.rules, key)\n", "return False\n", "m = pattern.match(text)\n", "if not m:\n", "self.line_match = m\n", "out = getattr(self, 'output_%s' % key)(m)\n", "if out is not None:\n", "return m, out\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def __init__(self, VAR_3):...\n", "super().__init__(VAR_3.toDisplayString())\n", "self.url = VAR_3\n" ]
[ "def __init__(self, url):...\n", "super().__init__(url.toDisplayString())\n", "self.url = url\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'" ]
[ "def FUNC_7(VAR_10: Text) ->None:...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = os.path.dirname(os.path.abspath(VAR_10))\n", "if not os.path.exists(VAR_19):\n", "os.makedirs(VAR_19)\n" ]
[ "def create_path(file_path: Text) ->None:...\n", "\"\"\"docstring\"\"\"\n", "parent_dir = os.path.dirname(os.path.abspath(file_path))\n", "if not os.path.exists(parent_dir):\n", "os.makedirs(parent_dir)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'" ]
[ "@VAR_0.before_first_request...\n", "\"\"\"docstring\"\"\"\n", "if VAR_0.config['WEB_CLI'] is True:\n", "FUNC_61(VAR_0.config['INTERNAL_PORT'], VAR_25=gui.config['GANGA_ARGS'])\n", "if VAR_0.config['INTERNAL_PORT'] is None:\n", "VAR_84['WEB_CLI'] = True\n", "VAR_0.config['INTERNAL_PORT'] = os.environ['I...
[ "@gui.before_first_request...\n", "\"\"\"docstring\"\"\"\n", "if gui.config['WEB_CLI'] is True:\n", "start_ganga(gui.config['INTERNAL_PORT'], args=gui.config['GANGA_ARGS'])\n", "if gui.config['INTERNAL_PORT'] is None:\n", "session['WEB_CLI'] = True\n", "gui.config['INTERNAL_PORT'] = os.environ['INTERNAL...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "For", "Docstring", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_21(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_20 = jinja.render('error.html', title='Error while opening qute://url',\n VAR_3=url.toDisplayString(), VAR_8=\n '{} is not available with this backend'.format(url.toDisplayString()))\n", "return 'text/html', VAR_20\n" ]
[ "def wrong_backend_handler(self, url):...\n", "\"\"\"docstring\"\"\"\n", "src = jinja.render('error.html', title='Error while opening qute://url',\n url=url.toDisplayString(), error=\n '{} is not available with this backend'.format(url.toDisplayString()))\n", "return 'text/html', src\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_62(self, VAR_18, VAR_30, VAR_31, VAR_32=None, VAR_33=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_74 = {'in': _('one of'), 'not in': _('none of'), '^': _('beginning with')}\n", "if not VAR_32:\n", "VAR_32 = self\n", "VAR_75 = VAR_32.get_value(VAR_18)\n", "VAR_19 = VAR_32.meta.get_field(VAR_18...
[ "def validate_value(self, fieldname, condition, val2, doc=None,...\n", "\"\"\"docstring\"\"\"\n", "error_condition_map = {'in': _('one of'), 'not in': _('none of'), '^': _(\n 'beginning with')}\n", "if not doc:\n", "doc = self\n", "val1 = doc.get_value(fieldname)\n", "df = doc.meta.get_field(fieldnam...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(VAR_23=None, VAR_26=None, VAR_27=True):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.database import get_db\n", "if VAR_23:\n", "FUNC_4(VAR_23)\n", "VAR_1.db = get_db(VAR_10=db_name or local.conf.db_name)\n", "if VAR_27:\n", "FUNC_22('Administrator')\n" ]
[ "def connect(site=None, db_name=None, set_admin_as_user=True):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.database import get_db\n", "if site:\n", "init(site)\n", "local.db = get_db(user=db_name or local.conf.db_name)\n", "if set_admin_as_user:\n", "set_user('Administrator')\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Condition", "Expr'", "Assign'", "Condition", "Expr'" ]
[ "async def FUNC_8(self):...\n", "return self.get_repo_url()\n" ]
[ "async def get_resolved_ref_url(self):...\n", "return self.get_repo_url()\n" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Return'" ]
[ "def FUNC_14(self, VAR_36, *VAR_37):...\n", "" ]
[ "def log_message(self, format, *args):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(self, VAR_2, VAR_3, VAR_4):...\n", "VAR_30 = ReplicationStreamProtocolFactory(VAR_4)\n", "self.streamer = VAR_4.get_replication_streamer()\n", "self.server = VAR_30.buildProtocol(None)\n", "self.reactor.lookups['testserv'] = '1.2.3.4'\n", "self.worker_hs = self.setup_test_homeserver(http_clien...
[ "def prepare(self, reactor, clock, hs):...\n", "server_factory = ReplicationStreamProtocolFactory(hs)\n", "self.streamer = hs.get_replication_streamer()\n", "self.server = server_factory.buildProtocol(None)\n", "self.reactor.lookups['testserv'] = '1.2.3.4'\n", "self.worker_hs = self.setup_test_homeserver(...
[ 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_22(self):...\n", "if self.page_key is None:\n", "return\n", "VAR_33 = g.conn.session.query(Query).get(self.page_key)\n", "if VAR_33:\n", "VAR_37 = VAR_33.latest_rev.latest_run.id\n", "if self.direction == 'prev':\n", "self.queryset = self.queryset.filter(QueryRun.id > VAR_37)\n", "self.que...
[ "def filter_queryset(self):...\n", "if self.page_key is None:\n", "return\n", "from_query = g.conn.session.query(Query).get(self.page_key)\n", "if from_query:\n", "from_qrun_id = from_query.latest_rev.latest_run.id\n", "if self.direction == 'prev':\n", "self.queryset = self.queryset.filter(QueryRun.id...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_13(VAR_24):...\n", "\"\"\"docstring\"\"\"\n", "VAR_34 = VAR_0.findall(VAR_24)\n", "if not VAR_34:\n", "return [VAR_24]\n", "VAR_34 = [e.encode('ascii').decode('unicode_escape') for e in VAR_34]\n", "return VAR_34\n" ]
[ "def parse_etags(etag_str):...\n", "\"\"\"docstring\"\"\"\n", "etags = ETAG_MATCH.findall(etag_str)\n", "if not etags:\n", "return [etag_str]\n", "etags = [e.encode('ascii').decode('unicode_escape') for e in etags]\n", "return etags\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_25(VAR_46, VAR_47=None):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_16.headers.get(VAR_46, VAR_47)\n" ]
[ "def get_request_header(key, default=None):...\n", "\"\"\"docstring\"\"\"\n", "return request.headers.get(key, default)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_3(VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = VAR_3.replace(',', ' ').replace(';', ' ')\n", "return VAR_3.strip().split()\n" ]
[ "def split_list(text):...\n", "\"\"\"docstring\"\"\"\n", "text = text.replace(',', ' ').replace(';', ' ')\n", "return text.strip().split()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_52(VAR_16, VAR_22, VAR_23, VAR_24, VAR_25):...\n", "VAR_22.default_language = VAR_16['default_language']\n", "VAR_22.locale = VAR_16.get('locale', VAR_22.locale)\n", "VAR_22.sidebar_view = sum(VAR_119(key[5:]) for key in VAR_16 if key.\n startswith('show_'))\n", "if 'show_detail_random' in VAR_...
[ "def _handle_new_user(to_save, content, languages, translations, kobo_support):...\n", "content.default_language = to_save['default_language']\n", "content.locale = to_save.get('locale', content.locale)\n", "content.sidebar_view = sum(int(key[5:]) for key in to_save if key.\n startswith('show_'))\n", "if...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "AugAssign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Return'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'", "C...
[ "def FUNC_46(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_161 = [(state_key, int(VAR_1.depth)) for (e_type, state_key), VAR_1 in\n VAR_2.items() if e_type == VAR_188.Member and VAR_1.membership ==\n Membership.JOIN]\n", "VAR_162 = {}\n", "for u, d in VAR_161:\n", "return sorted(VAR_162.items(), VA...
[ "def get_domains_from_state(state):...\n", "\"\"\"docstring\"\"\"\n", "joined_users = [(state_key, int(event.depth)) for (e_type, state_key),\n event in state.items() if e_type == EventTypes.Member and event.\n membership == Membership.JOIN]\n", "joined_domains = {}\n", "for u, d in joined_users:\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "@FUNC_0...\n", "return FederationHandlerRegistry(self)\n" ]
[ "@cache_in_self...\n", "return FederationHandlerRegistry(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def __init__(self, VAR_0, VAR_22, VAR_23=None, VAR_3=None, VAR_5=True, VAR_6=()...\n", "self.permissions = tuple(VAR_6)\n", "self.require_authentication = VAR_5\n", "if callable(VAR_22):\n", "VAR_22 = self.wrap_with_permissions(VAR_22)\n", "from django.urls import re_path\n", "VAR_30 = re_path(VAR_0, V...
[ "def __init__(self, regex, callback, default_args=None, name=None,...\n", "self.permissions = tuple(permissions)\n", "self.require_authentication = require_authentication\n", "if callable(callback):\n", "callback = self.wrap_with_permissions(callback)\n", "from django.urls import re_path\n", "repath = r...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "ImportFrom'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_3(self, *, VAR_4: str) ->Set[str]:...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = super().get_imports(VAR_4=prefix)\n", "for VAR_21 in self.inner_properties:\n", "VAR_8.update(VAR_21.get_imports(VAR_4=prefix))\n", "VAR_8.add('from typing import Union')\n", "return VAR_8\n" ]
[ "def get_imports(self, *, prefix: str) ->Set[str]:...\n", "\"\"\"docstring\"\"\"\n", "imports = super().get_imports(prefix=prefix)\n", "for inner_prop in self.inner_properties:\n", "imports.update(inner_prop.get_imports(prefix=prefix))\n", "imports.add('from typing import Union')\n", "return imports\n" ...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_30(VAR_16):...\n", "VAR_35 = PerspectivesKeyFetcher(self.hs)\n", "VAR_23 = {VAR_34: {'key1': 0}}\n", "self.expect_outgoing_key_query(VAR_34, 'key1', VAR_16)\n", "return self.get_success(VAR_35.get_keys(VAR_23))\n" ]
[ "def get_key_from_perspectives(response):...\n", "fetcher = PerspectivesKeyFetcher(self.hs)\n", "keys_to_fetch = {SERVER_NAME: {'key1': 0}}\n", "self.expect_outgoing_key_query(SERVER_NAME, 'key1', response)\n", "return self.get_success(fetcher.get_keys(keys_to_fetch))\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_3(VAR_7, VAR_8='r'):...\n", "VAR_22 = FUNC_2(VAR_7, VAR_8)\n", "return VAR_22.read()\n", "VAR_22.close()\n" ]
[ "def safe_read(a, b='r'):...\n", "safe_file = safe_open(a, b)\n", "return safe_file.read()\n", "safe_file.close()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_166(VAR_215, VAR_309, VAR_37, VAR_17=None):...\n", "VAR_394 = {'name': 'JSONRPCError', 'code': VAR_309, 'message': VAR_37}\n", "if VAR_17 is not None:\n", "VAR_394['data'] = VAR_17\n", "return serializers.json({'id': VAR_215, 'version': '1.1', 'error': VAR_394})\n" ]
[ "def return_error(id, code, message, data=None):...\n", "error = {'name': 'JSONRPCError', 'code': code, 'message': message}\n", "if data is not None:\n", "error['data'] = data\n", "return serializers.json({'id': id, 'version': '1.1', 'error': error})\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def __init__(self, VAR_20):...\n", "super().__init__(VAR_20)\n", "self.mode = self.param.click_type.split('[')[1][:-1]\n", "self.generate_download_link = True if 'w' in self.mode else False\n", "self.link_name = f'{self.cmd_opt}.out'\n", "VAR_0.info(f'File mode for {self.key} is {self.mode}')\n" ]
[ "def __init__(self, fimeta):...\n", "super().__init__(fimeta)\n", "self.mode = self.param.click_type.split('[')[1][:-1]\n", "self.generate_download_link = True if 'w' in self.mode else False\n", "self.link_name = f'{self.cmd_opt}.out'\n", "logger.info(f'File mode for {self.key} is {self.mode}')\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@VAR_2.route('/download/<int:book_id>/<book_format>', defaults={'anyname':...\n", "VAR_96 = 'kobo' if 'Kobo' in request.headers.get('User-Agent') else ''\n", "return get_download_link(VAR_5, VAR_6, VAR_96)\n" ]
[ "@web.route('/download/<int:book_id>/<book_format>', defaults={'anyname':...\n", "client = 'kobo' if 'Kobo' in request.headers.get('User-Agent') else ''\n", "return get_download_link(book_id, book_format, client)\n" ]
[ 0, 0, 0 ]
[ "For", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_4):...\n", "@wraps(VAR_4)...\n", "if VAR_87.role_viewer():\n", "return VAR_4(*VAR_49, **kwargs)\n", "abort(403)\n", "return FUNC_71\n" ]
[ "def viewer_required(f):...\n", "@wraps(f)...\n", "if current_user.role_viewer():\n", "return f(*args, **kwargs)\n", "abort(403)\n", "return inner\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "Expr'", "Return'" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = FUNC_1('/groups/%s/users/%s/join', VAR_30, VAR_16)\n", "return self.client.post_json(VAR_5=destination, VAR_2=path, VAR_39=content,\n VAR_15=True)\n" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "path = _create_v1_path('/groups/%s/users/%s/join', group_id, user_id)\n", "return self.client.post_json(destination=destination, path=path, data=\n content, ignore_backoff=True)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'" ]
[ "def __init__(self):...\n", "VAR_56 = def_function.function(self.multiply, input_signature=[tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.TensorSpec(\n shape=(), dtype=dtypes.float32)])\n", "self.pure_concrete_function = VAR_56.get_concrete_function()\n", "super(CLASS_2, self)._...
[ "def __init__(self):...\n", "function = def_function.function(self.multiply, input_signature=[\n tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32)])\n", "self.pure_concrete_function = function.get_concrete_function()\n", "super(DummyModel, ...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(self, VAR_1, VAR_2=None):...\n", "if 1 == 1:\n", "VAR_8 = self.get_argument('limit')\n", "VAR_2 = self.get_argument('word')\n", "VAR_9 = self.get_argument('callback')\n", "VAR_10 = rtxcomplete.get_nodes_like(VAR_2, VAR_8)\n", "VAR_10 = VAR_9 + '(' + json.dumps(VAR_10) + ');'\n", "self.writ...
[ "def get(self, arg, word=None):...\n", "if 1 == 1:\n", "limit = self.get_argument('limit')\n", "word = self.get_argument('word')\n", "callback = self.get_argument('callback')\n", "result = rtxcomplete.get_nodes_like(word, limit)\n", "result = callback + '(' + json.dumps(result) + ');'\n", "self.write(...
[ 0, 2, 0, 0, 2, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_3=None):...\n", "VAR_28 = {'class': 'vURLField'}\n", "if VAR_3 is not None:\n", "VAR_28.update(VAR_3)\n", "super(CLASS_13, self).__init__(VAR_3=final_attrs)\n" ]
[ "def __init__(self, attrs=None):...\n", "final_attrs = {'class': 'vURLField'}\n", "if attrs is not None:\n", "final_attrs.update(attrs)\n", "super(AdminURLFieldWidget, self).__init__(attrs=final_attrs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_13() ->Pattern:...\n", "\"\"\"docstring\"\"\"\n", "return re.compile('[😀-🙏🌀-🗿🚀-\\U0001f6ff\\U0001f1e0-🇿✂-➰Ⓜ-🉑\\u200d\\u200c]+',\n flags=re.UNICODE)\n" ]
[ "def get_emoji_regex() ->Pattern:...\n", "\"\"\"docstring\"\"\"\n", "return re.compile('[😀-🙏🌀-🗿🚀-\\U0001f6ff\\U0001f1e0-🇿✂-➰Ⓜ-🉑\\u200d\\u200c]+',\n flags=re.UNICODE)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_131(self, VAR_212):...\n", "return self.markmin_base(VAR_212.body) + self.render_tags(VAR_212.tags).xml()\n" ]
[ "def markmin_render(self, page):...\n", "return self.markmin_base(page.body) + self.render_tags(page.tags).xml()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "from typing import Optional\n", "from netaddr import IPSet\n", "from synapse.config._base import Config, ConfigError\n", "from synapse.config._util import validate_config\n", "VAR_1 = 'federation'\n", "def FUNC_0(self, VAR_2, **VAR_3):...\n", "self.federation_domain_whitelist = None\n", "VAR_6 = VAR_...
[ "from typing import Optional\n", "from netaddr import IPSet\n", "from synapse.config._base import Config, ConfigError\n", "from synapse.config._util import validate_config\n", "section = 'federation'\n", "def read_config(self, config, **kwargs):...\n", "self.federation_domain_whitelist = None\n", "fed...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 4, 0, 0, 0, 4 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "FunctionDef'", "Return'" ]
[ "from __future__ import absolute_import, unicode_literals\n", "import re\n", "from collections import OrderedDict\n", "from django import template\n", "from django.template import loader\n", "from django.urls import NoReverseMatch, reverse\n", "from django.utils import six\n", "from django.utils.encod...
[ "from __future__ import absolute_import, unicode_literals\n", "import re\n", "from collections import OrderedDict\n", "from django import template\n", "from django.template import loader\n", "from django.urls import NoReverseMatch, reverse\n", "from django.utils import six\n", "from django.utils.encod...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_112(self, VAR_174):...\n", "\"\"\"docstring\"\"\"\n", "super(CLASS_0, self).update(VAR_174)\n", "return self\n" ]
[ "def update(self, d):...\n", "\"\"\"docstring\"\"\"\n", "super(_dict, self).update(d)\n", "return self\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Return'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_250 = VAR_213.split('/')\n", "VAR_104, VAR_105, VAR_11 = VAR_250[0], VAR_250[1], VAR_250[2:]\n", "return LOAD(VAR_104, VAR_105, VAR_11=args, ajax=True).xml()\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "items = text.split('/')\n", "controller, function, args = items[0], items[1], items[2:]\n", "return LOAD(controller, function, args=args, ajax=True).xml()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_7(self, VAR_0, VAR_1, VAR_5):...\n", "self.http_client2 = Mock()\n", "VAR_18 = FUNC_6(name='keyclient')\n", "VAR_18['trusted_key_servers'] = [{'server_name': self.hs.hostname,\n 'verify_keys': {('ed25519:%s' % (self.hs_signing_key.version,)):\n signedjson.key.encode_verify_key_base64(self.hs_s...
[ "def prepare(self, reactor, clock, homeserver):...\n", "self.http_client2 = Mock()\n", "config = default_config(name='keyclient')\n", "config['trusted_key_servers'] = [{'server_name': self.hs.hostname,\n 'verify_keys': {('ed25519:%s' % (self.hs_signing_key.version,)):\n signedjson.key.encode_verify_key_...
[ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "AsyncFunctionDef'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_18):...\n", "VAR_28 = self.secured.get(VAR_18.id)\n", "if VAR_28 is not None:\n", "return Symbol(VAR_28)\n", "return VAR_18\n" ]
[ "def visit_Name(self, node):...\n", "value = self.secured.get(node.id)\n", "if value is not None:\n", "return Symbol(value)\n", "return node\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_5(self):...\n", "VAR_7 = self.uncreated_rmid\n", "self._test_get_membership(VAR_8=[self.user_id, self.rmcreator_id], VAR_7=\n room, VAR_9=403)\n", "self.helper.invite(VAR_7=room, src=self.user_id, targ=self.rmcreator_id,\n VAR_9=403)\n", "for usr in [self.user_id, self.rmcreator_id]:\n", "...
[ "def test_membership_basic_room_perms(self):...\n", "room = self.uncreated_rmid\n", "self._test_get_membership(members=[self.user_id, self.rmcreator_id], room=\n room, expect_code=403)\n", "self.helper.invite(room=room, src=self.user_id, targ=self.rmcreator_id,\n expect_code=403)\n", "for usr in [self...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "For", "Expr'", "Expr'" ]
[ "async def FUNC_7(self, VAR_18: str, VAR_19: str, VAR_14: str, VAR_20:...\n", "\"\"\"docstring\"\"\"\n", "VAR_39 = FUNC_2([pa['room_id'] for pa in VAR_20])\n", "VAR_26 = await self.store.get_events([pa['event_id'] for pa in VAR_20])\n", "VAR_32 = {}\n", "for pa in VAR_20:\n", "VAR_32.setdefault(pa['room...
[ "async def send_notification_mail(self, app_id: str, user_id: str,...\n", "\"\"\"docstring\"\"\"\n", "rooms_in_order = deduped_ordered_list([pa['room_id'] for pa in push_actions])\n", "notif_events = await self.store.get_events([pa['event_id'] for pa in\n push_actions])\n", "notifs_by_room = {}\n", "fo...
[ 0, 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'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "AsyncFunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Exp...
[ "def FUNC_4(self, VAR_2, VAR_3, VAR_4='other_server'):...\n", "VAR_7 = self.helper.create_room_as(VAR_2, tok=token)\n", "VAR_13 = self.hs.get_datastore()\n", "VAR_14 = self.hs.get_federation_handler()\n", "VAR_15 = self.get_success(VAR_13.get_latest_event_ids_in_room(VAR_7))\n", "VAR_16 = self.get_success...
[ "def create_room_with_remote_server(self, user, token, remote_server=...\n", "room = self.helper.create_room_as(user, tok=token)\n", "store = self.hs.get_datastore()\n", "federation = self.hs.get_federation_handler()\n", "prev_event_ids = self.get_success(store.get_latest_event_ids_in_room(room))\n", "roo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_24(VAR_35):...\n", "VAR_35.terminate()\n", "VAR_35.join()\n" ]
[ "def close_server(process):...\n", "process.terminate()\n", "process.join()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def __init__(self):...\n", "self._configs = OrderedDict()\n", "for VAR_74 in self.config_classes:\n", "if VAR_74.section is None:\n", "VAR_78 = VAR_74(self)\n", "self._configs[VAR_74.section] = VAR_78\n" ]
[ "def __init__(self):...\n", "self._configs = OrderedDict()\n", "for config_class in self.config_classes:\n", "if config_class.section is None:\n", "conf = config_class(self)\n", "self._configs[config_class.section] = conf\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_15(self, VAR_14: str, VAR_15: str, VAR_16: dict) ->None:...\n", "\"\"\"docstring\"\"\"\n", "async def FUNC_28(VAR_40, VAR_41, VAR_48, **VAR_3):...\n", "self.assertEqual(VAR_40, self.mock_perspective_server.server_name)\n", "self.assertEqual(VAR_41, '/_matrix/key/v2/query')\n", "VAR_51 = VAR_48['...
[ "def expect_outgoing_key_query(self, expected_server_name: str,...\n", "\"\"\"docstring\"\"\"\n", "async def post_json(destination, path, data, **kwargs):...\n", "self.assertEqual(destination, self.mock_perspective_server.server_name)\n", "self.assertEqual(path, '/_matrix/key/v2/query')\n", "q = data['ser...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "AsyncFunctionDef'", "Expr'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_58(self, VAR_36, VAR_82, VAR_141):...\n", "\"\"\"docstring\"\"\"\n", "VAR_275 = str(int(time.time())) + '-' + web2py_uuid()\n", "VAR_276 = self.url(self.settings.function, VAR_11=('confirm_registration',),\n VAR_96={'key': reset_password_key}, VAR_97=True)\n", "VAR_27 = dict(VAR_141)\n", "VAR...
[ "def email_registration(self, subject, body, user):...\n", "\"\"\"docstring\"\"\"\n", "reset_password_key = str(int(time.time())) + '-' + web2py_uuid()\n", "link = self.url(self.settings.function, args=('confirm_registration',),\n vars={'key': reset_password_key}, scheme=True)\n", "d = dict(user)\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Return'", "Return'" ]
[ "@app.route('/login')...\n", "from flask_login import current_user\n", "VAR_40 = request.args.get('redirect', request.script_root + url_for('index'))\n", "VAR_41 = sorted(filter(lambda VAR_136: VAR_136 is not None and isinstance(\n VAR_136, OctoPrintPermission), map(lambda VAR_136: getattr(Permissions,\n ...
[ "@app.route('/login')...\n", "from flask_login import current_user\n", "redirect_url = request.args.get('redirect', request.script_root + url_for(\n 'index'))\n", "permissions = sorted(filter(lambda x: x is not None and isinstance(x,\n OctoPrintPermission), map(lambda x: getattr(Permissions, x.strip()),...
[ 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "ImportFrom'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Return'", "AugAssign'", "AugAssign'", "Expr'" ]
[ "def FUNC_51(VAR_133, VAR_134=None):...\n", "" ]
[ "def get_next(it, opt=None):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_2(VAR_5, VAR_4, VAR_10=None, VAR_11=None):...\n", "if VAR_5.component.has_template():\n", "return CLASS_61(VAR_5, VAR_4, VAR_10=data, VAR_11=initial)\n", "if VAR_5.component.is_glossary:\n", "if VAR_5.is_source:\n", "if VAR_5.is_source:\n", "return CLASS_64(VAR_5, VAR_4, VAR_10=data, VAR_11=in...
[ "def get_new_unit_form(translation, user, data=None, initial=None):...\n", "if translation.component.has_template():\n", "return NewMonolingualUnitForm(translation, user, data=data, initial=initial)\n", "if translation.component.is_glossary:\n", "if translation.is_source:\n", "if translation.is_source:\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Condition", "Condition", "Return'", "Return'", "Return'", "Return'" ]
[ "def FUNC_9():...\n", "return FUNC_4('use_email_as_submitter')\n" ]
[ "def use_email_as_submitter_default():...\n", "return get_default_setting('use_email_as_submitter')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_5(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_31 = saved_model_utils.read_saved_model(VAR_2).meta_graphs\n", "VAR_32 = False\n", "for VAR_4 in VAR_31:\n", "VAR_32 |= VAR_4.HasField('object_graph_def')\n", "if not VAR_32:\n", "return\n", "VAR_64 = load.load(VAR_2)\n", "print(\"\"\"\nCo...
[ "def _show_defined_functions(saved_model_dir):...\n", "\"\"\"docstring\"\"\"\n", "meta_graphs = saved_model_utils.read_saved_model(saved_model_dir).meta_graphs\n", "has_object_graph_def = False\n", "for meta_graph_def in meta_graphs:\n", "has_object_graph_def |= meta_graph_def.HasField('object_graph_def')...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "AugAssign'", "Condition", "Return'", "Assign'", "Expr'", "Assign'", "Assign'", "For", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "For", "Assign'", "Condition", "Assign'", "Condi...
[ "def test___post_init__(self):...\n", "from openapi_python_client.parser.properties import StringProperty\n", "VAR_8 = VAR_35(VAR_5='test', VAR_26=True, default='A Default Value')\n", "assert VAR_8.default == '\"A Default Value\"'\n" ]
[ "def test___post_init__(self):...\n", "from openapi_python_client.parser.properties import StringProperty\n", "sp = StringProperty(name='test', required=True, default='A Default Value')\n", "assert sp.default == '\"A Default Value\"'\n" ]
[ 0, 0, 5, 5 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assert'" ]
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "self.profile = None\n", "super().__init__(*VAR_6, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "self.profile = None\n", "super().__init__(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "VAR_65 = get_course_with_access(VAR_9.user, 'staff', VAR_10, depth=None)\n", "VAR_67 = instructor_analytics.basic.dump_grading_context(VAR_65)\n", "VAR_63 = {'course_id': VAR_10.to_...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "course = get_course_with_access(request.user, 'staff', course_id, depth=None)\n", "grading_config_summary = instructor_analytics.basic.dump_grading_context(course\n )\n", "...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_44(self):...\n", "VAR_12 = 'hello'\n", "VAR_22, VAR_23 = self.make_request('POST',\n '/_matrix/client/r0/rooms/{}/unban'.format(self.room_id), VAR_19={\n 'reason': reason, 'user_id': self.second_user_id}, VAR_16=self.creator_tok)\n", "self.assertEqual(VAR_23.code, 200, VAR_23.result)\n", "se...
[ "def test_unban_reason(self):...\n", "reason = 'hello'\n", "request, channel = self.make_request('POST',\n '/_matrix/client/r0/rooms/{}/unban'.format(self.room_id), content={\n 'reason': reason, 'user_id': self.second_user_id}, access_token=self.\n creator_tok)\n", "self.assertEqual(channel.code, 200...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_79(self):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.desk.doctype.tag.tag import DocTags\n", "return DocTags(self.doctype).get_tags(self.name).split(',')[1:]\n" ]
[ "def get_tags(self):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.desk.doctype.tag.tag import DocTags\n", "return DocTags(self.doctype).get_tags(self.name).split(',')[1:]\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Return'" ]
[ "def FUNC_36(self, VAR_20):...\n", "if VAR_20 == constants.SIDEBAR_RECENT:\n", "return True\n", "return constants.has_flag(self.sidebar_view, VAR_20)\n" ]
[ "def check_visibility(self, value):...\n", "if value == constants.SIDEBAR_RECENT:\n", "return True\n", "return constants.has_flag(self.sidebar_view, value)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_18(VAR_9, VAR_10):...\n", "if VAR_87.check_visibility(constants.SIDEBAR_HOT):\n", "if VAR_10[1] not in ['hotasc', 'hotdesc']:\n", "abort(404)\n", "VAR_10 = [func.count(ub.Downloads.book_id).desc()], 'hotdesc'\n", "if VAR_87.show_detail_random():\n", "VAR_68 = calibre_db.session.query(db.Books)...
[ "def render_hot_books(page, order):...\n", "if current_user.check_visibility(constants.SIDEBAR_HOT):\n", "if order[1] not in ['hotasc', 'hotdesc']:\n", "abort(404)\n", "order = [func.count(ub.Downloads.book_id).desc()], 'hotdesc'\n", "if current_user.show_detail_random():\n", "random = calibre_db.sessio...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_2(self) ->str:...\n", "\"\"\"docstring\"\"\"\n", "if self.required:\n", "return self._type_string\n", "return f'Optional[{self._type_string}]'\n" ]
[ "def get_type_string(self) ->str:...\n", "\"\"\"docstring\"\"\"\n", "if self.required:\n", "return self._type_string\n", "return f'Optional[{self._type_string}]'\n" ]
[ 0, 0, 5, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_2, VAR_3):...\n", "self.app = VAR_2\n", "self.memcache_servers = VAR_3.get('memcache_servers')\n", "if not self.memcache_servers:\n", "VAR_6 = os.path.join(VAR_3.get('swift_dir', '/etc/swift'), 'memcache.conf')\n", "if not self.memcache_servers:\n", "VAR_7 = ConfigParser()\n", ...
[ "def __init__(self, app, conf):...\n", "self.app = app\n", "self.memcache_servers = conf.get('memcache_servers')\n", "if not self.memcache_servers:\n", "path = os.path.join(conf.get('swift_dir', '/etc/swift'), 'memcache.conf')\n", "if not self.memcache_servers:\n", "memcache_conf = ConfigParser()\n", ...
[ 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 5 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'" ]