lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "def FUNC_77(self, VAR_148, VAR_149='', VAR_150=0, VAR_90=None):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_84(self=self, VAR_148=VAR_148, VAR_149=VAR_149, VAR_150=VAR_150):...\n", "return self.has_permission(VAR_148, VAR_149, VAR_150)\n" ]
[ "def requires_permission(self, name, table_name='', record_id=0, otherwise=None...\n", "\"\"\"docstring\"\"\"\n", "def has_permission(self=self, name=name, table_name=table_name, record_id=...\n", "return self.has_permission(name, table_name, record_id)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Return'" ]
[ "def FUNC_16(self, VAR_5, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_34 = tempfile.mkdtemp(dir=FLAGS.image_decryption_dir)\n", "VAR_35 = VAR_10['properties']['image_location']\n", "VAR_36 = VAR_35.split('/')[0]\n", "VAR_37 = VAR_35[len(VAR_36) + 1:]\n", "VAR_13 = self._conn(VAR_5).get_bucket(VAR_36...
[ "def _s3_create(self, context, metadata):...\n", "\"\"\"docstring\"\"\"\n", "image_path = tempfile.mkdtemp(dir=FLAGS.image_decryption_dir)\n", "image_location = metadata['properties']['image_location']\n", "bucket_name = image_location.split('/')[0]\n", "manifest_path = image_location[len(bucket_name) + 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "For", "Expr'", "Assign'", "E...
[ "@staticmethod...\n", "VAR_11 = VAR_5.add_argument_group('registration')\n", "VAR_11.add_argument('--enable-registration', action='store_true', default=\n None, help='Enable registration for new users.')\n" ]
[ "@staticmethod...\n", "reg_group = parser.add_argument_group('registration')\n", "reg_group.add_argument('--enable-registration', action='store_true',\n default=None, help='Enable registration for new users.')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'" ]
[ "@VAR_0.route('/shutdown', methods=['GET'])...\n", "if VAR_0.config['WEB_CLI'] is True:\n", "flash(\n 'WEB CLI Mode is on, cannot self shutdown server. Consider doing manually.'\n , 'warning')\n", "VAR_98 = FUNC_58('/shutdown', 'get')\n", "return jsonify({'success': False, 'message': str(err)}), 400\n...
[ "@gui.route('/shutdown', methods=['GET'])...\n", "if gui.config['WEB_CLI'] is True:\n", "flash(\n 'WEB CLI Mode is on, cannot self shutdown server. Consider doing manually.'\n , 'warning')\n", "response_info = query_internal_api('/shutdown', 'get')\n", "return jsonify({'success': False, 'message': str...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Return'", "Return'", "Return'" ]
[ "def FUNC_0(VAR_1):...\n", "if not VAR_1:\n", "VAR_3 = None\n", "VAR_3 = reverse_with_params(viewname=lookup_view['viewname'], VAR_23=\n lookup_view.get('args', []), query_string=lookup_view.get(\n 'query_string', None))\n", "if VAR_3 is None:\n", "resolve(VAR_1)\n", "VAR_0.error(\"Reverse for '%s...
[ "def parse_url(lookup_view):...\n", "if not lookup_view:\n", "url = None\n", "url = reverse_with_params(viewname=lookup_view['viewname'], args=\n lookup_view.get('args', []), query_string=lookup_view.get(\n 'query_string', None))\n", "if url is None:\n", "resolve(lookup_view)\n", "logger.error(\"R...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Return'", "Assign'" ]
[ "def FUNC_98(VAR_91=None, VAR_158=False, VAR_159=True, VAR_160=None, VAR_161...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils.logger import get_logger\n", "return get_logger(VAR_91=module, VAR_158=with_more_info, VAR_159=allow_site,\n VAR_160=filter, VAR_161=max_size, VAR_162=file_count)\n" ]
[ "def logger(module=None, with_more_info=False, allow_site=True, filter=None,...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils.logger import get_logger\n", "return get_logger(module=module, with_more_info=with_more_info, allow_site=\n allow_site, filter=filter, max_size=max_size, file_count=file_count)\...
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "ImportFrom'", "Return'" ]
[ "def FUNC_24(self, VAR_12):...\n", "VAR_14 = None\n", "if VAR_12.get('sort_by'):\n", "VAR_26 = CLASS_0._format(VAR_12.get('sort_by').split('.')) + ' ' + VAR_12.get(\n 'sort_order')\n", "if VAR_12.get('order_by'):\n", "if VAR_12.get('sort_by_next'):\n", "VAR_26 = VAR_12.get('order_by')\n", "VAR_26 =...
[ "def get_standard_report_order_by(self, params):...\n", "group_by_args = None\n", "if params.get('sort_by'):\n", "order_by = Report._format(params.get('sort_by').split('.')) + ' ' + params.get(\n 'sort_order')\n", "if params.get('order_by'):\n", "if params.get('sort_by_next'):\n", "order_by = params....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "AugAssign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'" ]
[ "@CLASS_4('bindings')...\n", "\"\"\"docstring\"\"\"\n", "VAR_26 = {}\n", "VAR_27 = config.val.bindings.default\n", "VAR_28 = set(VAR_27.keys()).union(config.val.bindings.commands)\n", "VAR_28.remove('normal')\n", "VAR_28 = ['normal'] + sorted(list(VAR_28))\n", "for VAR_41 in VAR_28:\n", "VAR_26[VAR_...
[ "@add_handler('bindings')...\n", "\"\"\"docstring\"\"\"\n", "bindings = {}\n", "defaults = config.val.bindings.default\n", "modes = set(defaults.keys()).union(config.val.bindings.commands)\n", "modes.remove('normal')\n", "modes = ['normal'] + sorted(list(modes))\n", "for mode in modes:\n", "bindings...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2():...\n", "" ]
[ "def get_local_ip_address():...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_18(self):...\n", "\"\"\"docstring\"\"\"\n", "self.reactor.advance(100)\n", "VAR_34 = 'server2'\n", "VAR_36 = signedjson.key.generate_signing_key('ver1')\n", "VAR_37 = signedjson.key.get_verify_key(VAR_36)\n", "VAR_38 = 'ed25519:ver1'\n", "VAR_39 = 200 * 1000\n", "def FUNC_29():...\n", "r...
[ "def test_invalid_perspectives_responses(self):...\n", "\"\"\"docstring\"\"\"\n", "self.reactor.advance(100)\n", "SERVER_NAME = 'server2'\n", "testkey = signedjson.key.generate_signing_key('ver1')\n", "testverifykey = signedjson.key.get_verify_key(testkey)\n", "testverifykey_id = 'ed25519:ver1'\n", "V...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_7(self, VAR_14=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_14 is not None:\n", "return VAR_14\n", "if self.app is not None:\n", "return self.app\n", "VAR_18 = _app_ctx_stack.top\n", "if VAR_18 is not None:\n", "return VAR_18.app\n" ]
[ "def get_app(self, reference_app=None):...\n", "\"\"\"docstring\"\"\"\n", "if reference_app is not None:\n", "return reference_app\n", "if self.app is not None:\n", "return self.app\n", "ctx = _app_ctx_stack.top\n", "if ctx is not None:\n", "return ctx.app\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Assign'", "Condition", "Return'" ]
[ "import glob\n", "import os\n", "import sys\n", "from collections import defaultdict\n", "from functools import partial as curry\n", "from . import biblio, boilerplate, caniuse, conditional, config, constants, datablocks, dfns, extensions, fingerprinting, h, headings, highlight, idl, includes, inlineTags,...
[ "import glob\n", "import os\n", "import sys\n", "from collections import defaultdict\n", "from functools import partial as curry\n", "from . import biblio, boilerplate, caniuse, conditional, config, constants, datablocks, dfns, extensions, fingerprinting, h, headings, highlight, idl, includes, inlineTags,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "...
[ "async def FUNC_39(self, VAR_28, VAR_45, VAR_1, VAR_32):...\n", "VAR_144 = VAR_188.ThirdPartyInvite, VAR_1.content['third_party_invite'][\n 'signed']['token']\n", "VAR_145 = None\n", "VAR_94 = await VAR_32.get_prev_state_ids()\n", "VAR_146 = VAR_94.get(VAR_144)\n", "if VAR_146:\n", "VAR_145 = await s...
[ "async def add_display_name_to_third_party_invite(self, room_version,...\n", "key = EventTypes.ThirdPartyInvite, event.content['third_party_invite']['signed'\n ]['token']\n", "original_invite = None\n", "prev_state_ids = await context.get_prev_state_ids()\n", "original_invite_id = prev_state_ids.get(key)...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_6(VAR_4, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6.start(VAR_11=['--temp-basedir', '--loglines=0'] + _base_args(request.\n config))\n", "VAR_6.open_path('qute://log')\n", "assert VAR_6.get_content() == 'Log output was disabled.'\n" ]
[ "def test_no_loglines(request, quteproc_new):...\n", "\"\"\"docstring\"\"\"\n", "quteproc_new.start(args=['--temp-basedir', '--loglines=0'] + _base_args(\n request.config))\n", "quteproc_new.open_path('qute://log')\n", "assert quteproc_new.get_content() == 'Log output was disabled.'\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Assert'" ]
[ "def FUNC_13():...\n", "yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n", "if VAR_1:\n", "yield '<?xml-stylesheet type=\"text/xsl\" href=\"/scopelist.xsl\" ?>\\n'\n", "yield '<objectlist count=\"{:d}\">\\n'.format(VAR_39)\n", "VAR_40 = 0\n", "VAR_41 = 0\n", "if VAR_26:\n", "VAR_40 = int(VAR...
[ "def generate():...\n", "yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n", "if STYLE:\n", "yield '<?xml-stylesheet type=\"text/xsl\" href=\"/scopelist.xsl\" ?>\\n'\n", "yield '<objectlist count=\"{:d}\">\\n'.format(total_entries)\n", "mix_per_iteration = 0\n", "iteration_count = 0\n", "if mak...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_121(*VAR_79, **VAR_42):...\n", "if VAR_13.read_from_replica:\n", "FUNC_6()\n", "VAR_225 = VAR_129(*VAR_79, **get_newargs(fn, kwargs))\n", "if VAR_1 and hasattr(VAR_1, 'primary_db'):\n", "return VAR_225\n", "VAR_1.db.close()\n", "VAR_1.db = VAR_1.primary_db\n" ]
[ "def wrapper_fn(*args, **kwargs):...\n", "if conf.read_from_replica:\n", "connect_replica()\n", "retval = fn(*args, **get_newargs(fn, kwargs))\n", "if local and hasattr(local, 'primary_db'):\n", "return retval\n", "local.db.close()\n", "local.db = local.primary_db\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Condition", "Return'", "Expr'", "Assign'" ]
[ "def FUNC_68():...\n", "VAR_54 = []\n", "if VAR_136['grabData'] and VAR_136['ctx'] == 'imgs':\n", "VAR_284 = min(VAR_136['start'], len(VAR_283) - 1)\n", "return [VAR_30.simpleMarshal(VAR_121=xtra, parents=opts['parents']) for\n VAR_30 in VAR_283]\n", "if VAR_136['limit'] == 0:\n", "VAR_317 = len(VAR_...
[ "def marshal():...\n", "rv = []\n", "if opts['grabData'] and opts['ctx'] == 'imgs':\n", "bottom = min(opts['start'], len(sr) - 1)\n", "return [x.simpleMarshal(xtra=xtra, parents=opts['parents']) for x in sr]\n", "if opts['limit'] == 0:\n", "top = len(sr)\n", "top = min(len(sr), bottom + opts['limit'])...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "For", "Assign'", "Return'", "Expr'", "Expr'", "Expr'" ]
[ "@defer.inlineCallbacks...\n", "VAR_14 = self.mock_handler.set_displayname\n", "VAR_14.side_effect = AuthError(400, 'message')\n", "VAR_12, VAR_13 = yield self.mock_resource.trigger('PUT', \n '/profile/%s/displayname' % '@4567:test', b'{\"displayname\": \"Frank Jr.\"}')\n", "self.assertTrue(400 <= VAR_12...
[ "@defer.inlineCallbacks...\n", "mocked_set = self.mock_handler.set_displayname\n", "mocked_set.side_effect = AuthError(400, 'message')\n", "code, response = yield self.mock_resource.trigger('PUT', \n '/profile/%s/displayname' % '@4567:test', b'{\"displayname\": \"Frank Jr.\"}')\n", "self.assertTrue(400 <...
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@VAR_8.route('/login', methods=['GET', 'POST'])...\n", "if request.method == 'GET':\n", "VAR_78 = FUNC_7()\n", "if request.method == 'POST':\n", "return render_template('frontend/index.html', VAR_78=config)\n", "VAR_25 = request.form.get('username')\n", "VAR_91 = request.form.get('password')\n", "if ...
[ "@app.route('/login', methods=['GET', 'POST'])...\n", "if request.method == 'GET':\n", "config = get_config()\n", "if request.method == 'POST':\n", "return render_template('frontend/index.html', config=config)\n", "username = request.form.get('username')\n", "password = request.form.get('password')\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Expr'", "Return'", "Return'" ]
[ "def FUNC_39(self):...\n", "VAR_53 = {'membership': 'join', 'displayname': 'other test user'}\n", "VAR_54 = json.dumps(VAR_53)\n", "VAR_22, VAR_23 = self.make_request('PUT', \n '/_matrix/client/r0/rooms/%s/state/m.room.member/%s' % (self.room_id,\n self.user_id), VAR_54, VAR_16=self.tok)\n", "self.ass...
[ "def test_per_room_profile_forbidden(self):...\n", "data = {'membership': 'join', 'displayname': 'other test user'}\n", "request_data = json.dumps(data)\n", "request, channel = self.make_request('PUT', \n '/_matrix/client/r0/rooms/%s/state/m.room.member/%s' % (self.room_id,\n self.user_id), request_data...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "async def FUNC_35(self, VAR_1: EventBase, VAR_32: EventContext, VAR_3:...\n", "\"\"\"docstring\"\"\"\n", "if VAR_1.is_state():\n", "VAR_179 = VAR_1.type, VAR_1.state_key\n", "VAR_179 = None\n", "VAR_125 = {k: a.event_id for k, a in VAR_3.items() if k != VAR_179}\n", "VAR_126 = await VAR_32.get_current_...
[ "async def _update_context_for_auth_events(self, event: EventBase, context:...\n", "\"\"\"docstring\"\"\"\n", "if event.is_state():\n", "event_key = event.type, event.state_key\n", "event_key = None\n", "state_updates = {k: a.event_id for k, a in auth_events.items() if k !=\n event_key}\n", "current_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_17(self, VAR_44):...\n", "VAR_13 = FUNC_1(VAR_44.group(1))\n", "if VAR_13 in self.def_footnotes:\n", "return\n", "self.def_footnotes[VAR_13] = 0\n", "self.tokens.append({'type': 'footnote_start', 'key': VAR_13})\n", "VAR_14 = VAR_44.group(2)\n", "if '\\n' in VAR_14:\n", "VAR_97 = VAR_14.sp...
[ "def parse_def_footnotes(self, m):...\n", "key = _keyify(m.group(1))\n", "if key in self.def_footnotes:\n", "return\n", "self.def_footnotes[key] = 0\n", "self.tokens.append({'type': 'footnote_start', 'key': key})\n", "text = m.group(2)\n", "if '\\n' in text:\n", "lines = text.split('\\n')\n", "sel...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "For", "Assign'", "Assign'", "Condition", "For", "Assign'", "Expr'", "Assign'" ]
[ "@defer.inlineCallbacks...\n", "self.mock_federation = Mock()\n", "self.mock_registry = Mock()\n", "self.query_handlers = {}\n", "def FUNC_10(VAR_0, VAR_1):...\n", "self.query_handlers[VAR_0] = VAR_1\n", "self.mock_registry.register_query_handler = FUNC_10\n", "VAR_2 = yield setup_test_homeserver(self...
[ "@defer.inlineCallbacks...\n", "self.mock_federation = Mock()\n", "self.mock_registry = Mock()\n", "self.query_handlers = {}\n", "def register_query_handler(query_type, handler):...\n", "self.query_handlers[query_type] = handler\n", "self.mock_registry.register_query_handler = register_query_handler\n",...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'" ]
[ "@VAR_0.route('/<path:path>', methods=['HEAD'])...\n", "" ]
[ "@app.route('/<path:path>', methods=['HEAD'])...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "if VAR_33:\n", "VAR_2 = FUNC_1('/groups/%s/summary/categories/%s/rooms/%s', VAR_30, VAR_33,\n VAR_6)\n", "VAR_2 = FUNC_1('/groups/%s/summary/rooms/%s', VAR_30, VAR_6)\n", "return self.client.delete_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'reque...
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "if category_id:\n", "path = _create_v1_path('/groups/%s/summary/categories/%s/rooms/%s',\n group_id, category_id, room_id)\n", "path = _create_v1_path('/groups/%s/summary/rooms/%s', group_id, room_id)\n", "return self.client.delete_json(destination=dest...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_3(self, VAR_0, VAR_1):...\n", "VAR_1.AWS_LOCATION = ''\n", "VAR_7 = SimpleUploadedFile('uploaded_file.txt', b'uploaded')\n", "VAR_8 = VAR_0.post('/', data={'file': uploaded_file})\n", "S3FileMiddleware(lambda x: None)(VAR_8)\n", "assert VAR_8.FILES.getlist('file')\n", "assert VAR_8.FILES.get('...
[ "def test_process_request__no_location(self, rf, settings):...\n", "settings.AWS_LOCATION = ''\n", "uploaded_file = SimpleUploadedFile('uploaded_file.txt', b'uploaded')\n", "request = rf.post('/', data={'file': uploaded_file})\n", "S3FileMiddleware(lambda x: None)(request)\n", "assert request.FILES.getlis...
[ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assert'", "Assert'", "Expr'", "Assign'", "Expr'", "Assert'", "Assert'" ]
[ "def FUNC_2(VAR_3):...\n", "VAR_13 = VAR_25.local.request.method\n", "if VAR_13 not in VAR_25.allowed_http_methods_for_whitelisted_func[VAR_3]:\n", "VAR_25.throw(_('Not permitted'), VAR_25.PermissionError)\n" ]
[ "def is_valid_http_method(method):...\n", "http_method = frappe.local.request.method\n", "if http_method not in frappe.allowed_http_methods_for_whitelisted_func[method]:\n", "frappe.throw(_('Not permitted'), frappe.PermissionError)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'" ]
[ "@VAR_2.route('/read/<int:book_id>/<book_format>')...\n", "VAR_95 = calibre_db.get_filtered_book(VAR_5)\n", "if not VAR_95:\n", "flash(_(\n u'Oops! Selected book title is unavailable. File does not exist or is not accessible'\n ), category='error')\n", "VAR_99 = None\n", "VAR_3.debug(\n u'Oops! S...
[ "@web.route('/read/<int:book_id>/<book_format>')...\n", "book = calibre_db.get_filtered_book(book_id)\n", "if not book:\n", "flash(_(\n u'Oops! Selected book title is unavailable. File does not exist or is not accessible'\n ), category='error')\n", "bookmark = None\n", "log.debug(\n u'Oops! Selec...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "For", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Condition", "Return'", "Assign'", "Condition", "Expr'", "Condition", "Return'", "Expr'", "Condition", "Return'", "Expr'", "Condition", "Return'", "Expr'", "For", "Return'", "Condition", "For", "Assign'", "...
[ "def FUNC_47(self):...\n", "self.model.updateLibrary()\n", "return 'success'\n" ]
[ "def api_updatedb(self):...\n", "self.model.updateLibrary()\n", "return 'success'\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_73(VAR_38, VAR_40):...\n", "\"\"\"docstring\"\"\"\n", "VAR_41 = CertificateWhitelist.objects.get(VAR_19=student, VAR_10=course_key)\n", "VAR_44 = GeneratedCertificate.objects.get(VAR_19=student, VAR_10=course_key)\n", "VAR_41.delete()\n", "VAR_44.invalidate()\n", "VAR_0.info(\n u'Certificat...
[ "def remove_certificate_exception(course_key, student):...\n", "\"\"\"docstring\"\"\"\n", "certificate_exception = CertificateWhitelist.objects.get(user=student,\n course_id=course_key)\n", "generated_certificate = GeneratedCertificate.objects.get(user=student,\n course_id=course_key)\n", "certificate...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_1(VAR_2, VAR_3):...\n", "VAR_5 = VAR_2.get_view(VAR_3)\n", "if hasattr(VAR_5, 'as_view'):\n", "VAR_5 = VAR_5.as_view()\n", "if VAR_5 and not callable(VAR_5):\n", "return VAR_5\n" ]
[ "def _get_view_by_name(theme, view_name):...\n", "view = theme.get_view(view_name)\n", "if hasattr(view, 'as_view'):\n", "view = view.as_view()\n", "if view and not callable(view):\n", "return view\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Return'" ]
[ "@FUNC_0...\n", "from synapse.handlers.oidc_handler import OidcHandler\n", "return OidcHandler(self)\n" ]
[ "@cache_in_self...\n", "from synapse.handlers.oidc_handler import OidcHandler\n", "return OidcHandler(self)\n" ]
[ 0, 0, 0 ]
[ "Condition", "ImportFrom'", "Return'" ]
[ "def FUNC_54(self, VAR_112=VAR_3, VAR_134=VAR_3, VAR_135=VAR_3, VAR_136=VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_254 = self.table_user()\n", "if 'username' not in VAR_254.fields:\n", "VAR_56 = VAR_263.request\n", "VAR_244 = VAR_263.response\n", "VAR_139 = VAR_263.session\n", "VAR_232 = (self.set...
[ "def retrieve_username(self, next=DEFAULT, onvalidation=DEFAULT, onaccept=...\n", "\"\"\"docstring\"\"\"\n", "table_user = self.table_user()\n", "if 'username' not in table_user.fields:\n", "request = current.request\n", "response = current.response\n", "session = current.session\n", "captcha = (self....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition"...
[ "@app.route('/images/<filename>')...\n", "if VAR_2 and data.valid_image_filename(VAR_2):\n", "VAR_34 = data.image_exists(VAR_2)\n", "return 'Invalid file request', 413\n", "if VAR_34:\n", "return send_file(VAR_34)\n", "return 'Image not found', 404\n" ]
[ "@app.route('/images/<filename>')...\n", "if filename and data.valid_image_filename(filename):\n", "image_path = data.image_exists(filename)\n", "return 'Invalid file request', 413\n", "if image_path:\n", "return send_file(image_path)\n", "return 'Image not found', 404\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(VAR_18: Text=DEFAULT_MODELS_PATH) ->TempDirectoryPath:...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = FUNC_0(VAR_18)\n", "VAR_65 = os.path.relpath(VAR_18)\n", "VAR_65 = VAR_18\n", "VAR_0.info(f'Loading model {VAR_65}...')\n", "return FUNC_3(VAR_18)\n" ]
[ "def get_model(model_path: Text=DEFAULT_MODELS_PATH) ->TempDirectoryPath:...\n", "\"\"\"docstring\"\"\"\n", "model_path = get_local_model(model_path)\n", "model_relative_path = os.path.relpath(model_path)\n", "model_relative_path = model_path\n", "logger.info(f'Loading model {model_relative_path}...')\n",...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_15(self, VAR_2):...\n", "VAR_2.config.from_mapping({'MY_KEY': 'some.endpoint'})\n", "assert url_for('MY_KEY')\n", "VAR_2.add_url_rule('/some-endpoint', endpoint='some.endpoint')\n", "assert url_for('MY_KEY') == '/some-endpoint'\n" ]
[ "def test_it_works_with_config_keys_returning_endpoints(self, app):...\n", "app.config.from_mapping({'MY_KEY': 'some.endpoint'})\n", "assert url_for('MY_KEY')\n", "app.add_url_rule('/some-endpoint', endpoint='some.endpoint')\n", "assert url_for('MY_KEY') == '/some-endpoint'\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assert'", "Expr'", "Assert'" ]
[ "@app.context_processor...\n", "VAR_3 = data.get_items(load_content=False)\n", "VAR_4 = require('archivy')[0].version\n", "VAR_5 = sep\n", "if VAR_5 == '\\\\':\n", "VAR_5 += '\\\\'\n", "return dict(VAR_3=dataobjs, VAR_5=SEP, VAR_4=version)\n" ]
[ "@app.context_processor...\n", "dataobjs = data.get_items(load_content=False)\n", "version = require('archivy')[0].version\n", "SEP = sep\n", "if SEP == '\\\\':\n", "SEP += '\\\\'\n", "return dict(dataobjs=dataobjs, SEP=SEP, version=version)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Condition", "AugAssign'", "Return'" ]
[ "\"\"\"``chameleon.tales`` expressions.\"\"\"\n", "from ast import NodeTransformer\n", "from ast import parse\n", "from chameleon.astutil import Static\n", "from chameleon.astutil import Symbol\n", "from chameleon.codegen import template\n", "from chameleon.tales import NotExpr\n", "from chameleon.tal...
[ "\"\"\"``chameleon.tales`` expressions.\"\"\"\n", "from ast import NodeTransformer\n", "from ast import parse\n", "from chameleon.astutil import Static\n", "from chameleon.astutil import Symbol\n", "from chameleon.codegen import template\n", "from chameleon.tales import NotExpr\n", "from chameleon.tal...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", ...
[ "def FUNC_2(VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_5 not in VAR_4.signature_def:\n", "return VAR_4.signature_def[VAR_5].inputs\n" ]
[ "def _get_inputs_tensor_info_from_meta_graph_def(meta_graph_def,...\n", "\"\"\"docstring\"\"\"\n", "if signature_def_key not in meta_graph_def.signature_def:\n", "return meta_graph_def.signature_def[signature_def_key].inputs\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'" ]
[ "def FUNC_50(self):...\n", "\"\"\"docstring\"\"\"\n", "self.load_doc_before_save()\n", "self.reset_seen()\n", "if self._action in ('save', 'submit'):\n", "self.run_method('before_validate')\n", "if self.flags.ignore_validate:\n", "return\n", "if self._action == 'save':\n", "self.run_method('valida...
[ "def run_before_save_methods(self):...\n", "\"\"\"docstring\"\"\"\n", "self.load_doc_before_save()\n", "self.reset_seen()\n", "if self._action in ('save', 'submit'):\n", "self.run_method('before_validate')\n", "if self.flags.ignore_validate:\n", "return\n", "if self._action == 'save':\n", "self.ru...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Return'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_18(self):...\n", "VAR_5 = {'rooms': ['!secretbase:unknown']}\n", "VAR_6 = FUNC_0(sender='@foo:bar', type='m.room.message', room_id=\n '!anothersecretbase:unknown')\n", "self.assertFalse(Filter(VAR_5).check(VAR_6))\n" ]
[ "def test_definition_rooms_works_with_unknowns(self):...\n", "definition = {'rooms': ['!secretbase:unknown']}\n", "event = MockEvent(sender='@foo:bar', type='m.room.message', room_id=\n '!anothersecretbase:unknown')\n", "self.assertFalse(Filter(definition).check(event))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_31(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(),\n 'testRunCommandOutOverwrite_inputs.npz')\n", "np.savez(VAR_31, VAR_2...
[ "def testRunCommandOutputFileExistError(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(),\n 'testRunCommandOutOverwrit...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@VAR_0.before_request...\n", "g.conn = Connections(VAR_0.config)\n" ]
[ "@app.before_request...\n", "g.conn = Connections(app.config)\n" ]
[ 0, 0 ]
[ "For", "Assign'" ]
[ "def FUNC_3(self, VAR_13: IProtocolFactory) ->defer.Deferred:...\n", "\"\"\"docstring\"\"\"\n", "return run_in_background(self._do_connect, VAR_13)\n" ]
[ "def connect(self, protocol_factory: IProtocolFactory) ->defer.Deferred:...\n", "\"\"\"docstring\"\"\"\n", "return run_in_background(self._do_connect, protocol_factory)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_8(self):...\n", "super().setUp()\n", "self.server_factory = ReplicationStreamProtocolFactory(self.hs)\n", "self.streamer = self.hs.get_replication_streamer()\n", "self._redis_server = CLASS_6()\n", "VAR_43 = self.hs.get_datastore()\n", "self.database_pool = VAR_43.db_pool\n", "self.reactor.l...
[ "def setUp(self):...\n", "super().setUp()\n", "self.server_factory = ReplicationStreamProtocolFactory(self.hs)\n", "self.streamer = self.hs.get_replication_streamer()\n", "self._redis_server = FakeRedisPubSubServer()\n", "store = self.hs.get_datastore()\n", "self.database_pool = store.db_pool\n", "sel...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_1):...\n", "from openapi_python_client.parser.properties import Property\n", "VAR_5 = VAR_1.MagicMock()\n", "VAR_1.patch('openapi_python_client.utils.snake_case')\n", "VAR_4 = Property(VAR_5=name, VAR_26=True, default=None)\n", "assert VAR_4.get_imports(VAR_9='') == set()\n", "VAR_...
[ "def test_get_imports(self, mocker):...\n", "from openapi_python_client.parser.properties import Property\n", "name = mocker.MagicMock()\n", "mocker.patch('openapi_python_client.utils.snake_case')\n", "p = Property(name=name, required=True, default=None)\n", "assert p.get_imports(prefix='') == set()\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Expr'", "Assign'", "Assert'", "Assign'", "Assert'" ]
[ "\"\"\" A FastAPI app used to create an OpenAPI document for end-to-end testing \"\"\"\n", "import json\n", "from datetime import date, datetime\n", "from enum import Enum\n", "from pathlib import Path\n", "from typing import Any, Dict, List, Union\n", "from fastapi import APIRouter, FastAPI, File, Head...
[ "\"\"\" A FastAPI app used to create an OpenAPI document for end-to-end testing \"\"\"\n", "import json\n", "from datetime import date, datetime\n", "from enum import Enum\n", "from pathlib import Path\n", "from typing import Any, Dict, List, Union\n", "from fastapi import APIRouter, FastAPI, File, Head...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Condition", "Docstring", "Return'" ]
[ "def FUNC_14(VAR_35: Fingerprint, VAR_36: Optional[Text], VAR_37: Text,...\n", "\"\"\"docstring\"\"\"\n", "VAR_61 = CLASS_1()\n", "if VAR_36 is None or not os.path.exists(VAR_36):\n", "return VAR_61\n", "VAR_40 = FUNC_10(unpacked)\n", "VAR_0.error(\n f\"\"\"Failed to get the fingerprint. Error: {e}.\...
[ "def should_retrain(new_fingerprint: Fingerprint, old_model: Optional[Text],...\n", "\"\"\"docstring\"\"\"\n", "fingerprint_comparison = FingerprintComparisonResult()\n", "if old_model is None or not os.path.exists(old_model):\n", "return fingerprint_comparison\n", "last_fingerprint = fingerprint_from_pat...
[ 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'", "Condition", "Return'", "Assign'", "Expr'", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_18(VAR_14, VAR_31):...\n", "return FUNC_19(FUNC_23(VAR_14, VAR_31))\n" ]
[ "def _compute_date_for_i18n(locale, domain):...\n", "return _compute_date(_get_all_translationfiles(locale, domain))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = VAR_1.requestUrl()\n", "if VAR_2.scheme() in ['chrome-error', 'chrome-extension']:\n", "VAR_1.fail(QWebEngineUrlRequestJob.UrlInvalid)\n", "assert VAR_1.requestMethod() == b'GET'\n", "return\n", "assert VAR_2.scheme() == 'qute'\n", ...
[ "def requestStarted(self, job):...\n", "\"\"\"docstring\"\"\"\n", "url = job.requestUrl()\n", "if url.scheme() in ['chrome-error', 'chrome-extension']:\n", "job.fail(QWebEngineUrlRequestJob.UrlInvalid)\n", "assert job.requestMethod() == b'GET'\n", "return\n", "assert url.scheme() == 'qute'\n", "log....
[ 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Assert'", "Return'", "Assert'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_28(self, VAR_27):...\n", "return [entry.to_dict() for entry in self.playlistdb.loadPlaylist(VAR_27=\n playlistid, VAR_15=self.getUserId())]\n" ]
[ "def api_loadplaylist(self, playlistid):...\n", "return [entry.to_dict() for entry in self.playlistdb.loadPlaylist(\n playlistid=playlistid, userid=self.getUserId())]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_54(VAR_21, VAR_31, VAR_32):...\n", "for serie in VAR_31:\n", "VAR_21 = VAR_21.filter(db.Books.series.any(db.Series.id == serie))\n", "for serie in VAR_32:\n", "VAR_21 = VAR_21.filter(not_(db.Books.series.any(db.Series.id == serie)))\n", "return VAR_21\n" ]
[ "def adv_search_serie(q, include_series_inputs, exclude_series_inputs):...\n", "for serie in include_series_inputs:\n", "q = q.filter(db.Books.series.any(db.Series.id == serie))\n", "for serie in exclude_series_inputs:\n", "q = q.filter(not_(db.Books.series.any(db.Series.id == serie)))\n", "return q\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Assign'", "For", "Assign'", "Return'" ]
[ "def FUNC_17(VAR_0, VAR_1: FlaskClient):...\n", "VAR_8 = VAR_1.post('/folders/create', data={'parent_dir': ''},\n follow_redirects=True)\n", "assert VAR_8.status_code == 200\n", "assert request.path == '/'\n", "assert b'Could not create folder.' in VAR_8.data\n" ]
[ "def test_creating_without_dirname_fails(test_app, client: FlaskClient):...\n", "resp = client.post('/folders/create', data={'parent_dir': ''},\n follow_redirects=True)\n", "assert resp.status_code == 200\n", "assert request.path == '/'\n", "assert b'Could not create folder.' in resp.data\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'", "Assert'", "Assert'" ]
[ "def FUNC_22(self):...\n", "\"\"\"docstring\"\"\"\n", "self._producer.resumeProducing()\n", "VAR_0.exception('Failed to call resumeProducing')\n", "self._consumer.unregisterProducer()\n", "self.stopProducing()\n" ]
[ "def _run_once(self):...\n", "\"\"\"docstring\"\"\"\n", "self._producer.resumeProducing()\n", "logger.exception('Failed to call resumeProducing')\n", "self._consumer.unregisterProducer()\n", "self.stopProducing()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __call__(self, VAR_17=None, VAR_18={}, VAR_19=None, **VAR_20):...\n", "return 'dummy'\n" ]
[ "def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):...\n", "return 'dummy'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_7: IPAddress, VAR_8: Optional[IPSet], VAR_9: IPSet) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "if VAR_7 in VAR_9:\n", "if VAR_8 is None or VAR_7 not in VAR_8:\n", "return False\n", "return True\n" ]
[ "def check_against_blacklist(ip_address: IPAddress, ip_whitelist: Optional[...\n", "\"\"\"docstring\"\"\"\n", "if ip_address in ip_blacklist:\n", "if ip_whitelist is None or ip_address not in ip_whitelist:\n", "return False\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_14(self):...\n", "self.assert_expected(self.folder.t, 'CheckNothing.html')\n" ]
[ "def testReplaceWithNothing(self):...\n", "self.assert_expected(self.folder.t, 'CheckNothing.html')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_36(self):...\n", "self.login()\n", "VAR_3 = self.client.post('/password_change/custom/named/', {'old_password':\n 'password', 'new_password1': 'password1', 'new_password2': 'password1'})\n", "self.assertEqual(VAR_3.status_code, 302)\n", "self.assertURLEqual(VAR_3.url, '/password_reset/')\n" ]
[ "def test_password_change_redirect_custom_named(self):...\n", "self.login()\n", "response = self.client.post('/password_change/custom/named/', {\n 'old_password': 'password', 'new_password1': 'password1',\n 'new_password2': 'password1'})\n", "self.assertEqual(response.status_code, 302)\n", "self.asser...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "@app.route('/dataobj/delete/<int:dataobj_id>', methods=['POST'])...\n", "" ]
[ "@app.route('/dataobj/delete/<int:dataobj_id>', methods=['POST'])...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_21(self):...\n", "from zope.tales.expressions import LazyWrapper\n", "VAR_5 = self._makeContext()\n", "VAR_8 = VAR_5.evaluate('lazy: b')\n", "self.assertIsInstance(VAR_8, LazyWrapper)\n" ]
[ "def test_lazy_expression_returns_wrapper(self):...\n", "from zope.tales.expressions import LazyWrapper\n", "ec = self._makeContext()\n", "lazy = ec.evaluate('lazy: b')\n", "self.assertIsInstance(lazy, LazyWrapper)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_3(VAR_0):...\n", "VAR_9 = Category.objects.visible().parents().ordered()\n", "VAR_10 = Topic.objects.visible().global_().with_bookmarks(VAR_4=request.user\n ).order_by('-is_globally_pinned', '-last_active').select_related('category'\n )\n", "VAR_10 = yt_paginate(VAR_10, per_page=config.topics_...
[ "def index_active(request):...\n", "categories = Category.objects.visible().parents().ordered()\n", "topics = Topic.objects.visible().global_().with_bookmarks(user=request.user\n ).order_by('-is_globally_pinned', '-last_active').select_related('category'\n )\n", "topics = yt_paginate(topics, per_page=co...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_50(VAR_19=None, VAR_20=False):...\n", "VAR_86 = {}\n", "if VAR_19:\n", "VAR_0.error(VAR_19)\n", "VAR_86['result'] = [{'type': 'success', 'message': _(\n u'Calibre-Web configuration updated')}]\n", "config.load()\n", "VAR_86['reboot'] = VAR_20\n", "VAR_86['result'] = [{'type': 'danger', 'm...
[ "def _configuration_result(error_flash=None, reboot=False):...\n", "resp = {}\n", "if error_flash:\n", "log.error(error_flash)\n", "resp['result'] = [{'type': 'success', 'message': _(\n u'Calibre-Web configuration updated')}]\n", "config.load()\n", "resp['reboot'] = reboot\n", "resp['result'] = [{'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_24=None, VAR_25=None, **VAR_7):...\n", "VAR_7['label'] = ''\n", "super().__init__(widget=PluralTextarea, **kwargs)\n" ]
[ "def __init__(self, max_length=None, min_length=None, **kwargs):...\n", "kwargs['label'] = ''\n", "super().__init__(widget=PluralTextarea, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@FUNC_0...\n", "return Filtering(self)\n" ]
[ "@cache_in_self...\n", "return Filtering(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_7(self):...\n", "while not self.get_success(self.store.db_pool.updates.\n", "self.get_success(self.store.db_pool.updates.do_next_background_update(100),\n by=0.1)\n", "VAR_13 = UserID('alice', 'test')\n", "VAR_14 = create_requester(VAR_13)\n", "self.get_success(self.room_creator.create_room(V...
[ "def test_can_rerun_update(self):...\n", "while not self.get_success(self.store.db_pool.updates.\n", "self.get_success(self.store.db_pool.updates.do_next_background_update(100),\n by=0.1)\n", "user = UserID('alice', 'test')\n", "requester = create_requester(user)\n", "self.get_success(self.room_creator...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_14(self, VAR_0, VAR_1, VAR_2):...\n", "self.presence_handler = VAR_2.get_presence_handler()\n", "self.clock = VAR_2.get_clock()\n" ]
[ "def prepare(self, reactor, clock, hs):...\n", "self.presence_handler = hs.get_presence_handler()\n", "self.clock = hs.get_clock()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_4(self, VAR_24, VAR_25=None):...\n", "self.encoding = VAR_25\n", "VAR_27 = False\n", "self.errors = []\n", "if VAR_25 and self.inject_meta_charset:\n", "from ..filters.inject_meta_charset import Filter\n", "if self.strip_whitespace:\n", "VAR_24 = Filter(VAR_24, VAR_25)\n", "from ..filters....
[ "def serialize(self, treewalker, encoding=None):...\n", "self.encoding = encoding\n", "in_cdata = False\n", "self.errors = []\n", "if encoding and self.inject_meta_charset:\n", "from ..filters.inject_meta_charset import Filter\n", "if self.strip_whitespace:\n", "treewalker = Filter(treewalker, encodin...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "ImportFrom'", "Condition", "Assign'", "ImportFrom'", "Condition", "Assign'", "ImportFrom'", "Condition", "Assign'", "ImportFrom'", "Condition", "Assign'", "ImportFrom'", "For", "Assign'", "Assign'", "Condition",...
[ "def FUNC_19(self, VAR_0):...\n", "from openapi_python_client import Project\n", "VAR_8 = Project(VAR_3=mocker.MagicMock(title='My Test API'))\n", "VAR_8.package_dir = VAR_0.MagicMock()\n", "VAR_8.package_dir.is_dir.return_value = False\n", "VAR_8._build_models = VAR_0.MagicMock()\n", "VAR_8.update()\n"...
[ "def test_update_missing_dir(self, mocker):...\n", "from openapi_python_client import Project\n", "project = Project(openapi=mocker.MagicMock(title='My Test API'))\n", "project.package_dir = mocker.MagicMock()\n", "project.package_dir.is_dir.return_value = False\n", "project._build_models = mocker.MagicMo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "@FUNC_0...\n", "if self.config.worker_app:\n", "return DeviceWorkerHandler(self)\n", "return DeviceHandler(self)\n" ]
[ "@cache_in_self...\n", "if self.config.worker_app:\n", "return DeviceWorkerHandler(self)\n", "return DeviceHandler(self)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_61(VAR_118, *VAR_119):...\n", "\"\"\"docstring\"\"\"\n", "if not 'public' in VAR_119:\n", "VAR_119 = [FUNC_56(part) for part in VAR_119]\n", "return os.path.join(os.path.dirname(FUNC_55(FUNC_56(VAR_118)).__file__), *\n VAR_119)\n" ]
[ "def get_pymodule_path(modulename, *joins):...\n", "\"\"\"docstring\"\"\"\n", "if not 'public' in joins:\n", "joins = [scrub(part) for part in joins]\n", "return os.path.join(os.path.dirname(get_module(scrub(modulename)).__file__),\n *joins)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Return'" ]
[ "def FUNC_63(self, VAR_34, VAR_33=None):...\n", "\"\"\"docstring\"\"\"\n", "if not (isinstance(self.get(VAR_34), list) and len(self.get(VAR_34)) > 0):\n", "VAR_93 = self.meta.get_label(VAR_34)\n", "frappe.throw(_('Table {0} cannot be empty').format(VAR_93), VAR_33 or\n frappe.EmptyTableError)\n" ]
[ "def validate_table_has_rows(self, parentfield, raise_exception=None):...\n", "\"\"\"docstring\"\"\"\n", "if not (isinstance(self.get(parentfield), list) and len(self.get(\n", "label = self.meta.get_label(parentfield)\n", "frappe.throw(_('Table {0} cannot be empty').format(label), raise_exception or\n fr...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Expr'" ]
[ "async def FUNC_6(VAR_6):...\n", "" ]
[ "async def middleware_handler(request):...\n", "" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Condition" ]
[ "def FUNC_9(self):...\n", "return 'dataverse-' + escapism.escape(self.identifier, escape_char='-').lower()\n" ]
[ "def get_build_slug(self):...\n", "return 'dataverse-' + escapism.escape(self.identifier, escape_char='-').lower()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_32(self):...\n", "if self.meta.istable:\n", "VAR_85 = frappe.get_meta(self.parenttype).permissions\n", "VAR_85 = self.meta.permissions\n", "return VAR_85\n" ]
[ "def get_permissions(self):...\n", "if self.meta.istable:\n", "permissions = frappe.get_meta(self.parenttype).permissions\n", "permissions = self.meta.permissions\n", "return permissions\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_18(self):...\n", "VAR_26 = np.array([[1], [2]])\n", "VAR_31 = os.path.join(test.get_temp_dir(), 'input.npz')\n", "np.savez(VAR_31, VAR_53=x0)\n", "VAR_27 = np.ones([2, 10])\n", "VAR_20 = 'x0=' + VAR_31 + '[a]'\n", "VAR_21 = 'x1=np.ones([2,10])'\n", "VAR_30 = saved_model_cli.load_inputs_from_...
[ "def testInputParserBoth(self):...\n", "x0 = np.array([[1], [2]])\n", "input_path = os.path.join(test.get_temp_dir(), 'input.npz')\n", "np.savez(input_path, a=x0)\n", "x1 = np.ones([2, 10])\n", "input_str = 'x0=' + input_path + '[a]'\n", "input_expr_str = 'x1=np.ones([2,10])'\n", "feed_dict = saved_mo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_28():...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = request.vars.app or ''\n", "VAR_56 = apath('%(app)s' % {'app': VAR_3}, VAR_122=request)\n", "VAR_65 = ['models', 'controllers', 'modules', 'private']\n", "def FUNC_38(VAR_3, VAR_13, VAR_14='.*\\\\.py$'):...\n", "VAR_45 = sorted(listdir(apath('%(...
[ "def todolist():...\n", "\"\"\"docstring\"\"\"\n", "app = request.vars.app or ''\n", "app_path = apath('%(app)s' % {'app': app}, r=request)\n", "dirs = ['models', 'controllers', 'modules', 'private']\n", "def listfiles(app, dir, regexp='.*\\\\.py$'):...\n", "files = sorted(listdir(apath('%(app)s/%(dir)s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_7(self):...\n", "self._test_thumbnail('crop', self.test_image.expected_cropped, self.\n test_image.expected_found)\n" ]
[ "def test_thumbnail_crop(self):...\n", "self._test_thumbnail('crop', self.test_image.expected_cropped, self.\n test_image.expected_found)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_52(self, VAR_112=VAR_3, VAR_134=VAR_3, VAR_135=VAR_3, VAR_136=VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_254 = self.table_user()\n", "VAR_56 = VAR_263.request\n", "VAR_244 = VAR_263.response\n", "VAR_139 = VAR_263.session\n", "if self.is_logged_in():\n", "redirect(self.settings.logged_ur...
[ "def register(self, next=DEFAULT, onvalidation=DEFAULT, onaccept=DEFAULT,...\n", "\"\"\"docstring\"\"\"\n", "table_user = self.table_user()\n", "request = current.request\n", "response = current.response\n", "session = current.session\n", "if self.is_logged_in():\n", "redirect(self.settings.logged_url...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", ...
[ "def FUNC_66(self, VAR_18: str, VAR_17: int=200):...\n", "VAR_68 = '/_matrix/client/r0/directory/room/' + VAR_18\n", "VAR_53 = {'room_id': self.room_id}\n", "VAR_54 = json.dumps(VAR_53)\n", "VAR_22, VAR_23 = self.make_request('PUT', VAR_68, VAR_54, VAR_16=self.\n room_owner_tok)\n", "self.assertEqual(V...
[ "def _set_alias_via_directory(self, alias: str, expected_code: int=200):...\n", "url = '/_matrix/client/r0/directory/room/' + alias\n", "data = {'room_id': self.room_id}\n", "request_data = json.dumps(data)\n", "request, channel = self.make_request('PUT', url, request_data, access_token\n =self.room_owne...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_46(VAR_62, VAR_106=None, VAR_107='creation desc'):...\n", "\"\"\"docstring\"\"\"\n", "VAR_174 = FUNC_83(VAR_62, VAR_106=filters, limit_page_length=1, VAR_107=\n order_by, pluck='name')\n", "if VAR_174:\n", "return FUNC_45(VAR_62, VAR_174[0])\n" ]
[ "def get_last_doc(doctype, filters=None, order_by='creation desc'):...\n", "\"\"\"docstring\"\"\"\n", "d = get_all(doctype, filters=filters, limit_page_length=1, order_by=\n order_by, pluck='name')\n", "if d:\n", "return get_doc(doctype, d[0])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'" ]
[ "def FUNC_21(self):...\n", "\"\"\"docstring\"\"\"\n", "self.stop()\n", "self._producer.stopProducing()\n" ]
[ "def stopProducing(self):...\n", "\"\"\"docstring\"\"\"\n", "self.stop()\n", "self._producer.stopProducing()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'" ]
[ "def __getattr__(self, VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "print(f\"No member '{VAR_4}' contained in InputSource.\")\n", "return ''\n" ]
[ "def __getattr__(self, name):...\n", "\"\"\"docstring\"\"\"\n", "print(f\"No member '{name}' contained in InputSource.\")\n", "return ''\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Return'" ]
[ "def FUNC_25(self, VAR_23):...\n", "VAR_53.session['playlist'] = VAR_23\n" ]
[ "def api_rememberplaylist(self, playlist):...\n", "cherrypy.session['playlist'] = playlist\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_50(VAR_21, VAR_24, VAR_25):...\n", "if VAR_24:\n", "VAR_24 = int(VAR_24) * 2\n", "if VAR_25:\n", "VAR_21 = VAR_21.filter(db.Books.ratings.any(db.Ratings.rating <= VAR_24))\n", "VAR_25 = int(VAR_25) * 2\n", "return VAR_21\n", "VAR_21 = VAR_21.filter(db.Books.ratings.any(db.Ratings.rating >= V...
[ "def adv_search_ratings(q, rating_high, rating_low):...\n", "if rating_high:\n", "rating_high = int(rating_high) * 2\n", "if rating_low:\n", "q = q.filter(db.Books.ratings.any(db.Ratings.rating <= rating_high))\n", "rating_low = int(rating_low) * 2\n", "return q\n", "q = q.filter(db.Books.ratings.any(...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Assign'" ]
[ "\"\"\"string\"\"\"\n", "from binascii import hexlify\n", "from datetime import datetime\n", "from os import urandom\n", "from flask import g, Blueprint, url_for, abort, request\n", "from flask_login import login_user, current_user, login_required\n", "from flask_babel import gettext as _\n", "from . ...
[ "\"\"\"This module is used to control authentication/authorization of Kobo sync requests.\nThis module also includes research notes into the auth protocol used by Kobo devices.\n\nLog-in:\nWhen first booting a Kobo device the user must sign into a Kobo (or affiliate) account.\nUpon successful sign-in, the user is r...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Condition", "Assign'", "FunctionDef'", "Assign'", "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_104():...\n", "from frappe.core.doctype.domain_settings.domain_settings import get_active_domains\n", "return FUNC_104()\n" ]
[ "def get_active_domains():...\n", "from frappe.core.doctype.domain_settings.domain_settings import get_active_domains\n", "return get_active_domains()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_154 = FUNC_42(VAR_2, VAR_5)\n", "VAR_114 = FUNC_43(VAR_2)\n", "VAR_115 = {'selected': VAR_114, 'images': VAR_154['image'], 'datasets':\n VAR_154['dataset'], 'projects': VAR_154['project'], 'screens': VAR_154[\n 'screen'], 'plates': VAR_154['pla...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "oids = getObjects(request, conn)\n", "selected = getIds(request)\n", "initial = {'selected': selected, 'images': oids['image'], 'datasets': oids[\n 'dataset'], 'projects': oids['project'], 'screens': oids['screen'],\n 'plates': oids['plate'], 'acqu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Condition", "For", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "For", "Assign'", "Assign'", ...
[ "def FUNC_35():...\n", "return FUNC_0(VAR_6=request.url_root, VAR_7=additional_unless)\n" ]
[ "def unless():...\n", "return _preemptive_unless(base_url=request.url_root, additional_unless=\n additional_unless)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@tenacity.retry(reraise=True, stop=tenacity.stop_after_attempt(3), wait=...\n", "VAR_6 = requests.get(self.sourceName, timeout=10)\n", "if VAR_6.status_code == 404:\n", "VAR_6.raise_for_status()\n", "return VAR_6\n" ]
[ "@tenacity.retry(reraise=True, stop=tenacity.stop_after_attempt(3), wait=...\n", "response = requests.get(self.sourceName, timeout=10)\n", "if response.status_code == 404:\n", "response.raise_for_status()\n", "return response\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_3(*, VAR_0: Optional[str], VAR_1: Optional[Path]) ->Union[Dict[str,...\n", "VAR_35: bytes\n", "if VAR_0 is not None and VAR_1 is not None:\n", "return GeneratorError(header='Provide URL or Path, not both.')\n", "if VAR_0 is not None:\n", "if VAR_1 is not None:\n", "VAR_34 = httpx.get(VAR_0)\n"...
[ "def _get_document(*, url: Optional[str], path: Optional[Path]) ->Union[Dict...\n", "yaml_bytes: bytes\n", "if url is not None and path is not None:\n", "return GeneratorError(header='Provide URL or Path, not both.')\n", "if url is not None:\n", "if path is not None:\n", "response = httpx.get(url)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "AnnAssign'", "Condition", "Return'", "Condition", "Condition", "Assign'", "Return'", "Return'", "Return'", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_12(self) ->Databases:...\n", "if not self.datastores:\n", "return self.datastores\n" ]
[ "def get_datastores(self) ->Databases:...\n", "if not self.datastores:\n", "return self.datastores\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_84(*VAR_79, **VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_12.get_value(*VAR_79, **kwargs)\n" ]
[ "def get_value(*args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "return db.get_value(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_2(self):...\n", "from Products.PageTemplates.Expressions import createZopeEngine\n", "return createZopeEngine()\n" ]
[ "def _makeEngine(self):...\n", "from Products.PageTemplates.Expressions import createZopeEngine\n", "return createZopeEngine()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Return'" ]
[ "def FUNC_30(self):...\n", "VAR_22 = models.Band.objects.create(name='Linkin Park')\n", "VAR_22.album_set.create(name='Hybrid Theory', cover_art=\n 'albums\\\\hybrid_theory.jpg')\n", "VAR_29 = models.Album._meta.get_field('band').rel\n", "VAR_27 = widgets.ForeignKeyRawIdWidget(VAR_29, widget_admin_site)\...
[ "def test_render(self):...\n", "band = models.Band.objects.create(name='Linkin Park')\n", "band.album_set.create(name='Hybrid Theory', cover_art=\n 'albums\\\\hybrid_theory.jpg')\n", "rel = models.Album._meta.get_field('band').rel\n", "w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)\n", "self...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "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_3(self, VAR_16: Text) ->None:...\n", "\"\"\"docstring\"\"\"\n", "VAR_26 = self.bucket.blob(VAR_16)\n", "VAR_26.download_to_filename(VAR_16)\n" ]
[ "def _retrieve_tar(self, target_filename: Text) ->None:...\n", "\"\"\"docstring\"\"\"\n", "blob = self.bucket.blob(target_filename)\n", "blob.download_to_filename(target_filename)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_10(self, *VAR_0, **VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "return self._save(*VAR_0, **kwargs)\n" ]
[ "def save(self, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "return self._save(*args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_9(self, VAR_20: Text) ->None:...\n", "from azure.core.exceptions import ResourceExistsError\n", "self.blob_service.create_container(VAR_20)\n" ]
[ "def _ensure_container_exists(self, container_name: Text) ->None:...\n", "from azure.core.exceptions import ResourceExistsError\n", "self.blob_service.create_container(container_name)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Expr'" ]
[ "def FUNC_12(VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = force_bytes(VAR_21)\n", "return base64.urlsafe_b64decode(VAR_21.ljust(len(VAR_21) + len(VAR_21) % 4,\n b'='))\n" ]
[ "def urlsafe_base64_decode(s):...\n", "\"\"\"docstring\"\"\"\n", "s = force_bytes(s)\n", "return base64.urlsafe_b64decode(s.ljust(len(s) + len(s) % 4, b'='))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_49(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_55 = self._send_labelled_messages_in_room()\n", "VAR_22, VAR_23 = self.make_request('GET', '/rooms/%s/context/%s?filter=%s' %\n (self.room_id, VAR_55, json.dumps(self.FILTER_NOT_LABELS)), VAR_16=self.tok\n )\n", "self.assertEqual(VAR_23.code, ...
[ "def test_context_filter_not_labels(self):...\n", "\"\"\"docstring\"\"\"\n", "event_id = self._send_labelled_messages_in_room()\n", "request, channel = self.make_request('GET', \n '/rooms/%s/context/%s?filter=%s' % (self.room_id, event_id, json.dumps(\n self.FILTER_NOT_LABELS)), access_token=self.tok)\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]