lines listlengths 1 383 | raw_lines listlengths 1 383 | label listlengths 1 383 | type listlengths 1 383 |
|---|---|---|---|
[
"async def FUNC_18(VAR_3):...\n",
"VAR_3.write(b'response')\n",
"VAR_3.finish()\n"
] | [
"async def callback(request):...\n",
"request.write(b'response')\n",
"request.finish()\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Expr'",
"Expr'"
] |
[
"import re\n",
"import json\n",
"import base64\n",
"import warnings\n",
"from functools import wraps\n",
"import omero\n",
"import omero.clients\n",
"from past.builtins import unicode\n",
"from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseServerError, JsonResponse, HttpRespon... | [
"import re\n",
"import json\n",
"import base64\n",
"import warnings\n",
"from functools import wraps\n",
"import omero\n",
"import omero.clients\n",
"from past.builtins import unicode\n",
"from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseServerError, JsonResponse, HttpRespon... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
... |
[
"def __getstate__(self):...\n",
"return self\n"
] | [
"def __getstate__(self):...\n",
"return self\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"async def FUNC_24(VAR_23):...\n",
"self.assertEqual(VAR_23, {'server1': {FUNC_0(VAR_20): 1500}})\n",
"return {'server1': {FUNC_0(VAR_20): FetchKeyResult(get_verify_key(VAR_20), \n 1200)}}\n"
] | [
"async def get_keys(keys_to_fetch):...\n",
"self.assertEqual(keys_to_fetch, {'server1': {get_key_id(key1): 1500}})\n",
"return {'server1': {get_key_id(key1): FetchKeyResult(get_verify_key(key1), \n 1200)}}\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"Expr'",
"Return'"
] |
[
"from __future__ import absolute_import, division, unicode_literals\n",
"from six import text_type\n",
"import re\n",
"from ..constants import voidElements, booleanAttributes, spaceCharacters\n",
"from ..constants import rcdataElements, entities, xmlEntities\n",
"from .. import utils\n",
"from xml.sax.s... | [
"from __future__ import absolute_import, division, unicode_literals\n",
"from six import text_type\n",
"import re\n",
"from ..constants import voidElements, booleanAttributes, spaceCharacters\n",
"from ..constants import rcdataElements, entities, xmlEntities\n",
"from .. import utils\n",
"from xml.sax.s... | [
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"FunctionDef'",
"Assign'",
... |
[
"import errno\n",
"import logging\n",
"import os\n",
"import shutil\n",
"from typing import IO, Dict, List, Optional, Tuple\n",
"import twisted.internet.error\n",
"import twisted.web.http\n",
"from twisted.web.http import Request\n",
"from twisted.web.resource import Resource\n",
"from synapse.api... | [
"import errno\n",
"import logging\n",
"import os\n",
"import shutil\n",
"from typing import IO, Dict, List, Optional, Tuple\n",
"import twisted.internet.error\n",
"import twisted.web.http\n",
"from twisted.web.http import Request\n",
"from twisted.web.resource import Resource\n",
"from synapse.api... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
... |
[
"def FUNC_142(self, VAR_82):...\n",
"return (VAR_82 or '').replace('://HOSTNAME', '://%s' % self.host)\n"
] | [
"def fix_hostname(self, body):...\n",
"return (body or '').replace('://HOSTNAME', '://%s' % self.host)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self):...\n",
"VAR_56 = def_function.function(self.multiply, input_signature=[tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.TensorSpec(\n shape=(), dtype=dtypes.float32)])\n",
"self.pure_concrete_function = VAR_56.get_concrete_function()\n",
"super(CLASS_2, self)._... | [
"def __init__(self):...\n",
"function = def_function.function(self.multiply, input_signature=[\n tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32), tensor_spec.\n TensorSpec(shape=(), dtype=dtypes.float32)])\n",
"self.pure_concrete_function = function.get_concrete_function()\n",
"super(DummyModel, ... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_10(self):...\n",
"VAR_20 = 'input1=/path/file.txt[ab3];input2=file2'\n",
"VAR_21 = 'input3=np.zeros([2,2]);input4=[4,5]'\n",
"VAR_22 = saved_model_cli.preprocess_inputs_arg_string(VAR_20)\n",
"VAR_23 = saved_model_cli.preprocess_input_exprs_arg_string(VAR_21)\n",
"self.assertTrue(VAR_22['input1'... | [
"def testInputPreProcessFormats(self):...\n",
"input_str = 'input1=/path/file.txt[ab3];input2=file2'\n",
"input_expr_str = 'input3=np.zeros([2,2]);input4=[4,5]'\n",
"input_dict = saved_model_cli.preprocess_inputs_arg_string(input_str)\n",
"input_expr_dict = saved_model_cli.preprocess_input_exprs_arg_string(... | [
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"from openapi_python_client.parser.properties import EnumProperty\n",
"VAR_23 = ['abc', '123', 'a23', 'abc']\n",
"VAR_27.values_from_list(VAR_23)\n"
] | [
"def test_values_from_list_duplicate(self):...\n",
"from openapi_python_client.parser.properties import EnumProperty\n",
"data = ['abc', '123', 'a23', 'abc']\n",
"EnumProperty.values_from_list(data)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Expr'"
] |
[
"def FUNC_21(self):...\n",
"VAR_32 = '/rooms/%s/send/m.room.message/mid1' % urlparse.quote(self.room_id)\n",
"VAR_22, VAR_23 = self.make_request('PUT', VAR_32, b'{}')\n",
"self.assertEquals(400, VAR_23.code, msg=channel.result['body'])\n",
"VAR_22, VAR_23 = self.make_request('PUT', VAR_32, b'{\"_name\":\"bo... | [
"def test_invalid_puts(self):...\n",
"path = '/rooms/%s/send/m.room.message/mid1' % urlparse.quote(self.room_id)\n",
"request, channel = self.make_request('PUT', path, b'{}')\n",
"self.assertEquals(400, channel.code, msg=channel.result['body'])\n",
"request, channel = self.make_request('PUT', path, b'{\"_na... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, *VAR_13, **VAR_14):...\n",
"VAR_80 = VAR_14.pop('retries', 0)\n",
"VAR_81 = VAR_14.pop('cache', None)\n",
"VAR_82 = VAR_14.pop('insecure_hosts', [])\n",
"VAR_27 = VAR_14.pop('index_urls', None)\n",
"super(CLASS_4, self).__init__(*VAR_13, **kwargs)\n",
"self.headers['User-Agent'] = FU... | [
"def __init__(self, *args, **kwargs):...\n",
"retries = kwargs.pop('retries', 0)\n",
"cache = kwargs.pop('cache', None)\n",
"insecure_hosts = kwargs.pop('insecure_hosts', [])\n",
"index_urls = kwargs.pop('index_urls', None)\n",
"super(PipSession, self).__init__(*args, **kwargs)\n",
"self.headers['User-A... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_7(VAR_1):...\n",
"VAR_20.throw(_('Invalid Search Field {0}').format(VAR_1), VAR_20.DataError)\n"
] | [
"def _raise_exception(searchfield):...\n",
"frappe.throw(_('Invalid Search Field {0}').format(searchfield), frappe.\n DataError)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_71(self, VAR_43, VAR_26):...\n",
"if not self.get('__onload'):\n",
"self.set('__onload', frappe._dict())\n",
"self.get('__onload')[VAR_43] = VAR_26\n"
] | [
"def set_onload(self, key, value):...\n",
"if not self.get('__onload'):\n",
"self.set('__onload', frappe._dict())\n",
"self.get('__onload')[key] = value\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_3(self):...\n",
"VAR_15, VAR_16 = self.make_request('PUT', '/rooms/%s/typing/%s' % (self.\n room_id, self.user_id), b'{\"typing\": false}')\n",
"self.assertEquals(200, VAR_16.code)\n"
] | [
"def test_set_not_typing(self):...\n",
"request, channel = self.make_request('PUT', '/rooms/%s/typing/%s' % (self.\n room_id, self.user_id), b'{\"typing\": false}')\n",
"self.assertEquals(200, channel.code)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@VAR_1.route('/redv')...\n",
"VAR_12 = request.args.get('url')\n",
"VAR_3 = urllib2.build_opener()\n",
"VAR_4 = victim_headers()\n",
"VAR_3.addheaders = VAR_4\n",
"VAR_5 = victim_inject_code(VAR_3.open(VAR_12).read(), 'vscript')\n",
"return VAR_5\n"
] | [
"@app.route('/redv')...\n",
"url = request.args.get('url')\n",
"opener = urllib2.build_opener()\n",
"headers = victim_headers()\n",
"opener.addheaders = headers\n",
"html = victim_inject_code(opener.open(url).read(), 'vscript')\n",
"return html\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"return create_resource_tree({'/_matrix/key/v2': KeyApiV2Resource(self.hs)},\n root_resource=NoResource())\n"
] | [
"def create_test_resource(self):...\n",
"return create_resource_tree({'/_matrix/key/v2': KeyApiV2Resource(self.hs)},\n root_resource=NoResource())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@VAR_2.route('/ajax/addrestriction/<int:res_type>', methods=['POST'])...\n",
"return FUNC_31(VAR_8, 0)\n"
] | [
"@admi.route('/ajax/addrestriction/<int:res_type>', methods=['POST'])...\n",
"return add_restriction(res_type, 0)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"import sys\n",
"from datetime import datetime\n",
"from flask import Blueprint, flash, redirect, request, url_for\n",
"from flask_babel import gettext as _\n",
"from flask_login import current_user, login_required\n",
"from sqlalchemy.exc import InvalidRequestError, OperationalError\n",
"from sqlalchem... | [
"import sys\n",
"from datetime import datetime\n",
"from flask import Blueprint, flash, redirect, request, url_for\n",
"from flask_babel import gettext as _\n",
"from flask_login import current_user, login_required\n",
"from sqlalchemy.exc import InvalidRequestError, OperationalError\n",
"from sqlalchem... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_26(self, VAR_2, VAR_3):...\n",
"VAR_3.setattr('flask.request.host_url', 'http://example.com')\n",
"assert _validate_redirect_url('http://fail.com') is False\n",
"VAR_3.undo()\n"
] | [
"def test_it_fails_with_invalid_netloc(self, app, monkeypatch):...\n",
"monkeypatch.setattr('flask.request.host_url', 'http://example.com')\n",
"assert _validate_redirect_url('http://fail.com') is False\n",
"monkeypatch.undo()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assert'",
"Expr'"
] |
[
"def FUNC_70(VAR_5, VAR_44, VAR_45, VAR_46, VAR_47, VAR_48, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_73 = omero.sys.ParametersI()\n",
"VAR_74 = VAR_5.getQueryService()\n",
"VAR_44 = set(VAR_44)\n",
"VAR_45 = set(VAR_45)\n",
"VAR_46 = set(VAR_46)\n",
"VAR_219 = set([])\n",
"VAR_48 = set(VAR_48... | [
"def getAllObjects(conn, project_ids, dataset_ids, image_ids, screen_ids,...\n",
"\"\"\"docstring\"\"\"\n",
"params = omero.sys.ParametersI()\n",
"qs = conn.getQueryService()\n",
"project_ids = set(project_ids)\n",
"dataset_ids = set(dataset_ids)\n",
"image_ids = set(image_ids)\n",
"fileset_ids = set(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Assig... |
[
"def FUNC_63(self, VAR_141):...\n",
"VAR_275 = str(int(time.time())) + '-' + web2py_uuid()\n",
"VAR_276 = self.url(self.settings.function, VAR_11=('reset_password',),\n VAR_96={'key': reset_password_key}, VAR_97=True)\n",
"VAR_27 = dict(VAR_141)\n",
"VAR_27.update(dict(VAR_199=reset_password_key, VAR_276... | [
"def email_reset_password(self, user):...\n",
"reset_password_key = str(int(time.time())) + '-' + web2py_uuid()\n",
"link = self.url(self.settings.function, args=('reset_password',), vars={\n 'key': reset_password_key}, scheme=True)\n",
"d = dict(user)\n",
"d.update(dict(key=reset_password_key, link=link... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_35(self):...\n",
"return self.file.file.size\n"
] | [
"def get_size(self):...\n",
"return self.file.file.size\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_65():...\n",
"\"\"\"docstring\"\"\"\n",
"if not hasattr(VAR_1, 'doc_events_hooks'):\n",
"VAR_184 = FUNC_66('doc_events', {})\n",
"return VAR_1.doc_events_hooks\n",
"VAR_179 = {}\n",
"for VAR_46, VAR_105 in iteritems(VAR_184):\n",
"if isinstance(VAR_46, tuple):\n",
"VAR_1.doc_events_hooks =... | [
"def get_doc_hooks():...\n",
"\"\"\"docstring\"\"\"\n",
"if not hasattr(local, 'doc_events_hooks'):\n",
"hooks = get_hooks('doc_events', {})\n",
"return local.doc_events_hooks\n",
"out = {}\n",
"for key, value in iteritems(hooks):\n",
"if isinstance(key, tuple):\n",
"local.doc_events_hooks = out\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Assign'",
"For",
"Condition",
"Assign'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_20(self, VAR_44):...\n",
"VAR_69 = re.sub('^ *| *\\\\| *$', '', VAR_44.group(1))\n",
"VAR_69 = re.split(' *\\\\| *', VAR_69)\n",
"VAR_81 = re.sub(' *|\\\\| *$', '', VAR_44.group(2))\n",
"VAR_81 = re.split(' *\\\\| *', VAR_81)\n",
"for VAR_101, VAR_100 in enumerate(VAR_81):\n",
"if re.search('^... | [
"def _process_table(self, m):...\n",
"header = re.sub('^ *| *\\\\| *$', '', m.group(1))\n",
"header = re.split(' *\\\\| *', header)\n",
"align = re.sub(' *|\\\\| *$', '', m.group(2))\n",
"align = re.split(' *\\\\| *', align)\n",
"for i, v in enumerate(align):\n",
"if re.search('^ *-+: *$', v):\n",
"it... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_41(self):...\n",
"return self.renderer.paragraph(self.tok_text())\n"
] | [
"def output_text(self):...\n",
"return self.renderer.paragraph(self.tok_text())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_51(self, VAR_5, VAR_35):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/get_groups_publicised')\n",
"VAR_19 = {'user_ids': VAR_35}\n",
"return self.client.post_json(VAR_5=destination, VAR_2=path, VAR_39=content,\n VAR_15=True)\n"
] | [
"def bulk_get_publicised_groups(self, destination, user_ids):...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/get_groups_publicised')\n",
"content = {'user_ids': user_ids}\n",
"return self.client.post_json(destination=destination, path=path, data=\n content, ignore_backoff=True)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"async def FUNC_13(self, VAR_3: Optional[str], VAR_4: str, VAR_18: str,...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_36 = self._get_thumbnail_requirements(VAR_5)\n",
"if not VAR_36:\n",
"return None\n",
"VAR_34 = await self.media_storage.ensure_media_is_in_local_cache(FileInfo(\n VAR_3, VAR_18, VAR_17=url_ca... | [
"async def _generate_thumbnails(self, server_name: Optional[str], media_id:...\n",
"\"\"\"docstring\"\"\"\n",
"requirements = self._get_thumbnail_requirements(media_type)\n",
"if not requirements:\n",
"return None\n",
"input_path = await self.media_storage.ensure_media_is_in_local_cache(FileInfo\n (ser... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"For",
"Condition",
"For",
"Expr'",
"Condition",
"Condition",
"Return'",
"A... |
[
"def FUNC_13(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 put(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 respons... | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_84(VAR_14):...\n",
"for VAR_13 in VAR_43:\n",
"VAR_21 = getattr(self.rules, VAR_13)\n",
"return False\n",
"VAR_44 = VAR_21.match(VAR_14)\n",
"if not VAR_44:\n",
"self.line_match = VAR_44\n",
"VAR_87 = getattr(self, 'output_%s' % VAR_13)(VAR_44)\n",
"if VAR_87 is not None:\n",
"return VAR... | [
"def manipulate(text):...\n",
"for key in rules:\n",
"pattern = getattr(self.rules, key)\n",
"return False\n",
"m = pattern.match(text)\n",
"if not m:\n",
"self.line_match = m\n",
"out = getattr(self, 'output_%s' % key)(m)\n",
"if out is not None:\n",
"return m, out\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_16(*VAR_8):...\n",
"def FUNC_15(VAR_3, **VAR_4):...\n",
"VAR_15 = Deferred()\n",
"VAR_15.addCallback(FUNC_16)\n",
"self.reactor.callLater(1, VAR_15.callback, True)\n",
"return make_deferred_yieldable(VAR_15)\n"
] | [
"def test_callback_indirect_exception(self):...\n",
"\"\"\"docstring\"\"\"\n",
"def _throw(*args):...\n",
"def _callback(request, **kwargs):...\n",
"d = Deferred()\n",
"d.addCallback(_throw)\n",
"self.reactor.callLater(1, d.callback, True)\n",
"return make_deferred_yieldable(d)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"VAR_0 = self.getHeader(b'host')\n",
"if VAR_0:\n",
"if VAR_0[0] == '[':\n",
"return self.getHost().host.encode('ascii')\n",
"return VAR_0.split(']', 1)[0] + ']'\n",
"return VAR_0.split(':', 1)[0].encode('ascii')\n"
] | [
"def new_getRequestHostname(self):...\n",
"host = self.getHeader(b'host')\n",
"if host:\n",
"if host[0] == '[':\n",
"return self.getHost().host.encode('ascii')\n",
"return host.split(']', 1)[0] + ']'\n",
"return host.split(':', 1)[0].encode('ascii')\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_28(self, VAR_4, VAR_39, VAR_40):...\n",
"\"\"\"docstring\"\"\"\n",
"if not os.path.isabs(VAR_40):\n",
"self.notebook_dir = os.path.abspath(VAR_40)\n",
"if not os.path.isdir(VAR_40):\n",
"return\n",
"self.config.FileContentsManager.root_dir = VAR_40\n",
"self.config.MappingKernelManager.root_... | [
"def _notebook_dir_changed(self, name, old, new):...\n",
"\"\"\"docstring\"\"\"\n",
"if not os.path.isabs(new):\n",
"self.notebook_dir = os.path.abspath(new)\n",
"if not os.path.isdir(new):\n",
"return\n",
"self.config.FileContentsManager.root_dir = new\n",
"self.config.MappingKernelManager.root_dir =... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_30(VAR_16, VAR_35, VAR_36=True):...\n",
"VAR_63 = VAR_35.split('&')\n",
"VAR_63 = list(map(lambda it: it.strip().replace(',', '|'), VAR_63))\n",
"VAR_63 = helper.uniq(VAR_63)\n",
"if VAR_63 == ['']:\n",
"VAR_63 = [_(u'Unknown')]\n",
"VAR_64 = FUNC_7(VAR_63, VAR_16.authors, db.Authors, calibre_... | [
"def handle_author_on_edit(book, author_name, update_stored=True):...\n",
"input_authors = author_name.split('&')\n",
"input_authors = list(map(lambda it: it.strip().replace(',', '|'),\n input_authors))\n",
"input_authors = helper.uniq(input_authors)\n",
"if input_authors == ['']:\n",
"input_authors = ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Assign'"
] |
[
"def FUNC_55(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if frappe.flags.in_patch:\n",
"return\n",
"frappe.publish_realtime('doc_update', {'modified': self.modified, 'doctype':\n self.doctype, 'name': self.name}, VAR_2=self.doctype, docname=self.name,\n after_commit=True)\n",
"if not self.meta.get('re... | [
"def notify_update(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if frappe.flags.in_patch:\n",
"return\n",
"frappe.publish_realtime('doc_update', {'modified': self.modified, 'doctype':\n self.doctype, 'name': self.name}, doctype=self.doctype, docname=self.\n name, after_commit=True)\n",
"if not self.met... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Expr'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_88(VAR_212):...\n",
"VAR_408 = VAR_5.getAnnotationLinks('Image', parent_ids=imageIds)\n",
"VAR_409 = {}\n",
"VAR_410 = {}\n",
"for VAR_432 in VAR_212:\n",
"VAR_409[VAR_432] = []\n",
"for VAR_344 in VAR_408:\n",
"VAR_383 = VAR_344.getChild()\n",
"VAR_411 = []\n",
"if VAR_383._obj.__class_... | [
"def loadImageTags(imageIds):...\n",
"tagLinks = conn.getAnnotationLinks('Image', parent_ids=imageIds)\n",
"linkMap = {}\n",
"tagMap = {}\n",
"for iId in imageIds:\n",
"linkMap[iId] = []\n",
"for link in tagLinks:\n",
"c = link.getChild()\n",
"imageTags = []\n",
"if c._obj.__class__ == omero.model... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"return 'figshare-{}'.format(self.record_id)\n"
] | [
"def get_build_slug(self):...\n",
"return 'figshare-{}'.format(self.record_id)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(VAR_22=False):...\n",
"VAR_14 = g.locale.language if g.locale else 'en'\n",
"if not VAR_22 and VAR_1.get(VAR_14\n",
"return VAR_1[VAR_14], VAR_2, VAR_3\n",
"VAR_69 = settings().getBoolean(['server', 'firstRun'])\n",
"VAR_18 = defaultdict(lambda : {'order': [], 'entries': {}})\n",
"VAR_73 = ... | [
"def fetch_template_data(refresh=False):...\n",
"locale = g.locale.language if g.locale else 'en'\n",
"if not refresh and _templates.get(locale\n",
"return _templates[locale], _plugin_names, _plugin_vars\n",
"first_run = settings().getBoolean(['server', 'firstRun'])\n",
"templates = defaultdict(lambda : {... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def __call__(self, *VAR_4, VAR_5: Any=None, VAR_6: Optional[str]=None, **VAR_7...\n",
"\"\"\"docstring\"\"\"\n",
"return self.create_instance(*VAR_4, VAR_5=default, VAR_6=key, **kwargs)\n"
] | [
"def __call__(self, *args, default: Any=None, key: Optional[str]=None, **kwargs...\n",
"\"\"\"docstring\"\"\"\n",
"return self.create_instance(*args, default=default, key=key, **kwargs)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_2():...\n",
"VAR_10 = VAR_0.post('/items/', data={'name': 'Foo', 'price': 50.5})\n",
"assert VAR_10.status_code == 422, VAR_10.text\n",
"assert VAR_10.json() == {'detail': [{'ctx': {'colno': 1, 'doc':\n 'name=Foo&price=50.5', 'lineno': 1, 'msg': 'Expecting value', 'pos': 0},\n 'loc': ['body', ... | [
"def test_post_broken_body():...\n",
"response = client.post('/items/', data={'name': 'Foo', 'price': 50.5})\n",
"assert response.status_code == 422, response.text\n",
"assert response.json() == {'detail': [{'ctx': {'colno': 1, 'doc':\n 'name=Foo&price=50.5', 'lineno': 1, 'msg': 'Expecting value', 'pos': 0... | [
0,
3,
0,
3,
0,
0,
3
] | [
"FunctionDef'",
"Assign'",
"Assert'",
"Assert'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_0(self):...\n",
"self.reactor = ThreadedMemoryReactorClock()\n",
"self.hs_clock = Clock(self.reactor)\n",
"self.homeserver = setup_test_homeserver(self.addCleanup, http_client=None,\n clock=self.hs_clock, reactor=self.reactor)\n"
] | [
"def setUp(self):...\n",
"self.reactor = ThreadedMemoryReactorClock()\n",
"self.hs_clock = Clock(self.reactor)\n",
"self.homeserver = setup_test_homeserver(self.addCleanup, http_client=None,\n clock=self.hs_clock, reactor=self.reactor)\n"
] | [
0,
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@VAR_4.route('/get-quiz')...\n",
"if 'quiz_count' not in VAR_17:\n",
"VAR_17['quiz_count'] = 0\n",
"if 'solved_quiz' not in VAR_17:\n",
"VAR_17['total_munhak'] = len(VAR_3)\n",
"VAR_17['solved_quiz'] = []\n",
"VAR_17['result'] = None\n",
"VAR_18 = VAR_17['quiz_count'] + 1\n",
"VAR_19 = VAR_17['solv... | [
"@app.route('/get-quiz')...\n",
"if 'quiz_count' not in session:\n",
"session['quiz_count'] = 0\n",
"if 'solved_quiz' not in session:\n",
"session['total_munhak'] = len(munhak_rows_data)\n",
"session['solved_quiz'] = []\n",
"session['result'] = None\n",
"quiz_no = session['quiz_count'] + 1\n",
"solv... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assig... |
[
"async def FUNC_1(*, VAR_4: Optional[ModelField]=None, VAR_5: Any, VAR_6:...\n",
"if VAR_4:\n",
"VAR_51 = []\n",
"return jsonable_encoder(VAR_5)\n",
"VAR_5 = FUNC_0(VAR_5, VAR_1=exclude_unset, VAR_2=exclude_defaults, VAR_3=\n exclude_none)\n",
"if VAR_9:\n",
"VAR_67, VAR_68 = VAR_4.validate(VAR_5, {}... | [
"async def serialize_response(*, field: Optional[ModelField]=None,...\n",
"if field:\n",
"errors = []\n",
"return jsonable_encoder(response_content)\n",
"response_content = _prepare_response_content(response_content,\n exclude_unset=exclude_unset, exclude_defaults=exclude_defaults,\n exclude_none=excl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_1(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = enumerate(VAR_2, start=1)\n",
"return [('%d) %s' % item) for item in VAR_19]\n"
] | [
"def enumerate_string_list(strings):...\n",
"\"\"\"docstring\"\"\"\n",
"numbered_strings = enumerate(strings, start=1)\n",
"return [('%d) %s' % item) for item in numbered_strings]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self, VAR_11):...\n",
"if not VAR_53.session['admin']:\n",
"VAR_62 = self.useroptions.forUser(self.getUserId())\n",
"for f in VAR_11:\n",
"if not VAR_62.getOptionValue('media.may_download'):\n",
"if '/../' in f:\n",
"VAR_59 = cherry.config['media.maximum_download_size']\n",
"return 'not_p... | [
"def download_check_files(self, filelist):...\n",
"if not cherrypy.session['admin']:\n",
"uo = self.useroptions.forUser(self.getUserId())\n",
"for f in filelist:\n",
"if not uo.getOptionValue('media.may_download'):\n",
"if '/../' in f:\n",
"size_limit = cherry.config['media.maximum_download_size']\n",
... | [
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Return'",
"Return'",
"Condition",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_20(self):...\n",
"return Language.objects.exclude(Q(translation__component=self.component) |\n Q(VAR_9=self.component))\n"
] | [
"def get_lang_objects(self):...\n",
"return Language.objects.exclude(Q(translation__component=self.component) |\n Q(component=self.component))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_63, VAR_157=None, VAR_158='markmin', VAR_159=False,...\n",
"VAR_222 = self.settings = VAR_63.settings.wiki\n",
"\"\"\"string\"\"\"\n",
"VAR_328 = set(['markmin', 'html'])\n",
"VAR_329 = False\n",
"if VAR_158 == 'multiple':\n",
"VAR_158 = {}\n",
"if isinstance(VAR_158, dict):\n"... | [
"def __init__(self, auth, env=None, render='markmin', manage_permissions=...\n",
"settings = self.settings = auth.settings.wiki\n",
"\"\"\"\n Args:\n render:\n\n - \"markmin\"\n - \"html\"\n - `<function>` : Sets a custom render function\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"A... |
[
"@staticmethod...\n",
"return CLASS_3.archive(VAR_7, VAR_154=archive_table, VAR_122=current_record)\n"
] | [
"@staticmethod...\n",
"return Auth.archive(form, archive_table=archive_table, current_record=\n current_record)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_4(VAR_9):...\n",
"VAR_13 = FUNC_6(VAR_9)\n",
"if os.path.isfile(VAR_13 + ATTR_SUFFIX):\n",
"return '<object id={} src={} meta={} />'.format(quoteattr(url_for(\n '.get_object_id', VAR_9=object_path)), quoteattr(FUNC_5(VAR_9)),\n quoteattr(url_for('.get_object_meta', VAR_9=object_path)))\n",
"... | [
"def _get_object_element(object_path):...\n",
"path = _get_obj_absolute_path(object_path)\n",
"if os.path.isfile(path + ATTR_SUFFIX):\n",
"return '<object id={} src={} meta={} />'.format(quoteattr(url_for(\n '.get_object_id', object_path=object_path)), quoteattr(\n _get_object_src_uri(object_path)), quo... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"assert controller_name(CLASS_8) == 'user'\n"
] | [
"def test_it_strips_controller(self):...\n",
"assert controller_name(UserController) == 'user'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assert'"
] |
[
"async def FUNC_5(self) ->List[Server]:...\n",
"\"\"\"docstring\"\"\"\n",
"if self._parsed_uri.scheme != b'matrix':\n",
"return [Server(VAR_1=self._parsed_uri.host, VAR_19=self._parsed_uri.port)]\n",
"VAR_12 = urllib.parse.urlparse(self._parsed_uri.toBytes())\n",
"VAR_1 = VAR_12.hostname\n",
"VAR_19 = V... | [
"async def _resolve_server(self) ->List[Server]:...\n",
"\"\"\"docstring\"\"\"\n",
"if self._parsed_uri.scheme != b'matrix':\n",
"return [Server(host=self._parsed_uri.host, port=self._parsed_uri.port)]\n",
"parsed_uri = urllib.parse.urlparse(self._parsed_uri.toBytes())\n",
"host = parsed_uri.hostname\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@FUNC_0...\n",
"return ReceiptsHandler(self)\n"
] | [
"@cache_in_self...\n",
"return ReceiptsHandler(self)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_37(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_10 = test.test_src_dir_path(VAR_0)\n",
"VAR_42 = os.path.join(test.get_temp_dir(), 'aot_compile_cpu_dir')\n",
"VAR_... | [
"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_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2048,...\n",
"return {'res': VAR_45 + self.var}\n"
] | [
"@def_function.function(input_signature=[tensor_spec.TensorSpec(shape=(2048,...\n",
"return {'res': x + self.var}\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from django.http.response import HttpResponseRedirect\n",
"from shuup.utils.excs import Problem\n",
"from shuup.xtheme.editing import set_edit_mode\n",
"def FUNC_0(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = VAR_0.POST.get('path') or VAR_0.META.get('HTTP_REFERER') or '/'\n",
"if VAR_1 == ... | [
"from django.http.response import HttpResponseRedirect\n",
"from shuup.utils.excs import Problem\n",
"from shuup.xtheme.editing import set_edit_mode\n",
"def handle_command(request, command):...\n",
"\"\"\"docstring\"\"\"\n",
"path = request.POST.get('path') or request.META.get('HTTP_REFERER') or '/'\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Return'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"self.force = bool(self.force)\n"
] | [
"def finalize_options(self):...\n",
"self.force = bool(self.force)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_38(self):...\n",
"VAR_33 = models.Individual.objects.create(name='Subject #1')\n",
"models.Individual.objects.create(name='Child', parent=subject1)\n",
"VAR_29 = models.Individual._meta.get_field('parent').rel\n",
"VAR_27 = widgets.ForeignKeyRawIdWidget(VAR_29, widget_admin_site)\n",
"self.asser... | [
"def test_fk_to_self_model_not_in_admin(self):...\n",
"subject1 = models.Individual.objects.create(name='Subject #1')\n",
"models.Individual.objects.create(name='Child', parent=subject1)\n",
"rel = models.Individual._meta.get_field('parent').rel\n",
"w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(VAR_11):...\n",
"from ..h import find, textContent\n",
"if VAR_11.get('data-lt') == '':\n",
"return []\n",
"if VAR_11.get('data-lt'):\n",
"VAR_33 = VAR_11.get('data-lt')\n",
"if VAR_11.tag in ('dfn', 'a'):\n",
"if VAR_33 in ['|', '||', '|||']:\n",
"VAR_24 = [textContent(VAR_11).strip()]\... | [
"def linkTextsFromElement(el):...\n",
"from ..h import find, textContent\n",
"if el.get('data-lt') == '':\n",
"return []\n",
"if el.get('data-lt'):\n",
"rawText = el.get('data-lt')\n",
"if el.tag in ('dfn', 'a'):\n",
"if rawText in ['|', '||', '|||']:\n",
"texts = [textContent(el).strip()]\n",
"if... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Return'",
"Condition",
"AugAssign'"
] |
[
"def FUNC_16(VAR_0, VAR_1: FlaskClient):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = VAR_1.post('/folders/create', data={'parent_dir': '', 'new_dir':\n 'testing'}, follow_redirects=True)\n",
"assert VAR_8.status_code == 200\n",
"assert request.args.get('path') == 'testing'\n",
"assert 'testing' in get_d... | [
"def test_create_dir(test_app, client: FlaskClient):...\n",
"\"\"\"docstring\"\"\"\n",
"resp = client.post('/folders/create', data={'parent_dir': '', 'new_dir':\n 'testing'}, follow_redirects=True)\n",
"assert resp.status_code == 200\n",
"assert request.args.get('path') == 'testing'\n",
"assert 'testin... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Assert'"
] |
[
"@VAR_2.route('/ajax/deletedomain', methods=['POST'])...\n",
""
] | [
"@admi.route('/ajax/deletedomain', methods=['POST'])...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_37(self, VAR_15):...\n",
"VAR_76 = VAR_53.session['userid'] == VAR_15\n",
"if VAR_53.session['admin'] and not VAR_76:\n",
"VAR_109 = self.userdb.deleteUser(VAR_15)\n",
"return \"You didn't think that would work, did you?\"\n",
"return 'success' if VAR_109 else 'failed'\n"
] | [
"def api_userdelete(self, userid):...\n",
"is_self = cherrypy.session['userid'] == userid\n",
"if cherrypy.session['admin'] and not is_self:\n",
"deleted = self.userdb.deleteUser(userid)\n",
"return \"You didn't think that would work, did you?\"\n",
"return 'success' if deleted else 'failed'\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_84(VAR_72, *VAR_73):...\n",
"def FUNC_86(self, VAR_25, *VAR_0, **VAR_1):...\n",
"FUNC_83(self, VAR_72(self, *VAR_0, **kwargs))\n",
"for VAR_6 in VAR_73:\n",
"FUNC_83(self, VAR_6(self, VAR_25, *VAR_0, **kwargs))\n",
"return self._return_value\n"
] | [
"def compose(fn, *hooks):...\n",
"def runner(self, method, *args, **kwargs):...\n",
"add_to_return_value(self, fn(self, *args, **kwargs))\n",
"for f in hooks:\n",
"add_to_return_value(self, f(self, method, *args, **kwargs))\n",
"return self._return_value\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Expr'",
"For",
"Expr'",
"Return'"
] |
[
"def FUNC_15(self, VAR_23):...\n",
"VAR_66 = type(VAR_23)\n",
"if isinstance(VAR_23, VAR_72):\n",
"VAR_56 = fromstring(VAR_23)\n",
"VAR_56 = copy.deepcopy(VAR_23)\n",
"self(VAR_56)\n",
"return _transform_result(VAR_66, VAR_56)\n"
] | [
"def clean_html(self, html):...\n",
"result_type = type(html)\n",
"if isinstance(html, basestring):\n",
"doc = fromstring(html)\n",
"doc = copy.deepcopy(html)\n",
"self(doc)\n",
"return _transform_result(result_type, doc)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_55(self, VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"return '<em>%s</em>' % VAR_14\n"
] | [
"def emphasis(self, text):...\n",
"\"\"\"docstring\"\"\"\n",
"return '<em>%s</em>' % text\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_147():...\n",
"self.bar = [(VAR_250[0]['name'], False, VAR_250[0]['href'], [])]\n",
"for VAR_305 in VAR_250:\n",
"self.bar[0][3].append((VAR_305['name'], False, VAR_305['href']))\n"
] | [
"def menu():...\n",
"self.bar = [(items[0]['name'], False, items[0]['href'], [])]\n",
"for item in items:\n",
"self.bar[0][3].append((item['name'], False, item['href']))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'"
] |
[
"@classmethod...\n",
"VAR_15.check_file(VAR_4, VAR_16)\n",
"return file_stream.read()\n"
] | [
"@classmethod...\n",
"cls.check_file(file_path, config_name)\n",
"return file_stream.read()\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_15():...\n",
"random.seed(VAR_24)\n",
"return list(map(lambda x: x + VAR_5 * VAR_41, sorted(random.sample(list(\n range(VAR_5)), VAR_40))))\n"
] | [
"def generate_mix_indices():...\n",
"random.seed(seed)\n",
"return list(map(lambda x: x + ITEMS_PER_ITERATION * iteration_count, sorted\n (random.sample(list(range(ITEMS_PER_ITERATION)), mix_per_iteration))))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@VAR_0.route('/api/jobs/<int:job_id>', methods=['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_94 = FUNC_58(f'/internal/jobs/{VAR_9}', 'get')\n",
"return jsonify({'success': False, 'message': str(err)}), 400\n",
"return jsonify(VAR_94)\n"
] | [
"@gui.route('/api/jobs/<int:job_id>', methods=['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"job_info = query_internal_api(f'/internal/jobs/{job_id}', 'get')\n",
"return jsonify({'success': False, 'message': str(err)}), 400\n",
"return jsonify(job_info)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'",
"Return'"
] |
[
"@VAR_0.route('/settings', methods=('GET', 'POST'))...\n",
"return redirect('settings/general')\n"
] | [
"@blueprint.route('/settings', methods=('GET', 'POST'))...\n",
"return redirect('settings/general')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_34(self, VAR_60, VAR_61, VAR_62, VAR_63=False):...\n",
"VAR_89 = self._scheme, VAR_60, VAR_61, None, None, None\n",
"VAR_3 = urllib_parse.urlunparse(VAR_89)\n",
"VAR_102 = {'Content-Type': 'text/xml'}\n",
"VAR_1.critical('HTTP error %s while getting %s', exc.response.status_code,\n VAR_3)\n",
... | [
"def request(self, host, handler, request_body, verbose=False):...\n",
"parts = self._scheme, host, handler, None, None, None\n",
"url = urllib_parse.urlunparse(parts)\n",
"headers = {'Content-Type': 'text/xml'}\n",
"logger.critical('HTTP error %s while getting %s', exc.response.status_code, url\n )\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_41(*VAR_79, **VAR_42):...\n",
"if VAR_79 and len(VAR_79) > 1 and isinstance(VAR_79[1], text_type):\n",
"VAR_46 = FUNC_42(VAR_79[0], VAR_79[1])\n",
"VAR_94 = FUNC_45(*VAR_79, **kwargs)\n",
"VAR_94 = VAR_1.document_cache.get(VAR_46)\n",
"return VAR_94\n",
"if VAR_94:\n",
"return VAR_94\n",
"... | [
"def get_cached_doc(*args, **kwargs):...\n",
"if args and len(args) > 1 and isinstance(args[1], text_type):\n",
"key = get_document_cache_key(args[0], args[1])\n",
"doc = get_doc(*args, **kwargs)\n",
"doc = local.document_cache.get(key)\n",
"return doc\n",
"if doc:\n",
"return doc\n",
"doc = cache()... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_17(self):...\n",
"VAR_5 = self._makeContext()\n",
"self.assertEqual(VAR_5.evaluate('x | string:$one'), '1')\n"
] | [
"def test_hybrid_with_string_expression_and_expansion(self):...\n",
"ec = self._makeContext()\n",
"self.assertEqual(ec.evaluate('x | string:$one'), '1')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/groups/%s/categories/%s', VAR_30, VAR_33)\n",
"return self.client.delete_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'requester_user_id': requester_user_id}, VAR_15=True)\n"
] | [
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/groups/%s/categories/%s', group_id, category_id)\n",
"return self.client.delete_json(destination=destination, path=path, args={\n 'requester_user_id': requester_user_id}, ignore_backoff=True)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"import copy\n",
"import json\n",
"import re\n",
"from datetime import date, datetime, timedelta\n",
"from typing import Dict, List\n",
"from crispy_forms.bootstrap import InlineCheckboxes, InlineRadios, Tab, TabHolder\n",
"from crispy_forms.helper import FormHelper\n",
"from crispy_forms.layout impor... | [
"import copy\n",
"import json\n",
"import re\n",
"from datetime import date, datetime, timedelta\n",
"from typing import Dict, List\n",
"from crispy_forms.bootstrap import InlineCheckboxes, InlineRadios, Tab, TabHolder\n",
"from crispy_forms.helper import FormHelper\n",
"from crispy_forms.layout impor... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Impo... |
[
"@pytest.fixture...\n",
"VAR_3 = tempfile.mkdtemp()\n",
"VAR_4 = os.path.join(VAR_3, '%s.txt' % VAR_0.node.name)\n",
"f.write(VAR_0.node.name)\n",
"return VAR_4\n"
] | [
"@pytest.fixture...\n",
"path = tempfile.mkdtemp()\n",
"file_name = os.path.join(path, '%s.txt' % request.node.name)\n",
"f.write(request.node.name)\n",
"return file_name\n"
] | [
1,
1,
1,
0,
1
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __call__(self):...\n",
""
] | [
"def __call__(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(self):...\n",
"from ...plugins.CookieAuthHelper import CookieAuthHelper\n",
"return CookieAuthHelper\n"
] | [
"def _getTargetClass(self):...\n",
"from ...plugins.CookieAuthHelper import CookieAuthHelper\n",
"return CookieAuthHelper\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Return'"
] |
[
"def FUNC_3(self, *VAR_4, **VAR_5):...\n",
"self.getBaseUrl(VAR_3=True)\n",
"VAR_48 = 0 == self.userdb.getUserCount()\n",
"VAR_49 = self.mainpage\n",
"if 'devel' in VAR_5:\n",
"VAR_49 = readRes('res/devel.html')\n",
"if 'login' in VAR_5:\n",
"self.loginpage = readRes('res/login.html')\n",
"VAR_6 = V... | [
"def index(self, *args, **kwargs):...\n",
"self.getBaseUrl(redirect_unencrypted=True)\n",
"firstrun = 0 == self.userdb.getUserCount()\n",
"show_page = self.mainpage\n",
"if 'devel' in kwargs:\n",
"show_page = readRes('res/devel.html')\n",
"if 'login' in kwargs:\n",
"self.loginpage = readRes('res/login... | [
0,
0,
0,
0,
0,
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'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
... |
[
"def FUNC_5(self):...\n",
"if not getattr(self, 'latest', None):\n",
"self.latest = frappe.get_doc(self.doctype, self.name)\n",
"return self.latest\n"
] | [
"def get_latest(self):...\n",
"if not getattr(self, 'latest', None):\n",
"self.latest = frappe.get_doc(self.doctype, self.name)\n",
"return self.latest\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_5(VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = VAR_11.get_command_obj('build_py')\n",
"VAR_11.package_data = FUNC_2()\n",
"VAR_29.finalize_options()\n"
] | [
"def update_package_data(distribution):...\n",
"\"\"\"docstring\"\"\"\n",
"build_py = distribution.get_command_obj('build_py')\n",
"distribution.package_data = find_package_data()\n",
"build_py.finalize_options()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(VAR_16):...\n",
"return {VAR_22.domain for VAR_22 in self.room_members}\n"
] | [
"def get_joined_hosts_for_room(room_id):...\n",
"return {member.domain for member in self.room_members}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_2):...\n",
"return Static(template('obj', VAR_2=Symbol(obj), mode='eval'))\n"
] | [
"def static(obj):...\n",
"return Static(template('obj', obj=Symbol(obj), mode='eval'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(**VAR_1):...\n",
"VAR_0.clear()\n"
] | [
"def clear_view_cache(**kwargs):...\n",
"_VIEW_CACHE.clear()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@app.route('/login', methods=['GET', 'POST'])...\n",
"VAR_9 = forms.UserForm()\n",
"if VAR_9.validate_on_submit():\n",
"VAR_33 = get_db()\n",
"return render_template('users/login.html', VAR_9=form, title='Login')\n",
"VAR_34 = VAR_33.search((Query().username == VAR_9.username.data) & (Query()\n .type ... | [
"@app.route('/login', methods=['GET', 'POST'])...\n",
"form = forms.UserForm()\n",
"if form.validate_on_submit():\n",
"db = get_db()\n",
"return render_template('users/login.html', form=form, title='Login')\n",
"user = db.search((Query().username == form.username.data) & (Query().type ==\n 'user'))\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_111(VAR_129):...\n",
"from frappe.desk.search import validate_and_sanitize_search_inputs as func\n",
"return func(VAR_129)\n"
] | [
"def validate_and_sanitize_search_inputs(fn):...\n",
"from frappe.desk.search import validate_and_sanitize_search_inputs as func\n",
"return func(fn)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Return'"
] |
[
"import os\n",
"import datetime\n",
"from xml.sax.saxutils import quoteattr\n",
"from flask import Blueprint, url_for, Response, stream_with_context, send_file, jsonify\n",
"from werkzeug.datastructures import Headers\n",
"from opendiamond.dataretriever.util import ATTR_SUFFIX\n",
"VAR_0 = 'collection'\... | [
"import os\n",
"import datetime\n",
"from xml.sax.saxutils import quoteattr\n",
"from flask import Blueprint, url_for, Response, stream_with_context, send_file, jsonify\n",
"from werkzeug.datastructures import Headers\n",
"from opendiamond.dataretriever.util import ATTR_SUFFIX\n",
"BASEURL = 'collection... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"For",
"AugAssign'",
"Expr'",
"Cond... |
[
"def FUNC_30(self):...\n",
"self.login()\n",
"VAR_3 = self.client.post('/password_change/', {'old_password': 'password',\n 'new_password1': 'password1', 'new_password2': 'donuts'})\n",
"self.assertFormError(VAR_3, SetPasswordForm.error_messages['password_mismatch']\n )\n"
] | [
"def test_password_change_fails_with_mismatched_passwords(self):...\n",
"self.login()\n",
"response = self.client.post('/password_change/', {'old_password':\n 'password', 'new_password1': 'password1', 'new_password2': 'donuts'})\n",
"self.assertFormError(response, SetPasswordForm.error_messages[\n 'pass... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"from mock import Mock\n",
"from twisted.internet import defer\n",
"import synapse.types\n",
"from synapse.api.errors import AuthError, SynapseError\n",
"from synapse.types import UserID\n",
"from tests import unittest\n",
"from tests.test_utils import make_awaitable\n",
"from tests.utils import setup... | [
"from mock import Mock\n",
"from twisted.internet import defer\n",
"import synapse.types\n",
"from synapse.api.errors import AuthError, SynapseError\n",
"from synapse.types import UserID\n",
"from tests import unittest\n",
"from tests.test_utils import make_awaitable\n",
"from tests.utils import setup... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
... |
[
"@VAR_7.route('/base/<baseidx>/keywords/<params>')...\n",
"print('Enter Scope')\n",
"sys.stdout.flush()\n",
"VAR_23 = []\n",
"VAR_24, VAR_25 = FUNC_3(VAR_13)\n",
"if VAR_9 != '0':\n",
"VAR_38 = FUNC_11('GIDIDX' + VAR_9.upper())\n",
"VAR_26 = bool(VAR_17 and VAR_23)\n",
"VAR_23 = list(f.readlines())\... | [
"@scope_blueprint.route('/base/<baseidx>/keywords/<params>')...\n",
"print('Enter Scope')\n",
"sys.stdout.flush()\n",
"base_list = []\n",
"seed, percentage = decode_params(params)\n",
"if baseidx != '0':\n",
"base_index = _get_index_absolute_path('GIDIDX' + baseidx.upper())\n",
"make_cocktail = bool(m... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Assign'... |
[
"__author__ = 'Gina Häußge <osd@foosel.net>'\n",
"__license__ = (\n 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html')\n",
"__copyright__ = (\n 'Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License'\n )\n",
"import base64\n",
"import datetime... | [
"__author__ = 'Gina Häußge <osd@foosel.net>'\n",
"__license__ = (\n 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html')\n",
"__copyright__ = (\n 'Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License'\n )\n",
"import base64\n",
"import datetime... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"As... |
[
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_1('/groups/%s/users', VAR_30)\n",
"return self.client.get_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'requester_user_id': requester_user_id}, VAR_15=True)\n"
] | [
"@log_function...\n",
"\"\"\"docstring\"\"\"\n",
"path = _create_v1_path('/groups/%s/users', group_id)\n",
"return self.client.get_json(destination=destination, path=path, args={\n 'requester_user_id': requester_user_id}, ignore_backoff=True)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_25):...\n",
"if callable(getattr(VAR_25, 'as_view', None)):\n",
"VAR_25 = VAR_25.as_view()\n",
"@six.wraps(VAR_25)...\n",
"VAR_38 = self._get_unauth_reason(VAR_20)\n",
"if VAR_38:\n",
"return self._get_unauth_response(VAR_20, VAR_38)\n",
"return VAR_25(VAR_20, *VAR_36, **kwargs)\... | [
"def wrap_with_permissions(self, view_func):...\n",
"if callable(getattr(view_func, 'as_view', None)):\n",
"view_func = view_func.as_view()\n",
"@six.wraps(view_func)...\n",
"unauth_reason = self._get_unauth_reason(request)\n",
"if unauth_reason:\n",
"return self._get_unauth_response(request, unauth_rea... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_40():...\n",
"VAR_90 = util.flask.check_lastmodified(VAR_103)\n",
"VAR_89 = util.flask.check_etag(VAR_104)\n",
"return VAR_90 and VAR_89\n"
] | [
"def check_etag_and_lastmodified():...\n",
"lastmodified_ok = util.flask.check_lastmodified(current_lastmodified)\n",
"etag_ok = util.flask.check_etag(current_etag)\n",
"return lastmodified_ok and etag_ok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6():...\n",
"VAR_26 = mysql.connector.connect(user=DB_USER, password=DB_PASSWORD, host=\n DB_HOST, database=DB_DBNAME, port=DB_PORT)\n",
"VAR_27 = VAR_26.cursor()\n",
"VAR_27.execute(VAR_20, VAR_22)\n",
"yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n",
"if VAR_1:\n",
"yield '<?xml... | [
"def generate():...\n",
"cnx = mysql.connector.connect(user=DB_USER, password=DB_PASSWORD, host=\n DB_HOST, database=DB_DBNAME, port=DB_PORT)\n",
"cursor = cnx.cursor()\n",
"cursor.execute(query, substitutes)\n",
"yield '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'\n",
"if STYLE:\n",
"yield '<?xml... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_34 = VAR_1(VAR_12, 'components', 'bootstrap', 'less', 'print.less')\n",
"VAR_49 = f.readlines()\n",
"for ix, VAR_68 in enumerate(VAR_49):\n",
"if 'Black prints faster' in VAR_68:\n",
"VAR_35 = VAR_49.pop(ix)\n",
"print('Removed line', ix, 'from boo... | [
"def patch_out_bootstrap_bw_print():...\n",
"\"\"\"docstring\"\"\"\n",
"print_less = pjoin(static, 'components', 'bootstrap', 'less', 'print.less')\n",
"lines = f.readlines()\n",
"for ix, line in enumerate(lines):\n",
"if 'Black prints faster' in line:\n",
"rmed = lines.pop(ix)\n",
"print('Removed lin... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.load_from_db()\n"
] | [
"def reload(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.load_from_db()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"if not getattr(self, 'latest', None):\n",
"self.latest = frappe.get_doc(self.doctype, self.name)\n",
"return self.latest\n"
] | [
"def get_latest(self):...\n",
"if not getattr(self, 'latest', None):\n",
"self.latest = frappe.get_doc(self.doctype, self.name)\n",
"return self.latest\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_32(VAR_62, VAR_10=None, VAR_92=False):...\n",
"if VAR_92:\n",
"return False\n",
"if not VAR_10:\n",
"VAR_10 = VAR_1.session.user\n",
"import frappe.permissions\n",
"VAR_183 = frappe.permissions.get_role_permissions(VAR_62, VAR_10=user)\n",
"if VAR_183.get('select') and not VAR_183.get('read'... | [
"def only_has_select_perm(doctype, user=None, ignore_permissions=False):...\n",
"if ignore_permissions:\n",
"return False\n",
"if not user:\n",
"user = local.session.user\n",
"import frappe.permissions\n",
"permissions = frappe.permissions.get_role_permissions(doctype, user=user)\n",
"if permissions.g... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Import'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, *VAR_2):...\n",
"super().__init__(*VAR_2)\n",
"self.user_consent_version = None\n",
"self.user_consent_template_dir = None\n",
"self.user_consent_server_notice_content = None\n",
"self.user_consent_server_notice_to_guests = False\n",
"self.block_events_without_consent_error = None\n"... | [
"def __init__(self, *args):...\n",
"super().__init__(*args)\n",
"self.user_consent_version = None\n",
"self.user_consent_template_dir = None\n",
"self.user_consent_server_notice_content = None\n",
"self.user_consent_server_notice_to_guests = False\n",
"self.block_events_without_consent_error = None\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_12(self, VAR_12):...\n",
"if not self.isAuthorized():\n",
"VAR_11 = [VAR_69 for VAR_69 in json.loads(unquote(VAR_12))]\n",
"VAR_61 = self.download_check_files(VAR_11)\n",
"if VAR_61 == 'ok':\n",
"FUNC_0()\n",
"return VAR_61\n",
"VAR_82 = 'application/x-zip-compressed'\n",
"VAR_53.response.... | [
"def download(self, value):...\n",
"if not self.isAuthorized():\n",
"filelist = [filepath for filepath in json.loads(unquote(value))]\n",
"dlstatus = self.download_check_files(filelist)\n",
"if dlstatus == 'ok':\n",
"_save_and_release_session()\n",
"return dlstatus\n",
"zipmime = 'application/x-zip-co... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.