lines
listlengths
1
383
raw_lines
listlengths
1
383
label
listlengths
1
383
type
listlengths
1
383
[ "@VAR_0.route('/bGVhdmVfcmlnaHRfbm93', methods=['POST'])...\n", "if not request.json or 'image' not in request.json:\n", "print('No data sent or no image provided. Aborting with 400.')\n", "VAR_13 = request.json['image']\n", "abort(400)\n", "VAR_14 = base64.b64decode(VAR_13.encode('utf-8'))\n", "VAR_14,...
[ "@app.route('/bGVhdmVfcmlnaHRfbm93', methods=['POST'])...\n", "if not request.json or 'image' not in request.json:\n", "print('No data sent or no image provided. Aborting with 400.')\n", "im_b64 = request.json['image']\n", "abort(400)\n", "img_bytes = base64.b64decode(im_b64.encode('utf-8'))\n", "img_by...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Condition", ...
[ "\"\"\"string\"\"\"\n", "import base64\n", "from functools import reduce\n", "from gluon._compat import pickle, thread, urllib2, Cookie, StringIO, urlencode\n", "from gluon._compat import configparser, MIMEBase, MIMEMultipart, MIMEText, Header\n", "from gluon._compat import Encoders, Charset, long, urllib...
[ "\"\"\"\n| This file is part of the web2py Web Framework\n| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\n| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\nAuth, Mail, PluginManager and various utilities\n------------------------------------------------\n\"\"\"\n", "import base64\n", "f...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Imp...
[ "def FUNC_60(self):...\n", "\"\"\"docstring\"\"\"\n", "return self._blitzcon.getUserId()\n" ]
[ "def getId(self):...\n", "\"\"\"docstring\"\"\"\n", "return self._blitzcon.getUserId()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "@pytest.fixture...\n", "VAR_3 = tempfile.mkdtemp()\n", "VAR_4 = os.path.join(VAR_3, 'yet_another_%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, 'yet_another_%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'" ]
[ "async def FUNC_12(self, VAR_23: str, VAR_16: Optional[QueryParams]=None,...\n", "\"\"\"docstring\"\"\"\n", "if VAR_16:\n", "VAR_39 = urllib.parse.urlencode(VAR_16, True)\n", "VAR_46 = {b'User-Agent': [self.user_agent]}\n", "VAR_23 = '%s?%s' % (VAR_23, VAR_39)\n", "if VAR_24:\n", "VAR_46.update(VAR_24...
[ "async def get_raw(self, uri: str, args: Optional[QueryParams]=None, headers:...\n", "\"\"\"docstring\"\"\"\n", "if args:\n", "query_str = urllib.parse.urlencode(args, True)\n", "actual_headers = {b'User-Agent': [self.user_agent]}\n", "uri = '%s?%s' % (uri, query_str)\n", "if headers:\n", "actual_head...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def __call__(self, VAR_9):...\n", "if not re.compile('^\\\\w+$').match(VAR_9):\n", "return VAR_9, T('Invalid application name')\n", "if not request.vars.overwrite and os.path.exists(os.path.join(apath(VAR_122\n", "return VAR_9, T('Application exists already')\n", "return VAR_9, None\n" ]
[ "def __call__(self, value):...\n", "if not re.compile('^\\\\w+$').match(value):\n", "return value, T('Invalid application name')\n", "if not request.vars.overwrite and os.path.exists(os.path.join(apath(r=\n", "return value, T('Application exists already')\n", "return value, None\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = VAR_2.session['connector'].server_id\n", "VAR_136 = {}\n", "VAR_1.debug(traceback.format_exc())\n", "VAR_136['format'] = 'video/' + VAR_2.GET.get('format', 'quicktime')\n", "VAR_136['fps'] = int(VAR_2.GET.get('fps', 4))\n", "VAR_136['minsi...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "server_id = request.session['connector'].server_id\n", "opts = {}\n", "logger.debug(traceback.format_exc())\n", "opts['format'] = 'video/' + request.GET.get('format', 'quicktime')\n", "opts['fps'] = int(request.GET.get('fps', 4))\n", "opts['minsize...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Condition", "Return'", "Condition", "Expr'", "Expr'", "Expr'", "Condition", "Assign'", "A...
[ "def FUNC_18(self, VAR_81):...\n", "VAR_84 = to_bytes(self.secret_key)\n", "if self.salt:\n", "if callable(self.salt):\n", "VAR_235 = self.cached_b64h\n", "VAR_84 = '%s$%s' % (VAR_84, self.salt(VAR_81))\n", "VAR_84 = '%s$%s' % (VAR_84, self.salt)\n", "VAR_236 = self.jwt_b64e(serializers.json(VAR_81))\...
[ "def generate_token(self, payload):...\n", "secret = to_bytes(self.secret_key)\n", "if self.salt:\n", "if callable(self.salt):\n", "b64h = self.cached_b64h\n", "secret = '%s$%s' % (secret, self.salt(payload))\n", "secret = '%s$%s' % (secret, self.salt)\n", "b64p = self.jwt_b64e(serializers.json(payloa...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_11(self):...\n", "VAR_25 = 'inputs=[{\"text\":[\"foo\"], \"bytes\":[b\"bar\"]}]'\n", "VAR_23 = saved_model_cli.preprocess_input_examples_arg_string(VAR_25)\n", "VAR_26 = example_pb2.Example.FromString(VAR_23['inputs'][0])\n", "self.assertProtoEquals('string', VAR_26)\n" ]
[ "def testInputPreProcessExamplesWithStrAndBytes(self):...\n", "input_examples_str = 'inputs=[{\"text\":[\"foo\"], \"bytes\":[b\"bar\"]}]'\n", "input_dict = saved_model_cli.preprocess_input_examples_arg_string(\n input_examples_str)\n", "feature = example_pb2.Example.FromString(input_dict['inputs'][0])\n", ...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@login_required(doConnectionCleanup=False)...\n", "\"\"\"docstring\"\"\"\n", "VAR_150 = []\n", "VAR_151 = []\n", "VAR_150 = VAR_2.GET.getlist('image')\n", "VAR_151 = VAR_2.GET.getlist('well')\n", "if VAR_6 is None:\n", "if len(VAR_150) == 0 and len(VAR_151) == 0:\n", "VAR_150 = [VAR_6]\n", "retur...
[ "@login_required(doConnectionCleanup=False)...\n", "\"\"\"docstring\"\"\"\n", "imgIds = []\n", "wellIds = []\n", "imgIds = request.GET.getlist('image')\n", "wellIds = request.GET.getlist('well')\n", "if iid is None:\n", "if len(imgIds) == 0 and len(wellIds) == 0:\n", "imgIds = [iid]\n", "return Ht...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "For", "For", "Expr'", "Condition", ...
[ "def FUNC_13(self):...\n", "VAR_62 = self.useroptions.forUser(self.getUserId())\n", "VAR_63 = VAR_62.getChangableOptions()\n", "if VAR_53.session['admin']:\n", "VAR_63['media'].update({'may_download': True})\n", "VAR_63['media'].update({'may_download': VAR_62.getOptionValue(\n 'media.may_download')})\n...
[ "def api_getuseroptions(self):...\n", "uo = self.useroptions.forUser(self.getUserId())\n", "uco = uo.getChangableOptions()\n", "if cherrypy.session['admin']:\n", "uco['media'].update({'may_download': True})\n", "uco['media'].update({'may_download': uo.getOptionValue('media.may_download')})\n", "return u...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_14(self):...\n", "VAR_5 = self.get_counts('json', period='this-month')\n", "self.assertEqual(VAR_5.status_code, 200)\n", "self.assertJSONEqual(VAR_5.content.decode(), VAR_0)\n" ]
[ "def test_counts_view_this_month(self):...\n", "response = self.get_counts('json', period='this-month')\n", "self.assertEqual(response.status_code, 200)\n", "self.assertJSONEqual(response.content.decode(), COUNTS_DATA)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_32(self):...\n", "VAR_74 = VAR_53.session.get('playlist', [])\n", "return VAR_74\n" ]
[ "def api_restoreplaylist(self):...\n", "session_playlist = cherrypy.session.get('playlist', [])\n", "return session_playlist\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "if VAR_33:\n", "VAR_2 = FUNC_1('/groups/%s/summary/categories/%s/rooms/%s', VAR_30, VAR_33,\n VAR_6)\n", "VAR_2 = FUNC_1('/groups/%s/summary/rooms/%s', VAR_30, VAR_6)\n", "return self.client.post_json(VAR_5=destination, VAR_2=path, VAR_3={\n 'request...
[ "@log_function...\n", "\"\"\"docstring\"\"\"\n", "if category_id:\n", "path = _create_v1_path('/groups/%s/summary/categories/%s/rooms/%s',\n group_id, category_id, room_id)\n", "path = _create_v1_path('/groups/%s/summary/rooms/%s', group_id, room_id)\n", "return self.client.post_json(destination=destin...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_39(self):...\n", "if not test.is_built_with_xla():\n", "self.skipTest('Skipping test because XLA is not compiled in.')\n", "VAR_6 = 'all'\n", "VAR_7 = 'func2'\n", "VAR_14 = os.path.join(test.get_temp_dir(), 'dummy_model')\n", "VAR_15 = self.AOTCompileDummyModel()\n", "VAR_7 = getattr(VAR_15,...
[ "def testFreezeModel(self):...\n", "if not test.is_built_with_xla():\n", "self.skipTest('Skipping test because XLA is not compiled in.')\n", "variables_to_feed = 'all'\n", "func = 'func2'\n", "saved_model_dir = os.path.join(test.get_temp_dir(), 'dummy_model')\n", "dummy_model = self.AOTCompileDummyModel...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_87():...\n", "VAR_364 = ','.join(VAR_301.get('columns'))\n", "yield VAR_364\n", "for rows in VAR_301.get('lazy_rows'):\n", "yield '\\n' + '\\n'.join([','.join([VAR_345(VAR_362) for VAR_362 in VAR_378]) for\n VAR_378 in rows])\n" ]
[ "def csv_gen():...\n", "csv_cols = ','.join(table_data.get('columns'))\n", "yield csv_cols\n", "for rows in table_data.get('lazy_rows'):\n", "yield '\\n' + '\\n'.join([','.join([str(d) for d in row]) for row in rows])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "For", "Expr'" ]
[ "@pytest.mark.linux...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = ['--temp-basedir'] + FUNC_0(VAR_4.config)\n", "VAR_6.start(VAR_11, VAR_16={'LC_ALL': 'C'})\n", "VAR_6.set_setting('url.auto_search', 'never')\n", "VAR_6.send_cmd(':open {}'.format(VAR_7))\n", "if not VAR_4.config.webengine:\n", "VAR_18 = ...
[ "@pytest.mark.linux...\n", "\"\"\"docstring\"\"\"\n", "args = ['--temp-basedir'] + _base_args(request.config)\n", "quteproc_new.start(args, env={'LC_ALL': 'C'})\n", "quteproc_new.set_setting('url.auto_search', 'never')\n", "quteproc_new.send_cmd(':open {}'.format(url))\n", "if not request.config.webengi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_74(self, VAR_2, VAR_176=None, VAR_177=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_176 is None and VAR_177 is not None:\n", "VAR_303 = []\n", "if VAR_176 is None:\n", "for VAR_33 in VAR_177:\n", "VAR_176 = 'Login failed. Reason unknown.'\n", "return JsonResponse({'message': VAR_176}, VAR...
[ "def handle_not_logged_in(self, request, error=None, form=None):...\n", "\"\"\"docstring\"\"\"\n", "if error is None and form is not None:\n", "formErrors = []\n", "if error is None:\n", "for field in form:\n", "error = 'Login failed. Reason unknown.'\n", "return JsonResponse({'message': error}, statu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "For", "Assign'", "Return'", "For", "Assign'", "Expr'" ]
[ "def FUNC_5(VAR_4, VAR_13, VAR_3):...\n", "if '%(key)s' in VAR_4:\n", "VAR_4 = VAR_4.replace('%(key)s', VAR_13)\n", "if '%s' in VAR_4:\n", "VAR_4 = VAR_4.replace('%s', (VAR_3 or '') + '%')\n", "return VAR_4\n" ]
[ "def scrub_custom_query(query, key, txt):...\n", "if '%(key)s' in query:\n", "query = query.replace('%(key)s', key)\n", "if '%s' in query:\n", "query = query.replace('%s', (txt or '') + '%')\n", "return query\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_9(self):...\n", "VAR_5 = self.get_credits('rst')\n", "self.assertEqual(VAR_5.status_code, 200)\n", "self.assertEqual(VAR_5.content.decode(),\n \"\"\"\n\n* Czech\n\n * Weblate Test <weblate@example.org> (1)\n\n\"\"\")\n" ]
[ "def test_credits_view_rst(self):...\n", "response = self.get_credits('rst')\n", "self.assertEqual(response.status_code, 200)\n", "self.assertEqual(response.content.decode(),\n \"\"\"\n\n* Czech\n\n * Weblate Test <weblate@example.org> (1)\n\n\"\"\")\n" ]
[ 0, 0, 0, 2 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_19(self):...\n", "VAR_5 = self._makeContext()\n", "VAR_5.beginScope()\n", "VAR_5.setRepeat('loop', 'python:[1,2,3]')\n", "self.assertTrue(VAR_5.evaluate(\"python:repeat['loop'].odd()\"))\n", "VAR_5.endScope()\n" ]
[ "def test_access_iterator_from_python_expression(self):...\n", "ec = self._makeContext()\n", "ec.beginScope()\n", "ec.setRepeat('loop', 'python:[1,2,3]')\n", "self.assertTrue(ec.evaluate(\"python:repeat['loop'].odd()\"))\n", "ec.endScope()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "\"\"\"A tornado based Jupyter notebook server.\"\"\"\n", "from __future__ import absolute_import, print_function\n", "import base64\n", "import datetime\n", "import errno\n", "import importlib\n", "import io\n", "import json\n", "import logging\n", "import os\n", "import random\n", "import re...
[ "\"\"\"A tornado based Jupyter notebook server.\"\"\"\n", "from __future__ import absolute_import, print_function\n", "import base64\n", "import datetime\n", "import errno\n", "import importlib\n", "import io\n", "import json\n", "import logging\n", "import os\n", "import random\n", "import re...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "Import'"...
[ "def FUNC_5(self) ->Sequence[GeneratorError]:...\n", "\"\"\"docstring\"\"\"\n", "if not self.package_dir.is_dir():\n", "print(f'Updating {self.project_name}')\n", "shutil.rmtree(self.package_dir)\n", "self._create_package()\n", "self._build_models()\n", "self._build_api()\n", "self._reformat()\n", ...
[ "def update(self) ->Sequence[GeneratorError]:...\n", "\"\"\"docstring\"\"\"\n", "if not self.package_dir.is_dir():\n", "print(f'Updating {self.project_name}')\n", "shutil.rmtree(self.package_dir)\n", "self._create_package()\n", "self._build_models()\n", "self._build_api()\n", "self._reformat()\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_81(VAR_19):...\n", "if self.parentfield:\n", "return '{} {} #{}: {} {}'.format(frappe.bold(_(self.doctype)), _('Row'),\n self.idx, _('Value cannot be negative for'), frappe.bold(_(VAR_19.label)))\n", "return _('Value cannot be negative for {0}: {1}').format(_(VAR_19.parent),\n frappe.bold(_(VA...
[ "def get_msg(df):...\n", "if self.parentfield:\n", "return '{} {} #{}: {} {}'.format(frappe.bold(_(self.doctype)), _('Row'),\n self.idx, _('Value cannot be negative for'), frappe.bold(_(df.label)))\n", "return _('Value cannot be negative for {0}: {1}').format(_(df.parent),\n frappe.bold(_(df.label)))\n"...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_14(self, VAR_18, VAR_19=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_48 = []\n", "if not VAR_19:\n", "VAR_19 = self.meta.get_field(VAR_18)\n", "for VAR_21 in self.get(VAR_19.fieldname):\n", "VAR_21.db_update()\n", "if VAR_19.options in (self.flags.ignore_children_type or []):\n", "VAR_48....
[ "def update_child_table(self, fieldname, df=None):...\n", "\"\"\"docstring\"\"\"\n", "rows = []\n", "if not df:\n", "df = self.meta.get_field(fieldname)\n", "for d in self.get(df.fieldname):\n", "d.db_update()\n", "if df.options in (self.flags.ignore_children_type or []):\n", "rows.append(d.name)\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "For", "Expr'", "Condition", "Expr'", "Return'", "Condition", "Assign'", "Expr'", "Condition", "Expr'" ]
[ "import json\n", "import os\n", "import sqlite3\n", "from flask import Flask, render_template, redirect, g, request, url_for, Response\n", "from sqlalchemy import desc, func\n", "from sqlalchemy.exc import IntegrityError\n", "import yaml\n", "from . import worker, output\n", "from .connections impor...
[ "import json\n", "import os\n", "import sqlite3\n", "from flask import Flask, render_template, redirect, g, request, url_for, Response\n", "from sqlalchemy import desc, func\n", "from sqlalchemy.exc import IntegrityError\n", "import yaml\n", "from . import worker, output\n", "from .connections 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 ]
[ "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFr...
[ "@VAR_25.whitelist()...\n", "VAR_15 = None\n", "if VAR_25.form_dict.get('from_form'):\n", "VAR_25.errprint(VAR_25.utils.get_traceback())\n", "return VAR_15\n", "if VAR_25.form_dict.get('method'):\n", "VAR_15 = VAR_25.get_doc({'doctype': 'File', 'attached_to_name': VAR_25.\n form_dict.docname, 'attach...
[ "@frappe.whitelist()...\n", "ret = None\n", "if frappe.form_dict.get('from_form'):\n", "frappe.errprint(frappe.utils.get_traceback())\n", "return ret\n", "if frappe.form_dict.get('method'):\n", "ret = frappe.get_doc({'doctype': 'File', 'attached_to_name': frappe.\n form_dict.docname, 'attached_to_doc...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "For", "Expr'", "Return'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_47(self):...\n", "VAR_157 = StringIO(self.list_values)\n", "VAR_158 = [[item.strip(), item.strip()] for item in VAR_157.readlines()]\n", "VAR_157.close()\n", "return VAR_158\n" ]
[ "def _choices_as_array(self):...\n", "valuebuffer = StringIO(self.list_values)\n", "choices = [[item.strip(), item.strip()] for item in valuebuffer.readlines()]\n", "valuebuffer.close()\n", "return choices\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_8(self):...\n", "VAR_5 = {'not_types': ['m.room.message', 'org.matrix.foo.bar']}\n", "VAR_6 = FUNC_0(sender='@foo:bar', type='m.room.message', room_id='!foo:bar')\n", "self.assertFalse(Filter(VAR_5).check(VAR_6))\n" ]
[ "def test_definition_not_types_works_with_literals(self):...\n", "definition = {'not_types': ['m.room.message', 'org.matrix.foo.bar']}\n", "event = MockEvent(sender='@foo:bar', type='m.room.message', room_id='!foo:bar')\n", "self.assertFalse(Filter(definition).check(event))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_8(self):...\n", "VAR_15 = self._makeOne()\n", "VAR_16 = CLASS_1()\n", "VAR_17 = FauxRequest(RESPONSE=response)\n", "self.assertEqual(VAR_15.extractCredentials(VAR_17), {})\n" ]
[ "def test_extractCredentials_no_creds(self):...\n", "helper = self._makeOne()\n", "response = FauxCookieResponse()\n", "request = FauxRequest(RESPONSE=response)\n", "self.assertEqual(helper.extractCredentials(request), {})\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_15(self):...\n", "return getattr(self, '_doc_before_save', None)\n" ]
[ "def get_doc_before_save(self):...\n", "return getattr(self, '_doc_before_save', None)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(VAR_8: Iterable[T]) ->List[VAR_1]:...\n", "VAR_33 = set()\n", "VAR_34 = []\n", "for item in VAR_8:\n", "if item not in VAR_33:\n", "return VAR_34\n", "VAR_33.add(item)\n", "VAR_34.append(item)\n" ]
[ "def deduped_ordered_list(it: Iterable[T]) ->List[T]:...\n", "seen = set()\n", "ret = []\n", "for item in it:\n", "if item not in seen:\n", "return ret\n", "seen.add(item)\n", "ret.append(item)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Condition", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_40(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_93 = self.log.info\n", "VAR_93('interrupted')\n", "print(self.notebook_info())\n", "sys.stdout.write('Shutdown this notebook server (y/[n])? ')\n", "sys.stdout.flush()\n", "VAR_94, VAR_95, VAR_96 = select.select([sys.stdin], [], [], 5)\n", "...
[ "def _confirm_exit(self):...\n", "\"\"\"docstring\"\"\"\n", "info = self.log.info\n", "info('interrupted')\n", "print(self.notebook_info())\n", "sys.stdout.write('Shutdown this notebook server (y/[n])? ')\n", "sys.stdout.flush()\n", "r, w, x = select.select([sys.stdin], [], [], 5)\n", "if r:\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_22(VAR_9, VAR_5, VAR_10):...\n", "VAR_13 = calibre_db.session.query(db.Series).filter(db.Series.id == VAR_5\n ).first()\n", "if VAR_13:\n", "VAR_63, VAR_68, VAR_65 = calibre_db.fill_indexpage(VAR_9, 0, db.Books, db.\n Books.series.any(db.Series.id == VAR_5), [VAR_10[0]])\n", "abort(404)\n", ...
[ "def render_series_books(page, book_id, order):...\n", "name = calibre_db.session.query(db.Series).filter(db.Series.id == book_id\n ).first()\n", "if name:\n", "entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books,\n db.Books.series.any(db.Series.id == book_id), [order[0]])\n", "a...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(self, VAR_5, VAR_9, VAR_6):...\n", "VAR_13 = settings.PING_INTERVAL\n", "if VAR_13 > 0:\n", "VAR_9['ping_interval'] = VAR_13\n", "VAR_14 = settings.TOP_LINKS\n", "VAR_15 = []\n", "for tl in VAR_14:\n", "if len(tl) < 2:\n", "VAR_9['ome']['top_links'] = VAR_15\n", "VAR_21 = {}\n", "if ...
[ "def load_settings(self, request, context, conn):...\n", "ping_interval = settings.PING_INTERVAL\n", "if ping_interval > 0:\n", "context['ping_interval'] = ping_interval\n", "top_links = settings.TOP_LINKS\n", "links = []\n", "for tl in top_links:\n", "if len(tl) < 2:\n", "context['ome']['top_links'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'...
[ "def FUNC_35():...\n", "return FUNC_0(VAR_6=request.url_root, VAR_7=additional_unless)\n" ]
[ "def unless():...\n", "return _preemptive_unless(base_url=request.url_root, additional_unless=\n additional_unless)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "async def FUNC_8(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'https://{self.hostname}/{self.namespace}/tree/{self.resolved_ref}'\n" ]
[ "async def get_resolved_ref_url(self):...\n", "if not hasattr(self, 'resolved_ref'):\n", "self.resolved_ref = await self.get_resolved_ref()\n", "return f'https://{self.hostname}/{self.namespace}/tree/{self.resolved_ref}'\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_120():...\n", "VAR_214 = VAR_1.db.get_value('DocType', VAR_62, 'module')\n", "return VAR_1.module_app[FUNC_56(VAR_214)]\n" ]
[ "def _get_doctype_app():...\n", "doctype_module = local.db.get_value('DocType', doctype, 'module')\n", "return local.module_app[scrub(doctype_module)]\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@VAR_2.route('/admin/view')...\n", "VAR_34 = updater_thread.get_current_version_info()\n", "if VAR_34 is False:\n", "VAR_98 = _(u'Unknown')\n", "if 'datetime' in VAR_34:\n", "VAR_35 = ub.session.query(ub.User).all()\n", "VAR_98 = VAR_34['datetime']\n", "VAR_98 = VAR_34['version']\n", "VAR_36 = conf...
[ "@admi.route('/admin/view')...\n", "version = updater_thread.get_current_version_info()\n", "if version is False:\n", "commit = _(u'Unknown')\n", "if 'datetime' in version:\n", "allUser = ub.session.query(ub.User).all()\n", "commit = version['datetime']\n", "commit = version['version']\n", "email_se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Condition", "Condition", "Assign'", "AugAssign'", "Condition", "AugAssign'" ]
[ "def FUNC_7(self):...\n", "self.assert_expected(self.folder.laf, 'TeeShopLAF.html')\n" ]
[ "def test_1(self):...\n", "self.assert_expected(self.folder.laf, 'TeeShopLAF.html')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def __str__(self):...\n", "return 'Preferences for %s' % self.user\n" ]
[ "def __str__(self):...\n", "return 'Preferences for %s' % self.user\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_161():...\n", "return URL.verify(VAR_263.request, user_signature=True, VAR_151=hash_vars,\n VAR_152=True)\n" ]
[ "def verify():...\n", "return URL.verify(current.request, user_signature=True, hash_vars=hash_vars,\n hash_extension=True)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/note_attachment/<filename>')...\n", "\"\"\"docstring\"\"\"\n", "VAR_32 = os.path.join(PATH_NOTE_ATTACHMENTS, VAR_3)\n", "if VAR_32 is not None:\n", "return send_file(VAR_32, as_attachment=True)\n", "VAR_1.exception('Send note attachment')\n" ]
[ "@blueprint.route('/note_attachment/<filename>')...\n", "\"\"\"docstring\"\"\"\n", "file_path = os.path.join(PATH_NOTE_ATTACHMENTS, filename)\n", "if file_path is not None:\n", "return send_file(file_path, as_attachment=True)\n", "logger.exception('Send note attachment')\n" ]
[ 0, 0, 0, 0, 1, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Return'", "Expr'" ]
[ "def FUNC_30(self):...\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(), 'new_dir')\n", "VAR_10 = self.parser.parse_args(['run', '--dir', VAR_9, '--tag_set',\n 'serve', '--signature_def', 'regress_x_to_y', '--inpu...
[ "def testRunCommandInputExamplesFeatureBadType(self):...\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.get_temp_dir(), 'new_dir')\n", "args = self.parser.parse_args(['run', '--dir', base_path, '--tag_set',\n ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_0, VAR_1, VAR_3):...\n", "self.handler = VAR_3.get_directory_handler()\n", "self.admin_user = self.register_user('admin', 'pass', admin=True)\n", "self.admin_user_tok = self.login('admin', 'pass')\n", "self.room_id = self.helper.create_room_as(self.admin_user, tok=self.\n admin_user...
[ "def prepare(self, reactor, clock, hs):...\n", "self.handler = hs.get_directory_handler()\n", "self.admin_user = self.register_user('admin', 'pass', admin=True)\n", "self.admin_user_tok = self.login('admin', 'pass')\n", "self.room_id = self.helper.create_room_as(self.admin_user, tok=self.\n admin_user_to...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_22(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertEqual(VAR_5.evaluate('path:'), None)\n" ]
[ "def test_empty_path_expression_explicit(self):...\n", "ec = self._makeContext()\n", "self.assertEqual(ec.evaluate('path:'), None)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_0, VAR_1, VAR_3):...\n", "VAR_17 = {}\n", "VAR_17['alias_creation_rules'] = [{'user_id': '*', 'alias': '#unofficial_*',\n 'action': 'allow'}]\n", "VAR_17['room_list_publication_rules'] = []\n", "VAR_18 = RoomDirectoryConfig()\n", "VAR_18.read_config(VAR_17)\n", "self.hs.config.i...
[ "def prepare(self, reactor, clock, hs):...\n", "config = {}\n", "config['alias_creation_rules'] = [{'user_id': '*', 'alias': '#unofficial_*',\n 'action': 'allow'}]\n", "config['room_list_publication_rules'] = []\n", "rd_config = RoomDirectoryConfig()\n", "rd_config.read_config(config)\n", "self.hs.co...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_28(self, VAR_5, VAR_30, VAR_31, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = FUNC_1('/groups/%s/room/%s', VAR_30, VAR_6)\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" ]
[ "def remove_room_from_group(self, destination, group_id, requester_user_id,...\n", "\"\"\"docstring\"\"\"\n", "path = _create_v1_path('/groups/%s/room/%s', group_id, room_id)\n", "return self.client.delete_json(destination=destination, path=path, args={\n 'requester_user_id': requester_user_id}, ignore_bac...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_5(VAR_0, VAR_1):...\n", "return FUNC_0(VAR_0=request, VAR_1=pk, VAR_2='is_pinned', VAR_3=True, VAR_4\n =Comment.PINNED, VAR_5=_('The topic has been pinned'))\n" ]
[ "def pin(request, pk):...\n", "return _moderate(request=request, pk=pk, field_name='is_pinned', to_value=\n True, action=Comment.PINNED, message=_('The topic has been pinned'))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_2.route('/admin/logfile')...\n", "VAR_89 = {(0): logger.get_logfile(config.config_logfile), (1): logger.\n get_accesslogfile(config.config_access_logfile)}\n", "return render_title_template('logviewer.html', title=_(u'Logfile viewer'),\n accesslog_enable=config.config_access_log, log_enable=bool(con...
[ "@admi.route('/admin/logfile')...\n", "logfiles = {(0): logger.get_logfile(config.config_logfile), (1): logger.\n get_accesslogfile(config.config_access_logfile)}\n", "return render_title_template('logviewer.html', title=_(u'Logfile viewer'),\n accesslog_enable=config.config_access_log, log_enable=bool(co...
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Return'" ]
[ "async def FUNC_5(self):...\n", "VAR_33 = AsyncHTTPClient()\n", "VAR_34 = HTTPRequest('https://doi.org/{}'.format(self.spec), user_agent=\n 'BinderHub')\n", "VAR_35 = await VAR_33.fetch(VAR_34)\n", "VAR_37 = self.url_regex.match(VAR_35.effective_url)\n", "VAR_38 = VAR_37.groups()[3]\n", "VAR_39 = VAR...
[ "async def get_resolved_ref(self):...\n", "client = AsyncHTTPClient()\n", "req = HTTPRequest('https://doi.org/{}'.format(self.spec), user_agent=\n 'BinderHub')\n", "r = await client.fetch(req)\n", "match = self.url_regex.match(r.effective_url)\n", "article_id = match.groups()[3]\n", "article_version ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "@FUNC_0...\n", "if self.config.worker_app:\n", "return GroupsServerWorkerHandler(self)\n", "return GroupsServerHandler(self)\n" ]
[ "@cache_in_self...\n", "if self.config.worker_app:\n", "return GroupsServerWorkerHandler(self)\n", "return GroupsServerHandler(self)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "@ratelimit(field='email', rate='5/5m')...\n", "if VAR_7.user.is_authenticated:\n", "return redirect(VAR_7.GET.get('next', reverse('spirit:user:update')))\n", "VAR_17 = ResendActivationForm(data=post_data(request))\n", "if is_post(VAR_7):\n", "if not VAR_7.is_limited() and VAR_17.is_valid():\n", "return...
[ "@ratelimit(field='email', rate='5/5m')...\n", "if request.user.is_authenticated:\n", "return redirect(request.GET.get('next', reverse('spirit:user:update')))\n", "form = ResendActivationForm(data=post_data(request))\n", "if is_post(request):\n", "if not request.is_limited() and form.is_valid():\n", "re...
[ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "import ast\n", "import base64\n", "import io\n", "import logging\n", "import random\n", "from html import escape\n", "from os import remove\n", "import magic\n", "from flask import Flask, abort, request\n", "from PIL import Image\n", "VAR_0 = Flask(__name__)\n", "VAR_0.logger.setLevel(logging...
[ "import ast\n", "import base64\n", "import io\n", "import logging\n", "import random\n", "from html import escape\n", "from os import remove\n", "import magic\n", "from flask import Flask, abort, request\n", "from PIL import Image\n", "app = Flask(__name__)\n", "app.logger.setLevel(logging.DEB...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6():...\n", "yield '<!-- CLICK_WEB START HEADER -->'\n", "yield '<div class=\"command-line\">Executing: {}</div>'.format('/'.join(VAR_4))\n", "yield '<!-- CLICK_WEB END HEADER -->'\n" ]
[ "def generate():...\n", "yield '<!-- CLICK_WEB START HEADER -->'\n", "yield '<div class=\"command-line\">Executing: {}</div>'.format('/'.join(commands)\n )\n", "yield '<!-- CLICK_WEB END HEADER -->'\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_5, VAR_4, *VAR_6, **VAR_7):...\n", "super().__init__(VAR_5, VAR_4, *VAR_6, **kwargs)\n", "self.fields['target'].widget.attrs['tabindex'] = 101\n", "self.fields['target'].widget.profile = VAR_4.profile\n", "self.fields['target'].initial = Unit(VAR_5=translation, id_hash=0)\n" ]
[ "def __init__(self, translation, user, *args, **kwargs):...\n", "super().__init__(translation, user, *args, **kwargs)\n", "self.fields['target'].widget.attrs['tabindex'] = 101\n", "self.fields['target'].widget.profile = user.profile\n", "self.fields['target'].initial = Unit(translation=translation, id_hash=...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_12(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 get(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'" ]
[ "@FUNC_0...\n", "return TransportLayerClient(self)\n" ]
[ "@cache_in_self...\n", "return TransportLayerClient(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_19(VAR_23, VAR_16):...\n", "VAR_40 = False\n", "if VAR_23:\n", "VAR_23 = clean_html(VAR_23)\n", "if len(VAR_16.comments):\n", "if VAR_16.comments[0].text != VAR_23:\n", "if VAR_23:\n", "VAR_16.comments[0].text = VAR_23\n", "return VAR_40\n", "VAR_16.comments.append(db.Comments(text=comme...
[ "def edit_book_comments(comments, book):...\n", "modif_date = False\n", "if comments:\n", "comments = clean_html(comments)\n", "if len(book.comments):\n", "if book.comments[0].text != comments:\n", "if comments:\n", "book.comments[0].text = comments\n", "return modif_date\n", "book.comments.append...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Return'", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_62(self, VAR_73, VAR_62, VAR_14):...\n", "\"\"\"docstring\"\"\"\n", "VAR_73 = FUNC_3(VAR_73)\n", "VAR_14 = VAR_19(VAR_14, VAR_15=True)\n", "if VAR_62:\n", "VAR_62 = VAR_19(VAR_62, VAR_15=True)\n", "VAR_64 = '<img src=\"%s\" alt=\"%s\"' % (VAR_73, VAR_14)\n", "VAR_64 = '<img src=\"%s\" alt=\"...
[ "def image(self, src, title, text):...\n", "\"\"\"docstring\"\"\"\n", "src = escape_link(src)\n", "text = escape(text, quote=True)\n", "if title:\n", "title = escape(title, quote=True)\n", "html = '<img src=\"%s\" alt=\"%s\"' % (src, text)\n", "html = '<img src=\"%s\" alt=\"%s\" title=\"%s\"' % (src, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "import inspect\n", "import json\n", "import mimetypes\n", "import os\n", "import threading\n", "from typing import Any, Dict, Optional, Type, Union\n", "import tornado.web\n", "from streamlit.scriptrunner import get_script_run_ctx\n", "import streamlit.server.routes\n", "from streamlit import typ...
[ "import inspect\n", "import json\n", "import mimetypes\n", "import os\n", "import threading\n", "from typing import Any, Dict, Optional, Type, Union\n", "import tornado.web\n", "from streamlit.scriptrunner import get_script_run_ctx\n", "import streamlit.server.routes\n", "from streamlit import typ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "Expr'", "Co...
[ "def FUNC_80():...\n", "VAR_84 = self.as_dict()\n", "for VAR_43, VAR_26 in iteritems(VAR_84):\n", "if VAR_26 == None:\n", "return VAR_84\n", "VAR_84[VAR_43] = ''\n" ]
[ "def get_values():...\n", "values = self.as_dict()\n", "for key, value in iteritems(values):\n", "if value == None:\n", "return values\n", "values[key] = ''\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Assign'" ]
[ "@def_function.function...\n", "return VAR_50 + 2 * VAR_56\n" ]
[ "@def_function.function...\n", "return y + 2 * c\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@Document.whitelist...\n", "self.db_set('disabled', cint(VAR_16))\n" ]
[ "@Document.whitelist...\n", "self.db_set('disabled', cint(disable))\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_11(VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_34 = set(meta_graph_lib.ops_used_by_graph_def(VAR_4.graph_def))\n", "VAR_35 = VAR_1 & VAR_34\n", "if VAR_35:\n", "print('MetaGraph with tag set %s contains the following denylisted ops:' %\n VAR_4.meta_info_def.tags, VAR_35)\n", "print('Meta...
[ "def scan_meta_graph_def(meta_graph_def):...\n", "\"\"\"docstring\"\"\"\n", "all_ops_set = set(meta_graph_lib.ops_used_by_graph_def(meta_graph_def.\n graph_def))\n", "denylisted_ops = _OP_DENYLIST & all_ops_set\n", "if denylisted_ops:\n", "print('MetaGraph with tag set %s contains the following denylis...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "@VAR_0.route('/')...\n", "return flask.Response('Welcome to XMPP HTTP Upload. State your business.',\n mimetype='text/plain')\n" ]
[ "@app.route('/')...\n", "return flask.Response('Welcome to XMPP HTTP Upload. State your business.',\n mimetype='text/plain')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_23(self):...\n", "if not self.enable_mathjax:\n", "return u''\n", "VAR_88 = self.tornado_settings.get('static_url_prefix', url_path_join(self.\n base_url, 'static'))\n", "return url_path_join(VAR_88, 'components', 'MathJax', 'MathJax.js')\n" ]
[ "def _mathjax_url_default(self):...\n", "if not self.enable_mathjax:\n", "return u''\n", "static_url_prefix = self.tornado_settings.get('static_url_prefix',\n url_path_join(self.base_url, 'static'))\n", "return url_path_join(static_url_prefix, 'components', 'MathJax', 'MathJax.js')\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_1(self, VAR_10):...\n", "VAR_10 = self.form.refresh(request.form)\n", "VAR_21 = self.appbuilder.sm.get_user_by_id(g.user.id)\n", "VAR_10.populate_obj(VAR_21)\n", "self.appbuilder.sm.update_user(VAR_21)\n", "flash(as_unicode(self.message), 'info')\n" ]
[ "def form_post(self, form):...\n", "form = self.form.refresh(request.form)\n", "item = self.appbuilder.sm.get_user_by_id(g.user.id)\n", "form.populate_obj(item)\n", "self.appbuilder.sm.update_user(item)\n", "flash(as_unicode(self.message), 'info')\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_11(self, VAR_17, VAR_18={}):...\n", "if 'markdown' in self.md.markupShorthands:\n", "VAR_30 = MarkdownCodeSpans(VAR_17)\n", "VAR_30 = Functor(VAR_17)\n", "VAR_29 = dict(self.macros, **moreMacros)\n", "VAR_30 = VAR_30.map(curry(replaceMacros, VAR_29=macros))\n", "VAR_30 = VAR_30.map(fixTypograp...
[ "def fixText(self, text, moreMacros={}):...\n", "if 'markdown' in self.md.markupShorthands:\n", "textFunctor = MarkdownCodeSpans(text)\n", "textFunctor = Functor(text)\n", "macros = dict(self.macros, **moreMacros)\n", "textFunctor = textFunctor.map(curry(replaceMacros, macros=macros))\n", "textFunctor =...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "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_151(VAR_199):...\n", "if [VAR_14 for VAR_14 in VAR_199 if 32 > ord(VAR_14) or ord(VAR_14) > 127]:\n", "return Header(VAR_199.encode('utf-8'), 'utf-8')\n", "return VAR_199\n" ]
[ "def encode_header(key):...\n", "if [c for c in key if 32 > ord(c) or ord(c) > 127]:\n", "return Header(key.encode('utf-8'), 'utf-8')\n", "return key\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Return'", "Return'" ]
[ "def FUNC_0(VAR_12):...\n", "VAR_21 = VAR_12.pattern\n", "if VAR_21.startswith('^'):\n", "VAR_21 = VAR_21[1:]\n", "return VAR_21\n" ]
[ "def _pure_pattern(regex):...\n", "pattern = regex.pattern\n", "if pattern.startswith('^'):\n", "pattern = pattern[1:]\n", "return pattern\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = 'otherserver'\n", "VAR_14 = '@otheruser:' + VAR_13\n", "VAR_8 = self.register_user('kermit', 'test')\n", "VAR_9 = self.login('kermit', 'test')\n", "VAR_6 = self.helper.create_room_as(room_creator=user_id, VAR_9=tok)\n", "VAR_15 = self.get_...
[ "def test_rejected_message_event_state(self):...\n", "\"\"\"docstring\"\"\"\n", "OTHER_SERVER = 'otherserver'\n", "OTHER_USER = '@otheruser:' + OTHER_SERVER\n", "user_id = self.register_user('kermit', 'test')\n", "tok = self.login('kermit', 'test')\n", "room_id = self.helper.create_room_as(room_creator=...
[ 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'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def __deepcopy__(self, VAR_20):...\n", "VAR_34 = copy.copy(self)\n", "VAR_34.widget = copy.deepcopy(self.widget, VAR_20)\n", "VAR_34.attrs = self.widget.attrs\n", "VAR_20[VAR_35(self)] = VAR_34\n", "return VAR_34\n" ]
[ "def __deepcopy__(self, memo):...\n", "obj = copy.copy(self)\n", "obj.widget = copy.deepcopy(self.widget, memo)\n", "obj.attrs = self.widget.attrs\n", "memo[id(self)] = obj\n", "return obj\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_21=None, VAR_68=()):...\n", "VAR_68 = CHECKS.get_choices()\n", "super().__init__(VAR_21=attrs, VAR_68=choices)\n" ]
[ "def __init__(self, attrs=None, choices=()):...\n", "choices = CHECKS.get_choices()\n", "super().__init__(attrs=attrs, choices=choices)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def get_build_slug(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_8(self, VAR_26: str, *, VAR_29: Optional[Type[Any]]=None, VAR_13:...\n", "def FUNC_20(VAR_66: DecoratedCallable) ->DecoratedCallable:...\n", "self.add_api_route(VAR_26, VAR_66, VAR_29=response_model, VAR_13=\n status_code, VAR_30=tags, VAR_31=dependencies, VAR_32=summary, VAR_33=\n description, ...
[ "def api_route(self, path: str, *, response_model: Optional[Type[Any]]=None,...\n", "def decorator(func: DecoratedCallable) ->DecoratedCallable:...\n", "self.add_api_route(path, func, response_model=response_model, status_code=\n status_code, tags=tags, dependencies=dependencies, summary=summary,\n descri...
[ 0, 0, 0, 0 ]
[ "Condition", "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_76(VAR_42, VAR_38):...\n", "\"\"\"docstring\"\"\"\n", "VAR_40 = get_user_by_username_or_email(VAR_42)\n", "if not CourseEnrollment.is_enrolled(VAR_40, VAR_38):\n", "return VAR_40\n" ]
[ "def get_student(username_or_email, course_key):...\n", "\"\"\"docstring\"\"\"\n", "student = get_user_by_username_or_email(username_or_email)\n", "if not CourseEnrollment.is_enrolled(student, course_key):\n", "return student\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'" ]
[ "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 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 ]
[ "FunctionDef'", "Expr'", "For", "Expr'", "Return'" ]
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = SlashSeparatedCourseKey.from_deprecated_string(VAR_10)\n", "VAR_68 = ['company_name', 'company_contact_name', 'company_contact_email',\n 'total_codes', 'total_used_codes', 'total_amount', 'created',\n 'customer_reference_number', 'recipien...
[ "@ensure_csrf_cookie...\n", "\"\"\"docstring\"\"\"\n", "course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\n", "query_features = ['company_name', 'company_contact_name',\n 'company_contact_email', 'total_codes', 'total_used_codes',\n 'total_amount', 'created', 'customer_reference_numb...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "For", "Assign'", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_19(VAR_27):...\n", "\"\"\"docstring\"\"\"\n", "return smart_urlquote(VAR_27)\n", "return None\n" ]
[ "def smart_urlquote_wrapper(matched_url):...\n", "\"\"\"docstring\"\"\"\n", "return smart_urlquote(matched_url)\n", "return None\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'", "Return'" ]
[ "@VAR_1.route('/<bfile>/<report_name>/')...\n", "\"\"\"docstring\"\"\"\n", "if VAR_19 in VAR_3:\n", "return render_template('_layout.html', active_page=report_name)\n", "return abort(404)\n" ]
[ "@app.route('/<bfile>/<report_name>/')...\n", "\"\"\"docstring\"\"\"\n", "if report_name in REPORTS:\n", "return render_template('_layout.html', active_page=report_name)\n", "return abort(404)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Return'" ]
[ "def FUNC_61(self, VAR_25):...\n", "VAR_72 = getattr(self, VAR_25, None)\n", "if not VAR_72:\n", "if not getattr(VAR_72, 'whitelisted', False):\n" ]
[ "def is_whitelisted(self, method):...\n", "fn = getattr(self, method, None)\n", "if not fn:\n", "if not getattr(fn, 'whitelisted', False):\n" ]
[ 0, 2, 0, 2 ]
[ "FunctionDef'", "Assign'", "Condition", "Condition" ]
[ "@wraps(VAR_10)...\n", "VAR_1 = self.__class__\n", "if VAR_2:\n", "VAR_42 = [arg[0] for arg in FUNC_3(VAR_1)]\n", "VAR_39 = vars(FUNC_2(VAR_1))\n", "VAR_3.update(dict(zip(VAR_42, VAR_2)))\n", "VAR_3 = dict(list(VAR_39.items()) + list(VAR_3.items()))\n", "return VAR_10(self, **kwargs)\n" ]
[ "@wraps(fn)...\n", "cls = self.__class__\n", "if args:\n", "cls_arg_names = [arg[0] for arg in get_init_arguments_and_types(cls)]\n", "env_variables = vars(parse_env_variables(cls))\n", "kwargs.update(dict(zip(cls_arg_names, args)))\n", "kwargs = dict(list(env_variables.items()) + list(kwargs.items()))\...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "@CLASS_4('settings')...\n", "\"\"\"docstring\"\"\"\n", "if VAR_3.path() == '/set':\n", "return FUNC_14(VAR_3)\n", "VAR_20 = jinja.render('settings.html', title='settings', configdata=\n configdata, confget=config.instance.get_str)\n", "return 'text/html', VAR_20\n" ]
[ "@add_handler('settings')...\n", "\"\"\"docstring\"\"\"\n", "if url.path() == '/set':\n", "return _qute_settings_set(url)\n", "src = jinja.render('settings.html', title='settings', configdata=configdata,\n confget=config.instance.get_str)\n", "return 'text/html', src\n" ]
[ 0, 0, 0, 0, 3, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_48(self, VAR_5):...\n", "VAR_3 = self.login()\n", "self.assertEqual(VAR_3.status_code, 302)\n", "self.assertURLEqual(VAR_3.url, VAR_5)\n" ]
[ "def assertLoginRedirectURLEqual(self, url):...\n", "response = self.login()\n", "self.assertEqual(response.status_code, 302)\n", "self.assertURLEqual(response.url, url)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def __call__(self, VAR_31):...\n", "VAR_3, VAR_4, VAR_73 = self._get_url_and_credentials(VAR_31.url)\n", "VAR_31.url = VAR_3\n", "if VAR_4 is not None and VAR_73 is not None:\n", "VAR_31 = HTTPBasicAuth(VAR_4, VAR_73)(VAR_31)\n", "VAR_31.register_hook('response', self.handle_401)\n", "return VAR_31\n" ...
[ "def __call__(self, req):...\n", "url, username, password = self._get_url_and_credentials(req.url)\n", "req.url = url\n", "if username is not None and password is not None:\n", "req = HTTPBasicAuth(username, password)(req)\n", "req.register_hook('response', self.handle_401)\n", "return req\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_2(self, VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "return self._verify_objects(CLASS_0(VAR_2, VAR_3, VAR_10, VAR_5) for VAR_2,\n VAR_3, VAR_10, VAR_5 in VAR_11)\n" ]
[ "def verify_json_objects_for_server(self, server_and_json):...\n", "\"\"\"docstring\"\"\"\n", "return self._verify_objects(VerifyJsonRequest(server_name, json_object,\n validity_time, request_name) for server_name, json_object,\n validity_time, request_name in server_and_json)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "if VAR_2.method != 'POST':\n", "VAR_154 = FUNC_42(VAR_2, VAR_5)\n", "if len(VAR_154['share']) < 1:\n", "for obs in VAR_154.values():\n", "VAR_158 = VAR_2.POST.get('mapAnnotation')\n", "if len(obs) > 0:\n", "VAR_158 = json.loads(VAR_158)\n", "VA...
[ "@login_required()...\n", "\"\"\"docstring\"\"\"\n", "if request.method != 'POST':\n", "oids = getObjects(request, conn)\n", "if len(oids['share']) < 1:\n", "for obs in oids.values():\n", "data = request.POST.get('mapAnnotation')\n", "if len(obs) > 0:\n", "data = json.loads(data)\n", "conn.SERVICE...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Condition", "Assign'", "Condition", "For", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "For", "Expr'", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Condition"...
[ "def FUNC_30(self):...\n", "VAR_5 = self._makeContext()\n", "self.assertIs(VAR_5.evaluate('nocall: list'), safe_builtins['list'])\n" ]
[ "def test_list_in_path_expr(self):...\n", "ec = self._makeContext()\n", "self.assertIs(ec.evaluate('nocall: list'), safe_builtins['list'])\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_94(self, *VAR_119, **VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "VAR_153 = VAR_119[0]\n", "VAR_133 = VAR_11.get('fields', VAR_153.fields)\n", "VAR_292 = VAR_11.get('validate', True)\n", "VAR_56 = VAR_263.request\n", "VAR_101 = self.db\n", "if not (isinstance(VAR_153, VAR_0) or VAR_153 in VAR...
[ "def search(self, *tables, **args):...\n", "\"\"\"docstring\"\"\"\n", "table = tables[0]\n", "fields = args.get('fields', table.fields)\n", "validate = args.get('validate', True)\n", "request = current.request\n", "db = self.db\n", "if not (isinstance(table, Table) or table in db.tables):\n", "attri...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "For", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "For", "Assign'", "Assign'",...
[ "def FUNC_17(self):...\n", "return FUNC_17(self.items())\n" ]
[ "def urlencode(self):...\n", "return urlencode(self.items())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_15(self):...\n", "VAR_5 = self.get_counts('json', period='month')\n", "self.assertEqual(VAR_5.status_code, 200)\n", "self.assertJSONEqual(VAR_5.content.decode(), [])\n" ]
[ "def test_counts_view_month(self):...\n", "response = self.get_counts('json', period='month')\n", "self.assertEqual(response.status_code, 200)\n", "self.assertJSONEqual(response.content.decode(), [])\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "@VAR_0.route('/api/jobs/incomplete_ids', methods=['GET'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_116 = FUNC_58('/internal/jobs/incomplete-ids', 'get')\n", "return jsonify({'success': False, 'message': str(err)}), 400\n", "return jsonify(VAR_116)\n" ]
[ "@gui.route('/api/jobs/incomplete_ids', methods=['GET'])...\n", "\"\"\"docstring\"\"\"\n", "incomplete_ids_list = query_internal_api('/internal/jobs/incomplete-ids', 'get'\n )\n", "return jsonify({'success': False, 'message': str(err)}), 400\n", "return jsonify(incomplete_ids_list)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'", "Return'" ]
[ "def FUNC_65(VAR_6):...\n", "return reverse(VAR_120, VAR_116=(iid,))\n" ]
[ "def urlprefix(iid):...\n", "return reverse(prefix, args=(iid,))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_58, VAR_6, VAR_59=False):...\n", "xmlrpc_client.Transport.__init__(self, VAR_59)\n", "VAR_88 = urllib_parse.urlparse(VAR_58)\n", "self._scheme = VAR_88.scheme\n", "self._session = VAR_6\n" ]
[ "def __init__(self, index_url, session, use_datetime=False):...\n", "xmlrpc_client.Transport.__init__(self, use_datetime)\n", "index_parts = urllib_parse.urlparse(index_url)\n", "self._scheme = index_parts.scheme\n", "self._session = session\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "async def FUNC_33(self, VAR_5: str, VAR_1: EventBase, VAR_32: EventContext,...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = await self.store.get_room_version_id(VAR_1.room_id)\n", "VAR_90 = KNOWN_ROOM_VERSIONS[VAR_28]\n", "VAR_32 = await self._update_auth_events_and_context_for_auth(VAR_5, VAR_1,\n VAR_32, ...
[ "async def do_auth(self, origin: str, event: EventBase, context:...\n", "\"\"\"docstring\"\"\"\n", "room_version = await self.store.get_room_version_id(event.room_id)\n", "room_version_obj = KNOWN_ROOM_VERSIONS[room_version]\n", "context = await self._update_auth_events_and_context_for_auth(origin, event,\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'", "Assign'" ]
[ "def FUNC_16(self):...\n", "VAR_32 = {'a': 5, 'b': np.array(range(4))}\n", "VAR_33 = np.array([1])\n", "VAR_34 = np.array([[1], [3]])\n", "VAR_35 = os.path.join(test.get_temp_dir(), 'pickle0.pkl')\n", "VAR_36 = os.path.join(test.get_temp_dir(), 'pickle1.pkl')\n", "VAR_37 = os.path.join(test.get_temp_dir...
[ "def testInputParserPickle(self):...\n", "pkl0 = {'a': 5, 'b': np.array(range(4))}\n", "pkl1 = np.array([1])\n", "pkl2 = np.array([[1], [3]])\n", "input_path0 = os.path.join(test.get_temp_dir(), 'pickle0.pkl')\n", "input_path1 = os.path.join(test.get_temp_dir(), 'pickle1.pkl')\n", "input_path2 = os.path...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "AugAssign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_20(self, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "frappe.db.sql('delete from `tabSingles` where doctype=%s', self.doctype)\n", "for field, VAR_26 in iteritems(VAR_21):\n", "if field != 'doctype':\n", "if self.doctype in frappe.db.value_cache:\n", "frappe.db.sql(\n \"\"\"insert into `tabS...
[ "def update_single(self, d):...\n", "\"\"\"docstring\"\"\"\n", "frappe.db.sql('delete from `tabSingles` where doctype=%s', self.doctype)\n", "for field, value in iteritems(d):\n", "if field != 'doctype':\n", "if self.doctype in frappe.db.value_cache:\n", "frappe.db.sql(\n \"\"\"insert into `tabSingle...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "For", "Condition", "Condition", "Expr'" ]
[ "def FUNC_15(self):...\n", "VAR_22, VAR_23 = self.make_request('POST', '/createRoom', '{}')\n", "self.assertEquals(200, VAR_23.code, VAR_23.result)\n", "self.assertTrue('room_id' in VAR_23.json_body)\n" ]
[ "def test_post_room_no_keys(self):...\n", "request, channel = self.make_request('POST', '/createRoom', '{}')\n", "self.assertEquals(200, channel.code, channel.result)\n", "self.assertTrue('room_id' in channel.json_body)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]