lines listlengths 1 383 | raw_lines listlengths 1 383 | label listlengths 1 383 | type listlengths 1 383 |
|---|---|---|---|
[
"def FUNC_40(self):...\n",
"return CLASS_2.objects.filter(VAR_60=self, status__in=(1, 2),\n assigned_to__isnull=True)\n"
] | [
"def unassigned_tickets(self):...\n",
"return Ticket.objects.filter(kbitem=self, status__in=(1, 2),\n assigned_to__isnull=True)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@wraps(VAR_3)...\n",
"if VAR_62.role_admin():\n",
"return VAR_3(*VAR_30, **kwargs)\n",
"abort(403)\n"
] | [
"@wraps(f)...\n",
"if current_user.role_admin():\n",
"return f(*args, **kwargs)\n",
"abort(403)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Expr'"
] |
[
"@app.route('/i18n/<string:locale>/<string:domain>.js')...\n",
"VAR_83 = {}\n",
"VAR_84 = None\n",
"if VAR_14 != 'en':\n",
"VAR_83, VAR_84 = FUNC_24(VAR_14, VAR_31)\n",
"VAR_85 = {'messages': VAR_83, 'plural_expr': VAR_84, 'locale': VAR_14,\n 'domain': VAR_31}\n",
"from flask import Response\n",
"r... | [
"@app.route('/i18n/<string:locale>/<string:domain>.js')...\n",
"messages = {}\n",
"plural_expr = None\n",
"if locale != 'en':\n",
"messages, plural_expr = _get_translations(locale, domain)\n",
"catalog = {'messages': messages, 'plural_expr': plural_expr, 'locale':\n locale, 'domain': domain}\n",
"fro... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"ImportFrom'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"VAR_21 = 'inputx=file[[v1]v2'\n",
"saved_model_cli.preprocess_inputs_arg_string(VAR_21)\n",
"VAR_21 = 'inputx:file'\n",
"saved_model_cli.preprocess_inputs_arg_string(VAR_21)\n",
"VAR_21 = 'inputx:np.zeros((5))'\n",
"saved_model_cli.preprocess_input_exprs_arg_string(VAR_21, sa... | [
"def testInputPreProcessErrorBadFormat(self):...\n",
"input_str = 'inputx=file[[v1]v2'\n",
"saved_model_cli.preprocess_inputs_arg_string(input_str)\n",
"input_str = 'inputx:file'\n",
"saved_model_cli.preprocess_inputs_arg_string(input_str)\n",
"input_str = 'inputx:np.zeros((5))'\n",
"saved_model_cli.pre... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_10(VAR_0, VAR_1):...\n",
"self.query_handlers[VAR_0] = VAR_1\n"
] | [
"def register_query_handler(query_type, handler):...\n",
"self.query_handlers[query_type] = handler\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_53(VAR_21, VAR_29, VAR_30):...\n",
"for tag in VAR_29:\n",
"VAR_21 = VAR_21.filter(db.Books.tags.any(db.Tags.id == tag))\n",
"for tag in VAR_30:\n",
"VAR_21 = VAR_21.filter(not_(db.Books.tags.any(db.Tags.id == tag)))\n",
"return VAR_21\n"
] | [
"def adv_search_tag(q, include_tag_inputs, exclude_tag_inputs):...\n",
"for tag in include_tag_inputs:\n",
"q = q.filter(db.Books.tags.any(db.Tags.id == tag))\n",
"for tag in exclude_tag_inputs:\n",
"q = q.filter(not_(db.Books.tags.any(db.Tags.id == tag)))\n",
"return q\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_4(VAR_18, **VAR_19):...\n",
"if '?' in VAR_18:\n",
"VAR_18, VAR_37 = VAR_18.split('?', 1)\n",
"VAR_19 = [(key, VAR_26) for key, VAR_26 in VAR_19.items() if VAR_26 is not None\n ]\n",
"VAR_19 = dict(parse_qsl(VAR_37), **qs)\n",
"if VAR_19:\n",
"return '%s?%s' % (VAR_18, urlencode(VAR_19))\n"... | [
"def manipulate_query_string(url, **qs):...\n",
"if '?' in url:\n",
"url, current_qs = url.split('?', 1)\n",
"qs = [(key, value) for key, value in qs.items() if value is not None]\n",
"qs = dict(parse_qsl(current_qs), **qs)\n",
"if qs:\n",
"return '%s?%s' % (url, urlencode(qs))\n",
"return url\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = VAR_2.session['connector'].server_id\n",
"VAR_62 = VAR_8.getRoiService().findByRoi(VAR_178(VAR_13), None, VAR_8.\n SERVICE_OPTS)\n",
"if VAR_62 is None or VAR_62.rois is None or len(VAR_62.rois) == 0:\n",
"for VAR_241 in VAR_62.rois:\n",
... | [
"@login_required()...\n",
"\"\"\"docstring\"\"\"\n",
"server_id = request.session['connector'].server_id\n",
"result = conn.getRoiService().findByRoi(long(roiId), None, conn.SERVICE_OPTS)\n",
"if result is None or result.rois is None or len(result.rois) == 0:\n",
"for roi in result.rois:\n",
"imageId = ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condit... |
[
"def FUNC_74(VAR_129, VAR_42):...\n",
"if hasattr(VAR_129, 'fnargs'):\n",
"VAR_210 = VAR_129.fnargs\n",
"VAR_210, VAR_220, VAR_221, VAR_222 = inspect.getargspec(VAR_129)\n",
"VAR_210 = inspect.getfullargspec(VAR_129).args\n",
"VAR_194 = {}\n",
"VAR_220 = inspect.getfullargspec(VAR_129).varargs\n",
"fo... | [
"def get_newargs(fn, kwargs):...\n",
"if hasattr(fn, 'fnargs'):\n",
"fnargs = fn.fnargs\n",
"fnargs, varargs, varkw, defaults = inspect.getargspec(fn)\n",
"fnargs = inspect.getfullargspec(fn).args\n",
"newargs = {}\n",
"varargs = inspect.getfullargspec(fn).varargs\n",
"for a in kwargs:\n",
"varkw = ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_9, *VAR_6, **VAR_7):...\n",
"super().__init__(*VAR_6, **kwargs)\n",
"self.component = VAR_9\n",
"VAR_118 = self.get_lang_objects()\n",
"self.fields['lang'].choices = VAR_118.as_choices()\n"
] | [
"def __init__(self, component, *args, **kwargs):...\n",
"super().__init__(*args, **kwargs)\n",
"self.component = component\n",
"languages = self.get_lang_objects()\n",
"self.fields['lang'].choices = languages.as_choices()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_21(self):...\n",
"if self.direction == 'next':\n",
"self.queryset = self.queryset.order_by(desc(QueryRun.timestamp))\n",
"self.queryset = self.queryset.order_by(QueryRun.timestamp)\n"
] | [
"def order_queryset(self):...\n",
"if self.direction == 'next':\n",
"self.queryset = self.queryset.order_by(desc(QueryRun.timestamp))\n",
"self.queryset = self.queryset.order_by(QueryRun.timestamp)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'"
] |
[
"@login_required(setGroupContext=True)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_202 = VAR_5.getScriptService()\n",
"VAR_50 = {}\n",
"VAR_49 = VAR_241(VAR_42)\n",
"VAR_73 = VAR_202.getParams(VAR_49)\n",
"if x.message and x.message.startswith('No processor available'):\n",
"VAR_73 = VAR_202.getParams(VAR_... | [
"@login_required(setGroupContext=True)...\n",
"\"\"\"docstring\"\"\"\n",
"scriptService = conn.getScriptService()\n",
"inputMap = {}\n",
"sId = long(scriptId)\n",
"params = scriptService.getParams(sId)\n",
"if x.message and x.message.startswith('No processor available'):\n",
"params = scriptService.ge... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"C... |
[
"async def FUNC_10(VAR_16, VAR_17):...\n",
"if VAR_17 not in [u.to_string() for u in self.room_members]:\n",
"return None\n"
] | [
"async def check_user_in_room(room_id, user_id):...\n",
"if user_id not in [u.to_string() for u in self.room_members]:\n",
"return None\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"For",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_42.append(VAR_53)\n"
] | [
"@staticmethod...\n",
"addresses.append(address)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"@VAR_25.whitelist(allow_guest=True)...\n",
"return VAR_25.__version__\n"
] | [
"@frappe.whitelist(allow_guest=True)...\n",
"return frappe.__version__\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_32(VAR_87):...\n",
"VAR_86.update(to_bytes(VAR_87, encoding='utf-8', errors='replace'))\n"
] | [
"def hash_update(value):...\n",
"hash.update(to_bytes(value, encoding='utf-8', errors='replace'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_7(self, VAR_5) ->bool:...\n",
"return os.access(self.relative(VAR_5).sourceName, os.R_OK)\n"
] | [
"def cheaplyExists(self, relativePath) ->bool:...\n",
"return os.access(self.relative(relativePath).sourceName, os.R_OK)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_3 = '@foo:bar'\n",
"VAR_7 = 5000000\n",
"VAR_10 = UserPresenceState.default(VAR_3)\n",
"VAR_10 = VAR_10.copy_and_replace(VAR_10=PresenceState.ONLINE,\n last_active_ts=now - IDLE_TIMER - 1, last_user_sync_ts=now)\n",
"VAR_9 = handle_timeout(VAR_10, is_mine=True, syncing_us... | [
"def test_idle_timer(self):...\n",
"user_id = '@foo:bar'\n",
"now = 5000000\n",
"state = UserPresenceState.default(user_id)\n",
"state = state.copy_and_replace(state=PresenceState.ONLINE, last_active_ts=\n now - IDLE_TIMER - 1, last_user_sync_ts=now)\n",
"new_state = handle_timeout(state, is_mine=True,... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_16(VAR_25, VAR_26):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_26:\n",
"return False\n",
"VAR_26 = VAR_26.lower()\n",
"return VAR_26[0] == '.' and (VAR_25.endswith(VAR_26) or VAR_25 == VAR_26[1:]\n ) or VAR_26 == VAR_25\n"
] | [
"def is_same_domain(host, pattern):...\n",
"\"\"\"docstring\"\"\"\n",
"if not pattern:\n",
"return False\n",
"pattern = pattern.lower()\n",
"return pattern[0] == '.' and (host.endswith(pattern) or host == pattern[1:]\n ) or pattern == host\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_43(self, VAR_53, VAR_54):...\n",
"return VAR_53 * VAR_54\n"
] | [
"def multiply(self, a, b):...\n",
"return a * b\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@action('userinfoedit', lazy_gettext('Edit User'), '', 'fa-edit', multiple=...\n",
"return redirect(url_for(self.appbuilder.sm.userinfoeditview.__name__ +\n '.this_form_get'))\n"
] | [
"@action('userinfoedit', lazy_gettext('Edit User'), '', 'fa-edit', multiple=...\n",
"return redirect(url_for(self.appbuilder.sm.userinfoeditview.__name__ +\n '.this_form_get'))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_3(VAR_8: list[str], VAR_4: int) ->list[str]:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = [VAR_8[VAR_4]]\n",
"while True:\n",
"VAR_4 += 1\n",
"VAR_33 = VAR_8[VAR_4]\n",
"return VAR_20\n",
"if not VAR_33.strip() or re.match('\\\\S', VAR_33[0]):\n",
"return VAR_20\n",
"VAR_20.append(VAR_33)... | [
"def find_entry_lines(lines: list[str], lineno: int) ->list[str]:...\n",
"\"\"\"docstring\"\"\"\n",
"entry_lines = [lines[lineno]]\n",
"while True:\n",
"lineno += 1\n",
"line = lines[lineno]\n",
"return entry_lines\n",
"if not line.strip() or re.match('\\\\S', line[0]):\n",
"return entry_lines\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"AugAssign'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Expr'"
] |
[
"from __future__ import division\n",
"import re\n",
"import math\n",
"import cmath\n",
"import types\n",
"import string\n",
"import supybot.utils as utils\n",
"from supybot.commands import *\n",
"import supybot.utils.minisix as minisix\n",
"import supybot.callbacks as callbacks\n",
"from supybot... | [
"from __future__ import division\n",
"import re\n",
"import math\n",
"import cmath\n",
"import types\n",
"import string\n",
"import supybot.utils as utils\n",
"from supybot.commands import *\n",
"import supybot.utils.minisix as minisix\n",
"import supybot.callbacks as callbacks\n",
"from supybot... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"ImportFrom'",
"Assign'",
"Expr'",
"Condition",
"Docstring",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"... |
[
"def FUNC_70(self):...\n",
"VAR_76 = getattr(self, '_liked_by', None)\n",
"if VAR_76:\n",
"return json.loads(VAR_76)\n",
"return []\n"
] | [
"def get_liked_by(self):...\n",
"liked_by = getattr(self, '_liked_by', None)\n",
"if liked_by:\n",
"return json.loads(liked_by)\n",
"return []\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@wraps(VAR_3)...\n",
"VAR_12 = FUNC_2()\n",
"if VAR_12 is not None:\n",
"VAR_16 = ub.session.query(ub.User).join(ub.RemoteAuthToken).filter(ub.\n RemoteAuthToken.auth_token == VAR_12).filter(ub.RemoteAuthToken.\n token_type == 1).first()\n",
"if VAR_16 is not None:\n",
"login_user(VAR_16)\n",
"VA... | [
"@wraps(f)...\n",
"auth_token = get_auth_token()\n",
"if auth_token is not None:\n",
"user = ub.session.query(ub.User).join(ub.RemoteAuthToken).filter(ub.\n RemoteAuthToken.auth_token == auth_token).filter(ub.RemoteAuthToken.\n token_type == 1).first()\n",
"if user is not None:\n",
"login_user(user)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_10(VAR_10):...\n",
"return VAR_10.url.lower().startswith('file:')\n"
] | [
"def is_file_url(link):...\n",
"return link.url.lower().startswith('file:')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_162(VAR_10):...\n",
"if VAR_187:\n",
"self.amfrpc3_procedures[VAR_187 + '.' + VAR_10.__name__] = VAR_10\n",
"self.amfrpc3_procedures[VAR_10.__name__] = VAR_10\n",
"return VAR_10\n"
] | [
"def _amfrpc3(f):...\n",
"if domain:\n",
"self.amfrpc3_procedures[domain + '.' + f.__name__] = f\n",
"self.amfrpc3_procedures[f.__name__] = f\n",
"return f\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_44):...\n",
"VAR_54 = VAR_5.sub('', VAR_44.group(0))\n",
"self.tokens.append({'type': 'code', 'lang': None, 'text': VAR_54})\n"
] | [
"def parse_block_code(self, m):...\n",
"code = _block_code_leading_pattern.sub('', m.group(0))\n",
"self.tokens.append({'type': 'code', 'lang': None, 'text': code})\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"VAR_5 = {'not_senders': ['@flibble:wibble']}\n",
"VAR_6 = FUNC_0(sender='@flibble:wibble', type='com.nom.nom.nom', room_id=\n '!foo:bar')\n",
"self.assertFalse(Filter(VAR_5).check(VAR_6))\n"
] | [
"def test_definition_not_senders_works_with_literals(self):...\n",
"definition = {'not_senders': ['@flibble:wibble']}\n",
"event = MockEvent(sender='@flibble:wibble', type='com.nom.nom.nom', room_id\n ='!foo:bar')\n",
"self.assertFalse(Filter(definition).check(event))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"async def FUNC_0(self, VAR_5, VAR_6, VAR_7=False) ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = VAR_6.room_id\n",
"VAR_12 = VAR_6.event_id\n",
"VAR_0.info('handling received PDU: %s', VAR_6)\n",
"VAR_51 = await self.store.get_event(VAR_12, allow_none=True, allow_rejected\n =True)\n",
"VAR_52 =... | [
"async def on_receive_pdu(self, origin, pdu, sent_to_us_directly=False) ->None:...\n",
"\"\"\"docstring\"\"\"\n",
"room_id = pdu.room_id\n",
"event_id = pdu.event_id\n",
"logger.info('handling received PDU: %s', pdu)\n",
"existing = await self.store.get_event(event_id, allow_none=True,\n allow_rejected... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'",
... |
[
"from collections import OrderedDict\n",
"import django.forms\n",
"from django.utils.translation import gettext_lazy as _\n",
"from wagtail.admin.forms import WagtailAdminPageForm\n",
"from wagtail.contrib.forms.utils import get_field_clean_name\n",
"def __init__(self, *VAR_0, **VAR_1):...\n",
"VAR_1.se... | [
"from collections import OrderedDict\n",
"import django.forms\n",
"from django.utils.translation import gettext_lazy as _\n",
"from wagtail.admin.forms import WagtailAdminPageForm\n",
"from wagtail.contrib.forms.utils import get_field_clean_name\n",
"def __init__(self, *args, **kwargs):...\n",
"kwargs.s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_20):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = self.evaluate(VAR_20)\n",
"return self._handleText(VAR_30, VAR_20)\n"
] | [
"def evaluateText(self, expr):...\n",
"\"\"\"docstring\"\"\"\n",
"text = self.evaluate(expr)\n",
"return self._handleText(text, expr)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_6):...\n",
"VAR_13 = UploadForm(data={'file': 'foo.bar', 's3file': 'file'}, instance=\n filemodel)\n",
"assert VAR_13.is_valid()\n",
"assert VAR_13.cleaned_data['file'] == VAR_6.file\n"
] | [
"def test_file_does_not_exist_no_fallback(self, filemodel):...\n",
"form = UploadForm(data={'file': 'foo.bar', 's3file': 'file'}, instance=\n filemodel)\n",
"assert form.is_valid()\n",
"assert form.cleaned_data['file'] == filemodel.file\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_18(self):...\n",
"assert 'custom/location/tmp/s3file/' in ClearableFileInput().upload_folder\n",
"assert len(os.path.basename(ClearableFileInput().upload_folder)) == 22\n"
] | [
"def test_upload_folder(self):...\n",
"assert 'custom/location/tmp/s3file/' in ClearableFileInput().upload_folder\n",
"assert len(os.path.basename(ClearableFileInput().upload_folder)) == 22\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Assert'"
] |
[
"def FUNC_6(self):...\n",
"if self._is_processing:\n",
"return\n",
"run_as_background_process('httppush.process', self._process)\n"
] | [
"def _start_processing(self):...\n",
"if self._is_processing:\n",
"return\n",
"run_as_background_process('httppush.process', self._process)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def __init__(self, VAR_26: 'HomeServer', VAR_27: Dict[str, Any]={}, VAR_8:...\n",
"\"\"\"docstring\"\"\"\n",
"self.hs = VAR_26\n",
"self._ip_whitelist = VAR_8\n",
"self._ip_blacklist = VAR_9\n",
"self._extra_treq_args = VAR_27\n",
"self.user_agent = VAR_26.version_string\n",
"self.clock = VAR_26.get_... | [
"def __init__(self, hs: 'HomeServer', treq_args: Dict[str, Any]={},...\n",
"\"\"\"docstring\"\"\"\n",
"self.hs = hs\n",
"self._ip_whitelist = ip_whitelist\n",
"self._ip_blacklist = ip_blacklist\n",
"self._extra_treq_args = treq_args\n",
"self.user_agent = hs.version_string\n",
"self.clock = hs.get_clo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
4,
0,
0,
0,
4,
0,
4,
4,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'",
"A... |
[
"def FUNC_4(self):...\n",
"self.assertFormfield(models.Event, 'description', widgets.AdminTextareaWidget)\n"
] | [
"def testTextField(self):...\n",
"self.assertFormfield(models.Event, 'description', widgets.AdminTextareaWidget)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_4(VAR_18, VAR_14=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_31 = FUNC_11('GIDIDX' + VAR_18.upper())\n",
"VAR_32 = []\n",
"if VAR_14:\n",
"VAR_14.replace('%2C', ',')\n",
"def FUNC_14():...\n",
"VAR_14.replace('%20', ' ')\n",
"VAR_43 = f.readline()\n",
"VAR_32 = VAR_14.split(',')\n",
... | [
"def get_mixer_list(idx, classes=None):...\n",
"\"\"\"docstring\"\"\"\n",
"mixer_index = _get_index_absolute_path('GIDIDX' + idx.upper())\n",
"classes_list = []\n",
"if classes:\n",
"classes.replace('%2C', ',')\n",
"def get_class_path():...\n",
"classes.replace('%20', ' ')\n",
"dataset_path = f.read... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_55, *VAR_6, **VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"super().__init__(*VAR_6, **kwargs)\n",
"self.obj = VAR_55\n",
"self.components = VAR_55.project.component_set.filter(VAR_72=obj.\n source_language) | Component.objects.filter(source_language_id=obj.\n source_language_id, ... | [
"def __init__(self, obj, *args, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"super().__init__(*args, **kwargs)\n",
"self.obj = obj\n",
"self.components = obj.project.component_set.filter(source_language=obj.\n source_language) | Component.objects.filter(source_language_id=obj.\n source_language_id, p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"from app import apfell, links, use_ssl\n",
"from sanic import response\n",
"from jinja2 import Environment, PackageLoader\n",
"from sanic_jwt.decorators import scoped, inject_user\n",
"from app.routes.routes import respect_pivot\n",
"import urllib.parse\n",
"VAR_0 = Environment(loader=PackageLoader('ap... | [
"from app import apfell, links, use_ssl\n",
"from sanic import response\n",
"from jinja2 import Environment, PackageLoader\n",
"from sanic_jwt.decorators import scoped, inject_user\n",
"from app.routes.routes import respect_pivot\n",
"import urllib.parse\n",
"env = Environment(loader=PackageLoader('app'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_65(self):...\n",
"VAR_3 = self.client.post('/admin/auth/user/%s/' % self.admin.pk, self.\n get_user_data(self.admin))\n",
"self.assertRedirects(VAR_3, '/admin/auth/user/')\n",
"VAR_28 = LogEntry.objects.latest('id')\n",
"self.assertEqual(VAR_28.change_message, 'No fields changed.')\n"
] | [
"def test_user_not_change(self):...\n",
"response = self.client.post('/admin/auth/user/%s/' % self.admin.pk, self.\n get_user_data(self.admin))\n",
"self.assertRedirects(response, '/admin/auth/user/')\n",
"row = LogEntry.objects.latest('id')\n",
"self.assertEqual(row.change_message, 'No fields changed.')... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"from dataclasses import asdict\n",
"from datetime import date, datetime\n",
"from typing import Any, Dict, List, Optional, Union, cast\n",
"import httpx\n",
"from ..client import AuthenticatedClient, Client\n",
"from ..errors import ApiResponseError\n",
"from ..models.a_model import AModel\n",
"from ... | [
"from dataclasses import asdict\n",
"from datetime import date, datetime\n",
"from typing import Any, Dict, List, Optional, Union, cast\n",
"import httpx\n",
"from ..client import AuthenticatedClient, Client\n",
"from ..errors import ApiResponseError\n",
"from ..models.a_model import AModel\n",
"from ... | [
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Docstring",
"Assign'",
"AnnAssign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Ann... |
[
"def FUNC_27(VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_58 = '\\n'.join(['Usage example:',\n 'To compile a SavedModel signature via (CPU) XLA AOT:',\n '$saved_model_cli aot_compile_cpu \\\\', ' --dir /tmp/saved_model \\\\',\n ' --tag_set serve \\\\', ' --output_dir /tmp/saved_model_xla_aot',... | [
"def add_aot_compile_cpu_subparser(subparsers):...\n",
"\"\"\"docstring\"\"\"\n",
"compile_msg = '\\n'.join(['Usage example:',\n 'To compile a SavedModel signature via (CPU) XLA AOT:',\n '$saved_model_cli aot_compile_cpu \\\\', ' --dir /tmp/saved_model \\\\',\n ' --tag_set serve \\\\', ' --output... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_31(self, VAR_18, VAR_19=None, VAR_22='read'):...\n",
"if not VAR_19:\n",
"VAR_19 = self.meta.get_field(VAR_18)\n",
"return VAR_19.permlevel in self.get_permlevel_access(VAR_22)\n"
] | [
"def has_permlevel_access_to(self, fieldname, df=None, permission_type='read'):...\n",
"if not df:\n",
"df = self.meta.get_field(fieldname)\n",
"return df.permlevel in self.get_permlevel_access(permission_type)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_1):...\n",
"VAR_19 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n",
"def FUNC_7(VAR_1):...\n",
"VAR_20.throw(_('Invalid Search Field {0}').format(VAR_1), VAR_20.DataError)\n",
"if len(VAR_1) == 1:\n",
"VAR_24 = re.compile('^.*[=;*,\\\\\\'\"$\\\\-+%#@()_].*')\n",
... | [
"def sanitize_searchfield(searchfield):...\n",
"blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n 'or', 'like']\n",
"def _raise_exception(searchfield):...\n",
"frappe.throw(_('Invalid Search Field {0}').format(searchfield), frappe.\n DataError)\n",
"if len(searchfield) == ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'",
"For",
"Expr'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_20(VAR_27, VAR_28=False):...\n",
"while True:\n",
"VAR_96 = queue.pop()\n",
"time.sleep(1)\n",
"if VAR_28:\n",
"if VAR_96 is not None:\n",
"VAR_101, VAR_70, VAR_21, VAR_102 = VAR_96\n",
"time.sleep(1)\n",
"queue.start_job(VAR_70)\n",
"VAR_76 = requests.post(VAR_27 + '/api/' + VAR_102 + '... | [
"def queue_thread(path_to_local_server, test_mode=False):...\n",
"while True:\n",
"next_job = queue.pop()\n",
"time.sleep(1)\n",
"if test_mode:\n",
"if next_job is not None:\n",
"_, hash, input_data, task_type = next_job\n",
"time.sleep(1)\n",
"queue.start_job(hash)\n",
"response = requests.post(p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_12, VAR_13 = self.make_request('POST', '/create_group'.encode('ascii'),\n VAR_7=self.admin_user_tok, content={'localpart': 'test'})\n",
"self.assertEqual(200, int(VAR_13.result['code']), msg=channel.result['body'])\n",
"VAR_5 = VAR_13.json_body['group_id']\n",
"self._check_... | [
"def test_delete_group(self):...\n",
"request, channel = self.make_request('POST', '/create_group'.encode('ascii'\n ), access_token=self.admin_user_tok, content={'localpart': 'test'})\n",
"self.assertEqual(200, int(channel.result['code']), msg=channel.result['body'])\n",
"group_id = channel.json_body['grou... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0: Optional[str], VAR_1: Optional[Path]) ->Union[CLASS_0,...\n",
"VAR_2 = FUNC_3(VAR_0=url, VAR_1=path)\n",
"if isinstance(VAR_2, GeneratorError):\n",
"return VAR_2\n",
"VAR_3 = GeneratorData.from_dict(VAR_2)\n",
"if isinstance(VAR_3, GeneratorError):\n",
"return VAR_3\n",
"return CLAS... | [
"def _get_project_for_url_or_path(url: Optional[str], path: Optional[Path]...\n",
"data_dict = _get_document(url=url, path=path)\n",
"if isinstance(data_dict, GeneratorError):\n",
"return data_dict\n",
"openapi = GeneratorData.from_dict(data_dict)\n",
"if isinstance(openapi, GeneratorError):\n",
"return... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@property...\n",
"return self._base_builder.room_id\n"
] | [
"@property...\n",
"return self._base_builder.room_id\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_8, VAR_9=None):...\n",
"self.clock = VAR_8.get_clock()\n",
"if VAR_9 is None:\n",
"VAR_9 = CLASS_4(VAR_8), CLASS_6(VAR_8), CLASS_7(VAR_8)\n",
"self._key_fetchers = VAR_9\n",
"self.key_downloads = {}\n"
] | [
"def __init__(self, hs, key_fetchers=None):...\n",
"self.clock = hs.get_clock()\n",
"if key_fetchers is None:\n",
"key_fetchers = StoreKeyFetcher(hs), PerspectivesKeyFetcher(hs\n ), ServerKeyFetcher(hs)\n",
"self._key_fetchers = key_fetchers\n",
"self.key_downloads = {}\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_13(self, VAR_19):...\n",
"if VAR_19.tag in self.md.opaqueElements:\n",
"return True\n",
"if VAR_19.get('data-opaque') is not None:\n",
"return True\n",
"return False\n"
] | [
"def isOpaqueElement(self, el):...\n",
"if el.tag in self.md.opaqueElements:\n",
"return True\n",
"if el.get('data-opaque') is not None:\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"@CLASS_4('tabs')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = collections.defaultdict(list)\n",
"for win_id, window in objreg.window_registry.items():\n",
"if sip.isdeleted(window):\n",
"VAR_20 = jinja.render('tabs.html', title='Tabs', tab_list_by_window=tabs)\n",
"VAR_33 = objreg.get('tabbed-browser', ... | [
"@add_handler('tabs')...\n",
"\"\"\"docstring\"\"\"\n",
"tabs = collections.defaultdict(list)\n",
"for win_id, window in objreg.window_registry.items():\n",
"if sip.isdeleted(window):\n",
"src = jinja.render('tabs.html', title='Tabs', tab_list_by_window=tabs)\n",
"tabbed_browser = objreg.get('tabbed-bro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Return'",
"For",
"Condition",
"Assign'",
"Expr'"
] |
[
"@login_required(doConnectionCleanup=False)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5.SERVICE_OPTS.setOmeroGroup(-1)\n",
"VAR_173 = VAR_5.getObject('OriginalFile', VAR_30)\n",
"if VAR_173 is None:\n",
"return handlerInternalError(VAR_2, 'Original File does not exist (id:%s).' %\n VAR_30)\n",
"VAR_174 ... | [
"@login_required(doConnectionCleanup=False)...\n",
"\"\"\"docstring\"\"\"\n",
"conn.SERVICE_OPTS.setOmeroGroup(-1)\n",
"orig_file = conn.getObject('OriginalFile', fileId)\n",
"if orig_file is None:\n",
"return handlerInternalError(request, \n 'Original File does not exist (id:%s).' % fileId)\n",
"rsp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self, VAR_20, VAR_24):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_20.is_ajax():\n",
"return HttpResponseForbidden(json.dumps({'error': force_text(VAR_24)}))\n",
"VAR_32 = urlencode({'error': force_text(VAR_24)})\n",
"VAR_33 = force_str(reverse('shuup_admin:login') + '?' + VAR_32)\n",
"VAR_34 ... | [
"def _get_unauth_response(self, request, reason):...\n",
"\"\"\"docstring\"\"\"\n",
"if request.is_ajax():\n",
"return HttpResponseForbidden(json.dumps({'error': force_text(reason)}))\n",
"error_params = urlencode({'error': force_text(reason)})\n",
"login_url = force_str(reverse('shuup_admin:login') + '?'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"from __future__ import annotations\n",
"import datetime\n",
"import functools\n",
"import threading\n",
"from io import BytesIO\n",
"from typing import Any\n",
"import flask\n",
"import markdown2\n",
"import werkzeug.urls\n",
"from beancount import __version__ as beancou... | [
"\"\"\"Fava's main WSGI application.\n\nwhen using Fava's WSGI app, make sure to set ``app.config['BEANCOUNT_FILES']``.\nTo start a simple server::\n\n from fava.application import app\n app.config['BEANCOUNT_FILES'] = ['/path/to/file.beancount']\n app.run('localhost', 5000)\n\nAttributes:\n app: An ins... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Impor... |
[
"@CLASS_4('version')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = jinja.render('version.html', title='Version info', version=version\n .version(), copyright=qutebrowser.__copyright__)\n",
"return 'text/html', VAR_20\n"
] | [
"@add_handler('version')...\n",
"\"\"\"docstring\"\"\"\n",
"src = jinja.render('version.html', title='Version info', version=version.\n version(), copyright=qutebrowser.__copyright__)\n",
"return 'text/html', src\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def __str__(self):...\n",
"return '%s / %s' % (self.ticket, self.depends_on)\n"
] | [
"def __str__(self):...\n",
"return '%s / %s' % (self.ticket, self.depends_on)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_36(self):...\n",
"if not test.is_built_with_xla():\n",
"self.skipTest('Skipping test because XLA is not compiled in.')\n",
"self.parser = saved_model_cli.create_parser()\n",
"VAR_9 = test.test_src_dir_path(VAR_0)\n",
"VAR_41 = os.path.join(test.get_temp_dir(), 'aot_compile_cpu_dir')\n",
"VAR_1... | [
"def testAOTCompileCPUWrongSignatureDefKey(self):...\n",
"if not test.is_built_with_xla():\n",
"self.skipTest('Skipping test because XLA is not compiled in.')\n",
"self.parser = saved_model_cli.create_parser()\n",
"base_path = test.test_src_dir_path(SAVED_MODEL_PATH)\n",
"output_dir = os.path.join(test.ge... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self):...\n",
"super(CLASS_20, self).__init__()\n"
] | [
"def __init__(self):...\n",
"super(AuthOIDView, self).__init__()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_7.route('/base/<baseidx>/keywords/<params>')...\n",
"VAR_8.info('Enter Scope baseIdx {}'.format(VAR_9))\n",
"sys.stdout.flush()\n",
"VAR_23 = []\n",
"VAR_24 = None\n",
"VAR_25 = 0.0\n",
"if VAR_13:\n",
"VAR_24, VAR_25 = FUNC_3(VAR_13)\n",
"VAR_26 = VAR_24\n",
"if VAR_26 == None:\n",
"VAR_2... | [
"@scope_blueprint.route('/base/<baseidx>/keywords/<params>')...\n",
"_log.info('Enter Scope baseIdx {}'.format(baseidx))\n",
"sys.stdout.flush()\n",
"base_list = []\n",
"seed = None\n",
"percentage = 0.0\n",
"if params:\n",
"seed, percentage = decode_params(params)\n",
"s_seed = seed\n",
"if s_see... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"C... |
[
"from django.core.exceptions import ImproperlyConfigured\n",
"from django.core.signals import setting_changed\n",
"from django.http.response import HttpResponseNotFound\n",
"from shuup.xtheme._theme import get_current_theme\n",
"VAR_0 = {}\n",
"def FUNC_0(**VAR_1):...\n",
"VAR_0.clear()\n",
"setting_c... | [
"from django.core.exceptions import ImproperlyConfigured\n",
"from django.core.signals import setting_changed\n",
"from django.http.response import HttpResponseNotFound\n",
"from shuup.xtheme._theme import get_current_theme\n",
"_VIEW_CACHE = {}\n",
"def clear_view_cache(**kwargs):...\n",
"_VIEW_CACHE.c... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_1: str):...\n",
"assert VAR_1.startswith('https:')\n",
"self.sourceName = VAR_1\n",
"self.type = 'url'\n"
] | [
"def __init__(self, sourceName: str):...\n",
"assert sourceName.startswith('https:')\n",
"self.sourceName = sourceName\n",
"self.type = 'url'\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Assign'",
"Assign'"
] |
[
"def FUNC_51(self, VAR_69, VAR_67):...\n",
"\"\"\"docstring\"\"\"\n",
"return \"\"\"<table>\n<thead>%s</thead>\n<tbody>\n%s</tbody>\n</table>\n\"\"\" % (VAR_69,\n VAR_67)\n"
] | [
"def table(self, header, body):...\n",
"\"\"\"docstring\"\"\"\n",
"return \"\"\"<table>\n<thead>%s</thead>\n<tbody>\n%s</tbody>\n</table>\n\"\"\" % (header,\n body)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@VAR_2.route('/ajax/getlocale')...\n",
"VAR_58 = babel.list_translations() + [LC('en')]\n",
"VAR_59 = list()\n",
"VAR_60 = get_locale()\n",
"for loc in VAR_58:\n",
"VAR_59.append({'value': str(loc), 'text': loc.get_language_name(VAR_60)})\n",
"return json.dumps(VAR_59)\n"
] | [
"@admi.route('/ajax/getlocale')...\n",
"locale = babel.list_translations() + [LC('en')]\n",
"ret = list()\n",
"current_locale = get_locale()\n",
"for loc in locale:\n",
"ret.append({'value': str(loc), 'text': loc.get_language_name(current_locale)})\n",
"return json.dumps(ret)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"def __repr__(self) ->str:...\n",
"return util.repr_(self)\n"
] | [
"def __repr__(self) ->str:...\n",
"return util.repr_(self)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_40(VAR_16, VAR_17):...\n",
"return config.set_from_dictionary(VAR_16, VAR_17, lambda y: 1 if y == 'on' else\n 0, 0)\n"
] | [
"def _config_checkbox_int(to_save, x):...\n",
"return config.set_from_dictionary(to_save, x, lambda y: 1 if y == 'on' else\n 0, 0)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"async def FUNC_6(self):...\n",
"if not hasattr(self, 'resolved_ref'):\n",
"self.resolved_ref = await self.get_resolved_ref()\n",
"return f'{self.url}/{self.resolved_ref}'\n"
] | [
"async def get_resolved_spec(self):...\n",
"if not hasattr(self, 'resolved_ref'):\n",
"self.resolved_ref = await self.get_resolved_ref()\n",
"return f'{self.url}/{self.resolved_ref}'\n"
] | [
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_40(self, VAR_2='password'):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = HttpRequest()\n",
"CsrfViewMiddleware().process_view(VAR_18, login_view, (), {})\n",
"VAR_18.META['CSRF_COOKIE_USED'] = True\n",
"VAR_19 = login_view(VAR_18)\n",
"VAR_20 = CsrfViewMiddleware().process_response(VAR_18, VAR_... | [
"def test_login_csrf_rotate(self, password='password'):...\n",
"\"\"\"docstring\"\"\"\n",
"req = HttpRequest()\n",
"CsrfViewMiddleware().process_view(req, login_view, (), {})\n",
"req.META['CSRF_COOKIE_USED'] = True\n",
"resp = login_view(req)\n",
"resp2 = CsrfViewMiddleware().process_response(req, resp... | [
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'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@VAR_2.route('/author')...\n",
"if VAR_87.check_visibility(constants.SIDEBAR_AUTHOR):\n",
"if VAR_87.get_view_property('author', 'dir') == 'desc':\n",
"abort(404)\n",
"VAR_10 = db.Authors.sort.desc()\n",
"VAR_10 = db.Authors.sort.asc()\n",
"VAR_109 = 0\n",
"VAR_109 = 1\n",
"VAR_63 = calibre_db.sess... | [
"@web.route('/author')...\n",
"if current_user.check_visibility(constants.SIDEBAR_AUTHOR):\n",
"if current_user.get_view_property('author', 'dir') == 'desc':\n",
"abort(404)\n",
"order = db.Authors.sort.desc()\n",
"order = db.Authors.sort.asc()\n",
"order_no = 0\n",
"order_no = 1\n",
"entries = cali... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self) ->Optional[float]:...\n",
"\"\"\"docstring\"\"\"\n",
"return os.stat(self.sourceName).st_mtime\n",
"return None\n"
] | [
"def mtime(self) ->Optional[float]:...\n",
"\"\"\"docstring\"\"\"\n",
"return os.stat(self.sourceName).st_mtime\n",
"return None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'",
"Return'"
] |
[
"def FUNC_0(self, VAR_3, VAR_4):...\n",
"self.url = b'/_matrix/client/r0/publicRooms'\n",
"VAR_51 = self.default_config()\n",
"VAR_51['allow_public_rooms_without_auth'] = False\n",
"self.hs = self.setup_test_homeserver(VAR_51=config)\n",
"return self.hs\n"
] | [
"def make_homeserver(self, reactor, clock):...\n",
"self.url = b'/_matrix/client/r0/publicRooms'\n",
"config = self.default_config()\n",
"config['allow_public_rooms_without_auth'] = False\n",
"self.hs = self.setup_test_homeserver(config=config)\n",
"return self.hs\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"async def FUNC_22(VAR_23):...\n",
"self.assertEquals(current_context().request, 'context_12')\n",
"return {'server10': {FUNC_0(VAR_20): FetchKeyResult(get_verify_key(VAR_20),\n 100)}}\n"
] | [
"async def second_lookup_fetch(keys_to_fetch):...\n",
"self.assertEquals(current_context().request, 'context_12')\n",
"return {'server10': {get_key_id(key1): FetchKeyResult(get_verify_key(key1),\n 100)}}\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_9(self, VAR_10, VAR_23, VAR_20):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_110 = []\n",
"for VAR_18 in range(0, 10):\n",
"VAR_15 = f'{VAR_20}_{VAR_18:d}'\n",
"return [r.replace('\\r', '') for r in VAR_110]\n",
"if VAR_15 not in VAR_10:\n",
"VAR_110.append(VAR_10.get(VAR_15, ''))\n"
] | [
"def value_from_datadict(self, data, files, name):...\n",
"\"\"\"docstring\"\"\"\n",
"ret = []\n",
"for idx in range(0, 10):\n",
"fieldname = f'{name}_{idx:d}'\n",
"return [r.replace('\\r', '') for r in ret]\n",
"if fieldname not in data:\n",
"ret.append(data.get(fieldname, ''))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"async def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"async def get_resolved_ref_url(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"AsyncFunctionDef'",
"Docstring"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_14\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return _existing_enums\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@parameterized.named_parameters(('VariablesToFeedNone', '', 'func2', None),...\n",
"if not test.is_built_with_xla():\n",
"self.skipTest('Skipping test because XLA is not compiled in.')\n",
"VAR_14 = os.path.join(test.get_temp_dir(), 'dummy_model')\n",
"VAR_15 = self.AOTCompileDummyModel()\n",
"VAR_7 = ge... | [
"@parameterized.named_parameters(('VariablesToFeedNone', '', 'func2', None),...\n",
"if not test.is_built_with_xla():\n",
"self.skipTest('Skipping test because XLA is not compiled in.')\n",
"saved_model_dir = os.path.join(test.get_temp_dir(), 'dummy_model')\n",
"dummy_model = self.AOTCompileDummyModel()\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
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"C... |
[
"\"\"\"``chameleon.tales`` expressions.\"\"\"\n",
"import warnings\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"... | [
"\"\"\"``chameleon.tales`` expressions.\"\"\"\n",
"import warnings\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"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Im... |
[
"@VAR_0.get('/ping', response_model=bool)...\n",
"\"\"\"docstring\"\"\"\n",
"return True\n"
] | [
"@app.get('/ping', response_model=bool)...\n",
"\"\"\"docstring\"\"\"\n",
"return True\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_6():...\n",
"return VAR_11\n"
] | [
"def getTrustedEngine():...\n",
"return _trusted_engine\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_20(self, VAR_1):...\n",
"VAR_5 = VAR_1.MagicMock()\n",
"VAR_26 = VAR_1.MagicMock()\n",
"VAR_23 = oai.Schema.construct(type='string')\n",
"VAR_35 = VAR_1.patch(f'{VAR_0}.StringProperty')\n",
"from openapi_python_client.parser.properties import _string_based_property\n",
"VAR_4 = VAR_29(VAR_5=na... | [
"def test__string_based_property_no_format(self, mocker):...\n",
"name = mocker.MagicMock()\n",
"required = mocker.MagicMock()\n",
"data = oai.Schema.construct(type='string')\n",
"StringProperty = mocker.patch(f'{MODULE_NAME}.StringProperty')\n",
"from openapi_python_client.parser.properties import _strin... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assert'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_32 = {}\n",
"if self.has_higher_quota():\n",
"VAR_32['quota'] = VAR_12.get('per_repo_quota_higher')\n",
"VAR_32['quota'] = VAR_12.get('per_repo_quota')\n",
"for item in self.spec_config:\n",
"VAR_52 = item.get('pattern', None)\n",
"re... | [
"def repo_config(self, settings):...\n",
"\"\"\"docstring\"\"\"\n",
"repo_config = {}\n",
"if self.has_higher_quota():\n",
"repo_config['quota'] = settings.get('per_repo_quota_higher')\n",
"repo_config['quota'] = settings.get('per_repo_quota')\n",
"for item in self.spec_config:\n",
"pattern = item.get... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'"
] |
[
"def FUNC_8(self, VAR_10: Text, VAR_12: Optional[Text]=None) ->None:...\n",
"import boto3\n",
"import botocore\n",
"if not VAR_12:\n",
"VAR_12 = boto3.DEFAULT_SESSION.region_name\n",
"VAR_25 = {'LocationConstraint': VAR_12}\n",
"self.s3.create_bucket(Bucket=bucket_name, CreateBucketConfiguration=\n b... | [
"def _ensure_bucket_exists(self, bucket_name: Text, region_name: Optional[...\n",
"import boto3\n",
"import botocore\n",
"if not region_name:\n",
"region_name = boto3.DEFAULT_SESSION.region_name\n",
"bucket_config = {'LocationConstraint': region_name}\n",
"self.s3.create_bucket(Bucket=bucket_name, Creat... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"Import'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_16(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 options(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 res... | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_38(VAR_33):...\n",
"if callable(VAR_65):\n",
"return FUNC_19(VAR_33)\n",
"VAR_34 = VAR_65()\n",
"VAR_0.exception(\n 'Error while trying to retrieve custom LastModified value for plugin {}'\n .format(VAR_8))\n",
"if VAR_34:\n",
"return VAR_34\n"
] | [
"def compute_lastmodified(files):...\n",
"if callable(custom_lastmodified):\n",
"return _compute_date(files)\n",
"lastmodified = custom_lastmodified()\n",
"_logger.exception(\n 'Error while trying to retrieve custom LastModified value for plugin {}'\n .format(key))\n",
"if lastmodified:\n",
"retur... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Condition",
"Return'"
] |
[
"def FUNC_14():...\n",
"VAR_47 = f.readline()\n",
"VAR_47 = '/'.join(VAR_47.split('/')[:-2])\n",
"VAR_35 = []\n",
"for c in VAR_34:\n",
"VAR_35.append(FUNC_10(VAR_47 + '/' + c.strip()))\n",
"return VAR_35\n"
] | [
"def get_class_path():...\n",
"dataset_path = f.readline()\n",
"dataset_path = '/'.join(dataset_path.split('/')[:-2])\n",
"class_paths = []\n",
"for c in classes_list:\n",
"class_paths.append(_get_obj_absolute_path(dataset_path + '/' + c.strip()))\n",
"return class_paths\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self, VAR_3, VAR_4):...\n",
"self.hs = self.setup_test_homeserver('red', http_client=None,\n federation_client=Mock())\n",
"self.hs.get_federation_handler = Mock()\n",
"self.hs.get_federation_handler.return_value.maybe_backfill = Mock(return_value\n =make_awaitable(None))\n",
"async def FU... | [
"def make_homeserver(self, reactor, clock):...\n",
"self.hs = self.setup_test_homeserver('red', http_client=None,\n federation_client=Mock())\n",
"self.hs.get_federation_handler = Mock()\n",
"self.hs.get_federation_handler.return_value.maybe_backfill = Mock(return_value\n =make_awaitable(None))\n",
"a... | [
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"AsyncFunctionDef'",
"Return'"
] |
[
"@ensure_csrf_cookie...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n",
"VAR_131 = 'bulk_course_email'\n",
"VAR_132 = instructor_task.api.get_instructor_task_history(VAR_10, VAR_131=\n task_type)\n",
"VAR_63 = {'tasks': map(extract_task_features, VAR_... | [
"@ensure_csrf_cookie...\n",
"\"\"\"docstring\"\"\"\n",
"course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n",
"task_type = 'bulk_course_email'\n",
"tasks = instructor_task.api.get_instructor_task_history(course_id,\n task_type=task_type)\n",
"response_payload = {'tasks': map(extract... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_22(self, VAR_12):...\n",
"if VAR_12.get('fields'):\n",
"VAR_13 = VAR_12.get('fields')\n",
"if VAR_12.get('columns'):\n",
"return VAR_13\n",
"VAR_13 = VAR_12.get('columns')\n",
"if VAR_12.get('fields'):\n",
"VAR_13 = VAR_12.get('fields')\n",
"VAR_13 = [['name', self.ref_doctype]]\n",
"for... | [
"def get_standard_report_columns(self, params):...\n",
"if params.get('fields'):\n",
"columns = params.get('fields')\n",
"if params.get('columns'):\n",
"return columns\n",
"columns = params.get('columns')\n",
"if params.get('fields'):\n",
"columns = params.get('fields')\n",
"columns = [['name', self... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_44(self, VAR_10, VAR_11, VAR_12, VAR_13, VAR_14=None, VAR_15=None):...\n",
"VAR_45 = '#id_%s_add_link' % VAR_11\n",
"VAR_46 = '#id_%s_add_all_link' % VAR_11\n",
"VAR_47 = '#id_%s_remove_link' % VAR_11\n",
"VAR_48 = '#id_%s_remove_all_link' % VAR_11\n",
"self.assertEqual(self.has_css_class(VAR_45... | [
"def assertActiveButtons(self, mode, field_name, choose, remove, choose_all=...\n",
"choose_link = '#id_%s_add_link' % field_name\n",
"choose_all_link = '#id_%s_add_all_link' % field_name\n",
"remove_link = '#id_%s_remove_link' % field_name\n",
"remove_all_link = '#id_%s_remove_all_link' % field_name\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@FUNC_0...\n",
"return ReplicationDataHandler(self)\n"
] | [
"@cache_in_self...\n",
"return ReplicationDataHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_152(VAR_213):...\n",
"if VAR_43:\n",
"VAR_213 = FUNC_151(VAR_213)\n",
"return VAR_213\n"
] | [
"def encoded_or_raw(text):...\n",
"if raw:\n",
"text = encode_header(text)\n",
"return text\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self, VAR_19, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = self.get_authenticated_connection(VAR_19, VAR_2)\n",
"VAR_28 = self.is_valid_public_url(VAR_19, VAR_2)\n",
"VAR_0.debug('Is valid public URL? %s' % VAR_28)\n",
"if VAR_27 is None and VAR_28:\n",
"VAR_0.debug(\n 'OMERO.webp... | [
"def get_connection(self, server_id, request):...\n",
"\"\"\"docstring\"\"\"\n",
"connection = self.get_authenticated_connection(server_id, request)\n",
"is_valid_public_url = self.is_valid_public_url(server_id, request)\n",
"logger.debug('Is valid public URL? %s' % is_valid_public_url)\n",
"if connection... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Condition",... |
[
"def FUNC_159(VAR_82):...\n",
"VAR_366 = to_native(TAG['cas:serviceResponse'](VAR_82, **{'_xmlns:cas':\n 'http://www.yale.edu/tp/cas'}).xml())\n",
"return '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' + VAR_366\n"
] | [
"def build_response(body):...\n",
"xml_body = to_native(TAG['cas:serviceResponse'](body, **{'_xmlns:cas':\n 'http://www.yale.edu/tp/cas'}).xml())\n",
"return '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' + xml_body\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_16(VAR_21, VAR_17):...\n",
"VAR_57 = VAR_21.split(',')\n",
"VAR_57 = list(map(lambda it: it.strip(), VAR_57))\n",
"VAR_57 = helper.uniq(VAR_57)\n",
"return FUNC_7(VAR_57, VAR_17.tags, db.Tags, calibre_db.session, 'tags')\n"
] | [
"def edit_book_tags(tags, book):...\n",
"input_tags = tags.split(',')\n",
"input_tags = list(map(lambda it: it.strip(), input_tags))\n",
"input_tags = helper.uniq(input_tags)\n",
"return modify_database_object(input_tags, book.tags, db.Tags, calibre_db.\n session, 'tags')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@FUNC_0...\n",
"return GroupAttestionRenewer(self)\n"
] | [
"@cache_in_self...\n",
"return GroupAttestionRenewer(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@require_POST...\n",
"VAR_3 = get_object_or_404(CommentPoll.objects.unremoved(), VAR_1=pk)\n",
"if not VAR_0.user.is_authenticated:\n",
"return redirect_to_login(next=poll.get_absolute_url())\n",
"VAR_4 = PollVoteManyForm(user=request.user, VAR_3=poll, data=request.POST)\n",
"if VAR_4.is_valid():\n",
"... | [
"@require_POST...\n",
"poll = get_object_or_404(CommentPoll.objects.unremoved(), pk=pk)\n",
"if not request.user.is_authenticated:\n",
"return redirect_to_login(next=poll.get_absolute_url())\n",
"form = PollVoteManyForm(user=request.user, poll=poll, data=request.POST)\n",
"if form.is_valid():\n",
"Comme... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
4
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Return'"
] |
[
"async def FUNC_18(self, VAR_28, VAR_29=None):...\n",
"VAR_33 = AsyncHTTPClient()\n",
"VAR_46 = {}\n",
"if self.client_id and self.client_secret:\n",
"VAR_46.update(dict(auth_username=self.client_id, auth_password=self.\n client_secret))\n",
"VAR_47 = {}\n",
"if self.access_token:\n",
"VAR_47['Auth... | [
"async def github_api_request(self, api_url, etag=None):...\n",
"client = AsyncHTTPClient()\n",
"request_kwargs = {}\n",
"if self.client_id and self.client_secret:\n",
"request_kwargs.update(dict(auth_username=self.client_id, auth_password=self\n .client_secret))\n",
"headers = {}\n",
"if self.access... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'... |
[
"def FUNC_42():...\n",
"VAR_129 = make_response(render_template('index.jinja2', **render_kwargs))\n",
"if VAR_107:\n",
"VAR_129 = util.flask.add_non_caching_response_headers(VAR_129)\n",
"return VAR_129\n"
] | [
"def make_default_ui():...\n",
"r = make_response(render_template('index.jinja2', **render_kwargs))\n",
"if wizard:\n",
"r = util.flask.add_non_caching_response_headers(r)\n",
"return r\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_19(self, VAR_17):...\n",
"FUNC_0()\n",
"VAR_68 = '../res/img/folder.png'\n",
"log.i('Fetching album art for: %s' % VAR_17)\n",
"VAR_69 = os.path.join(cherry.config['media.basedir'], VAR_17)\n",
"if os.path.isfile(VAR_69):\n",
"VAR_99 = TinyTag.get(VAR_69, image=True)\n",
"VAR_66 = albumArtFi... | [
"def api_fetchalbumart(self, directory):...\n",
"_save_and_release_session()\n",
"default_folder_image = '../res/img/folder.png'\n",
"log.i('Fetching album art for: %s' % directory)\n",
"filepath = os.path.join(cherry.config['media.basedir'], directory)\n",
"if os.path.isfile(filepath):\n",
"tag = TinyT... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Condition",... |
[
"def FUNC_20(self):...\n",
"self.assertFormfield(models.Album, 'backside_art', widgets.AdminFileWidget)\n"
] | [
"def testInheritance(self):...\n",
"self.assertFormfield(models.Album, 'backside_art', widgets.AdminFileWidget)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.