lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def __init__(self):...\n",
"super(CLASS_0, self).__init__()\n"
] | [
"def __init__(self):...\n",
"super(CmdInjection, self).__init__()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_0.route('/<id>', methods=['GET'])...\n",
"VAR_15 = ProductsRepository.get_product(VAR_5)\n",
"return jsonify(VAR_15=product)\n"
] | [
"@products.route('/<id>', methods=['GET'])...\n",
"product = ProductsRepository.get_product(id)\n",
"return jsonify(product=product)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"@bot.message_handler(content_types=['document'])...\n",
"VAR_7 = users.find_one(VAR_1)\n",
"bot.reply_to(VAR_1, messages[VAR_7.language]['photo_prcs'])\n",
"log.info('%s sent photo as a file.', VAR_7)\n",
"VAR_19 = CLASS_0(VAR_1, VAR_7)\n",
"VAR_10 = VAR_19.prepare_answer()\n",
"if VAR_10[0][0]:\n",
... | [
"@bot.message_handler(content_types=['document'])...\n",
"user = users.find_one(message)\n",
"bot.reply_to(message, messages[user.language]['photo_prcs'])\n",
"log.info('%s sent photo as a file.', user)\n",
"photo_message = PhotoMessage(message, user)\n",
"answer = photo_message.prepare_answer()\n",
"if... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"return BinaryUtil.Factory,\n"
] | [
"@classmethod...\n",
"return BinaryUtil.Factory,\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"import socket\n",
"from django.contrib import messages\n",
"from django.contrib.auth.decorators import login_required, user_passes_test\n",
"from django.http import HttpResponse\n",
"from django.shortcuts import get_object_or_404, render, redirect\n",
"import json\n",
"from mdta.apps.projects.models im... | [
"import socket\n",
"from django.contrib import messages\n",
"from django.contrib.auth.decorators import login_required, user_passes_test\n",
"from django.http import HttpResponse\n",
"from django.shortcuts import get_object_or_404, render, redirect\n",
"import json\n",
"from mdta.apps.projects.models im... | [
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4=None, **VAR_5):...\n",
"self.using = VAR_0\n",
"self.index = VAR_1\n",
"self.doc_types = VAR_2\n",
"self._model = VAR_3\n",
"if VAR_4:\n",
"self.fields = VAR_4\n",
"super(CLASS_0, self).__init__(**kwargs)\n"
] | [
"def __init__(self, using, index, doc_types, model, fields=None, **kwargs):...\n",
"self.using = using\n",
"self.index = index\n",
"self.doc_types = doc_types\n",
"self._model = model\n",
"if fields:\n",
"self.fields = fields\n",
"super(RTDFacetedSearch, self).__init__(**kwargs)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_24(VAR_19, VAR_20, VAR_21=None):...\n",
"VAR_28 = None\n",
"if VAR_21:\n",
"VAR_28 = jsonutils.dumps({'httpStatus': 'dummy', 'error_code': VAR_21,\n 'module_name': 'dummy', 'error_message': 'bad'})\n",
"VAR_29 = mocks.MockRequestsResponse(VAR_20, VAR_28)\n",
"VAR_30 = self.new_mocked_client(c... | [
"def _verb_response_code(http_verb, status_code, error_code=None):...\n",
"content = None\n",
"if error_code:\n",
"content = jsonutils.dumps({'httpStatus': 'dummy', 'error_code': error_code,\n 'module_name': 'dummy', 'error_message': 'bad'})\n",
"response = mocks.MockRequestsResponse(status_code, content... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = {VAR_14: None for VAR_14 in VAR_0}\n",
"VAR_7.update(VAR_5)\n",
"VAR_8 = {'server': VAR_3.rstrip('/'), 'server_version': VAR_4}\n",
"VAR_7['config/config.json'] = json.dumps(VAR_8)\n",
"for item, content in sorted(VAR_7.... | [
"def yield_swarming_bot_files(root_dir, host, host_version, additionals):...\n",
"\"\"\"docstring\"\"\"\n",
"items = {i: None for i in FILES}\n",
"items.update(additionals)\n",
"config = {'server': host.rstrip('/'), 'server_version': host_version}\n",
"items['config/config.json'] = json.dumps(config)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_6, VAR_7=3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = list(VAR_6)\n",
"VAR_26 = lambda : [VAR_0 for VAR_0 in VAR_6 if not os.path.exists(VAR_0)]\n",
"VAR_27 = VAR_26()\n",
"if VAR_27:\n",
"logger.info('Waiting at most {} seconds for missing files.'.format(VAR_7))\n",
"for _ in range(... | [
"def wait_for_files(files, latency_wait=3):...\n",
"\"\"\"docstring\"\"\"\n",
"files = list(files)\n",
"get_missing = lambda : [f for f in files if not os.path.exists(f)]\n",
"missing = get_missing()\n",
"if missing:\n",
"logger.info('Waiting at most {} seconds for missing files.'.format(\n latency_w... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_10(self):...\n",
"for VAR_3 in ExtractedText.objects.all():\n",
"VAR_1 = self.client.get(f'/qa/extractedtext/%s' % VAR_3.data_document_id,\n follow=True)\n",
"if VAR_1.status_code != 200:\n",
"print(VAR_3.data_document_id)\n",
"self.assertEqual(VAR_1.status_code, 200)\n"
] | [
"def test_every_extractedtext_qa(self):...\n",
"for et in ExtractedText.objects.all():\n",
"response = self.client.get(f'/qa/extractedtext/%s' % et.data_document_id,\n follow=True)\n",
"if response.status_code != 200:\n",
"print(et.data_document_id)\n",
"self.assertEqual(response.status_code, 200)\n"
] | [
0,
0,
6,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@inlineCallbacks...\n",
"VAR_2 = self.database.generate_update(self)\n",
"if self.return_id:\n",
"VAR_3 = yield self.database.runQuery(VAR_2)\n",
"yield self.database.runOperation(VAR_2)\n",
"if VAR_3 and self.model_class._meta.primary_key:\n",
"returnValue(None)\n",
"returnValue(VAR_3[0][0])\n"
] | [
"@inlineCallbacks...\n",
"query = self.database.generate_update(self)\n",
"if self.return_id:\n",
"result = yield self.database.runQuery(query)\n",
"yield self.database.runOperation(query)\n",
"if result and self.model_class._meta.primary_key:\n",
"returnValue(None)\n",
"returnValue(result[0][0])\n"
] | [
0,
4,
0,
4,
4,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_10(self, VAR_21, VAR_27, VAR_28, VAR_29, VAR_30, VAR_31=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.newcount > 10000:\n",
"if VAR_31 is None:\n",
"VAR_31 = time.time()\n",
"if not len(VAR_21.strip('/')):\n",
"VAR_58 = self.get_path(os.path.dirname(VAR_21.strip('/')))\n",
"return False\... | [
"def mkdir(self, path, uid, gid, size, mode, ctime=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.newcount > 10000:\n",
"if ctime is None:\n",
"ctime = time.time()\n",
"if not len(path.strip('/')):\n",
"dir = self.get_path(os.path.dirname(path.strip('/')))\n",
"return False\n",
"dir.append([os.pa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Expr'",
"AugAssign'"
] |
[
"def FUNC_2(self):...\n",
"return \"\"\"Task: %s (ID %d)\nSubmission: %s\n\"\"\" % (self.task[1], self.task[0],\n self.submission_num) + GenericRequest.specific_info(self)\n"
] | [
"def specific_info(self):...\n",
"return \"\"\"Task: %s (ID %d)\nSubmission: %s\n\"\"\" % (self.task[1], self.task[0],\n self.submission_num) + GenericRequest.specific_info(self)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@require_http_methods(['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = BadRequestRateLimiter()\n",
"if VAR_16.is_rate_limit_exceeded(VAR_3):\n",
"VAR_0.warning('Password reset rate limit exceeded')\n",
"VAR_10 = VAR_3.user\n",
"return HttpResponseForbidden()\n",
"VAR_17 = VAR_10.email if VAR_10.... | [
"@require_http_methods(['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"limiter = BadRequestRateLimiter()\n",
"if limiter.is_rate_limit_exceeded(request):\n",
"AUDIT_LOG.warning('Password reset rate limit exceeded')\n",
"user = request.user\n",
"return HttpResponseForbidden()\n",
"email = user.email if us... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/api', methods=['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = request.get_json()\n",
"VAR_20 = FUNC_7(VAR_10)\n",
"if type(VAR_20).__name__ == 'int':\n",
"return FUNC_0('error', VAR_1[VAR_20], 400)\n",
"VAR_8 = VAR_10.get('userInfo', None)\n",
"VAR_9 = VAR_10.get('allTasks', None... | [
"@app.route('/api', methods=['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"req_data = request.get_json()\n",
"verification = verify_proper_post_request(req_data)\n",
"if type(verification).__name__ == 'int':\n",
"return api_response('error', ERRORS[verification], 400)\n",
"user_info = req_data.get('userIn... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"For",
"Condition",
"Assign'",
"Return'",
"Assign'",
"For",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_6(self, VAR_44, VAR_50):...\n",
"if not FUNC_2(VAR_44):\n",
"return self.error()\n",
"if VAR_50 != VAR_44:\n",
"return self.error(errors.BAD_PASSWORD_MATCH)\n",
"return VAR_44\n"
] | [
"def run(self, password, verify):...\n",
"if not chkpass(password):\n",
"return self.error()\n",
"if verify != password:\n",
"return self.error(errors.BAD_PASSWORD_MATCH)\n",
"return password\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_16(VAR_13):...\n",
"VAR_5.setResponseCode(OK)\n",
"VAR_5.write(open(os.path.join(self._startup_folder, 'Interstitial.html')).\n read())\n",
"VAR_5.finish()\n",
"self._setup_user_services(VAR_13, VAR_5)\n"
] | [
"def render_response(leap_session):...\n",
"request.setResponseCode(OK)\n",
"request.write(open(os.path.join(self._startup_folder, 'Interstitial.html'))\n .read())\n",
"request.finish()\n",
"self._setup_user_services(leap_session, request)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@defer.inlineCallbacks...\n",
"if os.path.isdir(VAR_0):\n",
"shutil.rmtree(VAR_0)\n",
"VAR_52 = u'verysecretpassphrase'\n",
"VAR_53 = os.path.join(VAR_0, 'secret.gpg')\n",
"VAR_54 = os.path.join(VAR_0, 'soledad.u1db')\n",
"VAR_55 = 'http://provider'\n",
"VAR_56 = ''\n",
"VAR_74 = Mock(return_value=... | [
"@defer.inlineCallbacks...\n",
"if os.path.isdir(tempdir):\n",
"shutil.rmtree(tempdir)\n",
"passphrase = u'verysecretpassphrase'\n",
"secret_path = os.path.join(tempdir, 'secret.gpg')\n",
"local_db_path = os.path.join(tempdir, 'soledad.u1db')\n",
"server_url = 'http://provider'\n",
"cert_file = ''\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(VAR_13):...\n",
"VAR_3.execute(\n 'INSERT INTO games VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', VAR_13)\n",
"VAR_2.commit()\n"
] | [
"def CreateGame(Pod):...\n",
"db.execute('INSERT INTO games VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',\n Pod)\n",
"database.commit()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._remote\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._remote\n"
] | [
5,
0,
5
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@app.route('/manage')...\n",
"if current_user.is_authenticated:\n",
"return render_template('manage.html')\n",
"return redirect('/index')\n"
] | [
"@app.route('/manage')...\n",
"if current_user.is_authenticated:\n",
"return render_template('manage.html')\n",
"return redirect('/index')\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_10(self, VAR_13):...\n",
"return VAR_13.name in self._localrules or VAR_13.norun\n"
] | [
"def is_local(self, rule):...\n",
"return rule.name in self._localrules or rule.norun\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_7, **VAR_8):...\n",
"VAR_8.setdefault('shots', 0)\n",
"super().__init__(self.short_name, VAR_8['shots'])\n",
"for k, v in {'log': 'verbose'}.items():\n",
"if k in VAR_8:\n",
"if 'num_runs' in VAR_8:\n",
"VAR_8.setdefault(v, VAR_8[k])\n",
"if isinstance(VAR_8['num_runs'], int) a... | [
"def __init__(self, wires, **kwargs):...\n",
"kwargs.setdefault('shots', 0)\n",
"super().__init__(self.short_name, kwargs['shots'])\n",
"for k, v in {'log': 'verbose'}.items():\n",
"if k in kwargs:\n",
"if 'num_runs' in kwargs:\n",
"kwargs.setdefault(v, kwargs[k])\n",
"if isinstance(kwargs['num_runs']... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"For",
"Condition",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"import pymysql.cursors\n",
"def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4):...\n",
"self.connection = pymysql.connect(VAR_0=host, VAR_1=user, VAR_2=password,\n VAR_3=db, VAR_4=charset, cursorclass=pymysql.cursors.DictCursor)\n",
"def FUNC_0(self):...\n",
"self.connection.close()\n",
"def FUNC_1... | [
"import pymysql.cursors\n",
"def __init__(self, host, user, password, db, charset):...\n",
"self.connection = pymysql.connect(host=host, user=user, password=password,\n db=db, charset=charset, cursorclass=pymysql.cursors.DictCursor)\n",
"def close_connection(self):...\n",
"self.connection.close()\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_17(self, VAR_25, VAR_27='', VAR_28=None):...\n",
"VAR_28 = VAR_28 or {'Content-Type': 'application/json'}\n",
"VAR_20 = request_mock(VAR_25=path, method='POST', VAR_27=body, VAR_28=headers)\n",
"return self._render(VAR_20)\n"
] | [
"def post(self, path, body='', headers=None):...\n",
"headers = headers or {'Content-Type': 'application/json'}\n",
"request = request_mock(path=path, method='POST', body=body, headers=headers)\n",
"return self._render(request)\n"
] | [
0,
0,
5,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_1.route('/password-reset/<payload>', methods=['GET', 'POST'])...\n",
"if not VAR_0.config['ALLOW_PASSWORD_RESET']:\n",
"return VAR_14.abort(404)\n",
"if VAR_14.g.user:\n",
"return VAR_14.redirect(FUNC_5())\n",
"if VAR_2 is None:\n",
"VAR_4 = forms.PasswordResetRequestForm(VAR_14.request.form)\n",
... | [
"@bp.route('/password-reset/<payload>', methods=['GET', 'POST'])...\n",
"if not app.config['ALLOW_PASSWORD_RESET']:\n",
"return flask.abort(404)\n",
"if flask.g.user:\n",
"return flask.redirect(redirect_url())\n",
"if payload is None:\n",
"form = forms.PasswordResetRequestForm(flask.request.form)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Condition",
"Return'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Return'",
"Cond... |
[
"def __iter__(self):...\n",
"return iter(self.__proxies)\n"
] | [
"def __iter__(self):...\n",
"return iter(self.__proxies)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self, *VAR_4, **VAR_5):...\n",
"return self.manage_menu(VAR_4, VAR_5)\n"
] | [
"def zmi_manage_menu(self, *args, **kwargs):...\n",
"return self.manage_menu(args, kwargs)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_38(self, VAR_84):...\n",
"return [VAR_82 for job in VAR_84.jobs for VAR_82 in job.subworkflow_input if\n job.subworkflow_input[VAR_82] is self]\n"
] | [
"def targets(self, dag):...\n",
"return [f for job in dag.jobs for f in job.subworkflow_input if job.\n subworkflow_input[f] is self]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from django.test import TestCase\n",
"from django.test.client import Client\n",
"from lxml import html\n",
"from django.urls import resolve\n",
"from django.contrib.auth.models import User\n",
"from dashboard.tests.loader import fixtures_standard\n",
"VAR_0 = fixtures_standard\n",
"def FUNC_0(self):.... | [
"from django.test import TestCase\n",
"from django.test.client import Client\n",
"from lxml import html\n",
"from django.urls import resolve\n",
"from django.contrib.auth.models import User\n",
"from dashboard.tests.loader import fixtures_standard\n",
"fixtures = fixtures_standard\n",
"def setUp(self)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
... |
[
"def FUNC_0(VAR_0):...\n",
"VAR_12 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n",
"def FUNC_6():...\n",
"VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n",
"if len(VAR_0) >= 3:\n",
"if '=' in VAR_0:\n",
"FUNC_6()\n",
"if ' --' in VAR_0:\n",
"FUNC_6()\n",
"if a... | [
"def sanitize_searchfield(searchfield):...\n",
"blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n 'or', 'like']\n",
"def _raise_exception():...\n",
"frappe.throw(_('Invalid Search Field'), frappe.DataError)\n",
"if len(searchfield) >= 3:\n",
"if '=' in searchfield:\n",
"_... | [
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_3(VAR_3, VAR_4, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = VAR_3['pkg'][VAR_4]['version']\n",
"VAR_20 = VAR_3['pkg'][VAR_4]['target'][VAR_2]\n",
"return VAR_19, VAR_20\n"
] | [
"def package(manifest, pkg, target):...\n",
"\"\"\"docstring\"\"\"\n",
"version = manifest['pkg'][pkg]['version']\n",
"info = manifest['pkg'][pkg]['target'][target]\n",
"return version, info\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"import os\n",
"VAR_0 = os.path.abspath(os.path.dirname(__file__))\n",
"VAR_2 = VAR_0\n",
"VAR_3 = os.path.join(VAR_2, 'db_repository')\n",
"VAR_4 = False\n",
"VAR_5 = '/static/'\n",
"VAR_6 = os.path.join(VAR_0, 'static', 'tempbenwas')\n",
"VAR_7 = 'sqlite:///' + os.path.join(VAR_0, 'db', 'benwaonline... | [
"import os\n",
"BASE = os.path.abspath(os.path.dirname(__file__))\n",
"BASE_DIR = BASE\n",
"SQLALCHEMY_MIGRATE_REPO = os.path.join(BASE_DIR, 'db_repository')\n",
"SQLALCHEMY_TRACK_MODIFICATIONS = False\n",
"UPLOADED_IMAGES_DEST = '/static/'\n",
"UPLOADED_BENWA_DIR = os.path.join(BASE, 'static', 'tempben... | [
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_12(self):...\n",
"VAR_13 = u'tësting'\n",
"self.cursor.execute('create table t1(s nchar(7))')\n",
"self.cursor.execute('insert into t1 values(?)', u'tësting')\n",
"VAR_4 = self.cursor.execute('select * from t1').fetchone()[0]\n",
"self.assertEqual(type(VAR_4), unicode)\n",
"self.assertEqual(VA... | [
"def test_fixed_unicode(self):...\n",
"value = u'tësting'\n",
"self.cursor.execute('create table t1(s nchar(7))')\n",
"self.cursor.execute('insert into t1 values(?)', u'tësting')\n",
"v = self.cursor.execute('select * from t1').fetchone()[0]\n",
"self.assertEqual(type(v), unicode)\n",
"self.assertEqual(... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_18(VAR_6):...\n",
"return FUNC_7(VAR_6, 'X-Content-Type-Options', 'nosniff')\n"
] | [
"def validate_no_sniff(page):...\n",
"return validate_security_header(page, 'X-Content-Type-Options', 'nosniff')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_20(self, VAR_10=None, VAR_11=None, VAR_1=None):...\n",
"VAR_10 = self.add_rule(VAR_10, VAR_11, VAR_1)\n",
"VAR_13 = self.get_rule(VAR_10)\n",
"def FUNC_39(VAR_101):...\n",
"if VAR_101.input:\n",
"VAR_13.set_input(*VAR_101.input[0], **ruleinfo.input[1])\n",
"if VAR_101.output:\n",
"VAR_13.set... | [
"def rule(self, name=None, lineno=None, snakefile=None):...\n",
"name = self.add_rule(name, lineno, snakefile)\n",
"rule = self.get_rule(name)\n",
"def decorate(ruleinfo):...\n",
"if ruleinfo.input:\n",
"rule.set_input(*ruleinfo.input[0], **ruleinfo.input[1])\n",
"if ruleinfo.output:\n",
"rule.set_out... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Con... |
[
"def FUNC_4(self):...\n",
"return reverse('article-detail', VAR_3={'pk': self.object.pk})\n"
] | [
"def get_success_url(self):...\n",
"return reverse('article-detail', kwargs={'pk': self.object.pk})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_12):...\n",
"def FUNC_9(self, *VAR_15, **VAR_75):...\n",
"for validator in VAR_0:\n",
"if VAR_102.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n",
"return FUNC_9\n",
"validator(VAR_75)\n",
"VAR_16 = self.build_arg_list(VAR_12, VAR_75)\n",
"return self.ajax_login_redirect(... | [
"def val(fn):...\n",
"def newfn(self, *a, **env):...\n",
"for validator in simple_vals:\n",
"if request.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n",
"return newfn\n",
"validator(env)\n",
"kw = self.build_arg_list(fn, env)\n",
"return self.ajax_login_redirect('/')\n",
"return self.i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"For",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Return'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_1.last_login:\n",
"return reverse('core:user_index')\n",
"VAR_2 = VAR_0.POST.get('next', None)\n",
"if VAR_2 is None or VAR_2 == 'None':\n",
"if VAR_0.user.role == 'SimpleUsers':\n",
"return VAR_2\n",
"VAR_3 = VAR_0.localconfig... | [
"def find_nextlocation(request, user):...\n",
"\"\"\"docstring\"\"\"\n",
"if not user.last_login:\n",
"return reverse('core:user_index')\n",
"nextlocation = request.POST.get('next', None)\n",
"if nextlocation is None or nextlocation == 'None':\n",
"if request.user.role == 'SimpleUsers':\n",
"return ne... | [
0,
0,
0,
0,
6,
6,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_21, VAR_23=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = self.fs\n",
"for part in VAR_21.split('/'):\n",
"if not len(part):\n",
"return VAR_22[VAR_8]\n",
"VAR_67 = False\n",
"for c in VAR_22[VAR_8]:\n",
"if c[VAR_1] == part:\n",
"if not VAR_67:\n",
"if c[VAR_2] == VAR_... | [
"def get_path(self, path, follow_symlinks=True):...\n",
"\"\"\"docstring\"\"\"\n",
"cwd = self.fs\n",
"for part in path.split('/'):\n",
"if not len(part):\n",
"return cwd[A_CONTENTS]\n",
"ok = False\n",
"for c in cwd[A_CONTENTS]:\n",
"if c[A_NAME] == part:\n",
"if not ok:\n",
"if c[A_TYPE] == T_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"For",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_3():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = FUNC_0()\n",
"VAR_5 = 'players'\n",
"VAR_4 = VAR_3.cursor()\n",
"VAR_4.execute('SELECT COUNT(playerID) FROM %s;' % (VAR_5,))\n",
"VAR_7 = VAR_4.fetchone()[0]\n",
"VAR_3.commit()\n",
"VAR_3.close()\n",
"return VAR_7\n"
] | [
"def countPlayers():...\n",
"\"\"\"docstring\"\"\"\n",
"conn = connect()\n",
"table = 'players'\n",
"c = conn.cursor()\n",
"c.execute('SELECT COUNT(playerID) FROM %s;' % (table,))\n",
"result = c.fetchone()[0]\n",
"conn.commit()\n",
"conn.close()\n",
"return result\n"
] | [
0,
0,
0,
0,
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_4(self, VAR_1, VAR_2, VAR_5, VAR_10=None, VAR_11=False, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_10:\n",
"VAR_10 = []\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"VAR_29 = {}\n",
"for VAR_48 in VAR_5:\n",
"VAR_29[VAR_48] = {}.fromkeys(VAR_10, 0.0)\n",
"for VAR_55 in VAR_... | [
"def _product_available(self, cr, uid, ids, field_names=None, arg=False,...\n",
"\"\"\"docstring\"\"\"\n",
"if not field_names:\n",
"field_names = []\n",
"if context is None:\n",
"context = {}\n",
"res = {}\n",
"for id in ids:\n",
"res[id] = {}.fromkeys(field_names, 0.0)\n",
"for f in field_names:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"For",
"Assign'"
] |
[
"def FUNC_0(VAR_2, VAR_3=None, VAR_4=None, VAR_5=5, VAR_6=None, VAR_7='POST'):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_5 <= 0:\n",
"logging.error('UrlOpen(%s): Invalid number of tries: %d', VAR_2, VAR_5)\n",
"if VAR_6 and VAR_6 < 0:\n",
"return None\n",
"logging.error('UrlOpen(%s): Invalid wait durati... | [
"def UrlOpen(url, data=None, files=None, max_tries=5, wait_duration=None,...\n",
"\"\"\"docstring\"\"\"\n",
"if max_tries <= 0:\n",
"logging.error('UrlOpen(%s): Invalid number of tries: %d', url, max_tries)\n",
"if wait_duration and wait_duration < 0:\n",
"return None\n",
"logging.error('UrlOpen(%s): In... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"For",
"Assign'",
"Expr'",
"For",
"Condition",
"Condition",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr... |
[
"def FUNC_34(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n",
"self.check_example('skip.py', VAR_2)\n"
] | [
"def test_skip(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n",
"self.check_example('skip.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"async def FUNC_2(self, VAR_3: neko.Context) ->neko.Page:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = f'{neko.__copyright__} under the {neko.__license__} license.\\n\\n'\n",
"VAR_12 = inspect.getdoc(neko)\n",
"VAR_12 = inspect.cleandoc(VAR_12 if VAR_12 else '')\n",
"VAR_11 += neko.remove_single_lines(VAR_... | [
"async def gen_front_page(self, ctx: neko.Context) ->neko.Page:...\n",
"\"\"\"docstring\"\"\"\n",
"desc = f'{neko.__copyright__} under the {neko.__license__} license.\\n\\n'\n",
"doc_str = inspect.getdoc(neko)\n",
"doc_str = inspect.cleandoc(doc_str if doc_str else '')\n",
"desc += neko.remove_single_line... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = VAR_5[:]\n",
"for request in VAR_5:\n",
"self.assertEqual(tuple, request.__class__)\n",
"self.assertEqual([], self._requests)\n",
"self.assertIn(len(request), (3, 4))\n",
"self._requests = VAR_5\n"
] | [
"def expected_requests(self, requests):...\n",
"\"\"\"docstring\"\"\"\n",
"requests = requests[:]\n",
"for request in requests:\n",
"self.assertEqual(tuple, request.__class__)\n",
"self.assertEqual([], self._requests)\n",
"self.assertIn(len(request), (3, 4))\n",
"self._requests = requests\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_3(VAR_11, VAR_12, VAR_13, VAR_14, VAR_15, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_33 = None\n",
"def FUNC_10(VAR_32, VAR_34):...\n",
"logging.info('Got signal %s', VAR_32)\n",
"VAR_7 = os.path.dirname(VAR_15)\n",
"if not os.path.isdir(VAR_7):\n",
"if not VAR_33:\n",
"if not os.path... | [
"def load_and_run(in_file, swarming_server, cost_usd_hour, start, out_file,...\n",
"\"\"\"docstring\"\"\"\n",
"task_result = None\n",
"def handler(sig, _):...\n",
"logging.info('Got signal %s', sig)\n",
"work_dir = os.path.dirname(out_file)\n",
"if not os.path.isdir(work_dir):\n",
"if not task_result:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_22(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.run_example('nonsense.py')\n",
"self.assertEqual(1, len(self.b_mgr.skipped))\n"
] | [
"def test_nonsense(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.run_example('nonsense.py')\n",
"self.assertEqual(1, len(self.b_mgr.skipped))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"string\"\"\"\n",
"VAR_17 = request.form.get('content')\n",
"VAR_18 = request.form.get('timePosted')\n",
"VAR_19 = request.form.get('eventTime')\n",
"VAR_20 = request.form.get('userId')\n",
"VAR_21 = request.form.get('username')\n",
"VAR_22 ... | [
"def post(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"\n # Check the request comes from appropriate location.\n if not utils.validate_ip(request.remote_addr)\n return {}, 403\n \"\"\"\n",
"message = request.form.get('content')\n",
"timeposted = request.form.get('timePoste... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"@staticmethod...\n",
"return ungettext_lazy(u'Deleted Key Pair', u'Deleted Key Pairs', VAR_2)\n"
] | [
"@staticmethod...\n",
"return ungettext_lazy(u'Deleted Key Pair', u'Deleted Key Pairs', count)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_23(VAR_33, VAR_13, VAR_20, VAR_21, VAR_12):...\n",
"if VAR_21 == wzrpc.status.success:\n",
"self.wz.set_req_handler(VAR_16, VAR_17, VAR_18)\n",
"if VAR_21 == wzrpc.status.e_req_denied:\n",
"self.log.debug('Succesfully binded route (%s, %s)', VAR_16, VAR_17)\n",
"self.log.warn('Status {0}, reauth... | [
"def accept(that, reqid, seqnum, status, data):...\n",
"if status == wzrpc.status.success:\n",
"self.wz.set_req_handler(i, m, f)\n",
"if status == wzrpc.status.e_req_denied:\n",
"self.log.debug('Succesfully binded route (%s, %s)', i, m)\n",
"self.log.warn('Status {0}, reauthentificating'.format(wzrpc.name... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"@VAR_0.route('/level-1/<page>')...\n",
"return render_template('level-1/' + VAR_7 + '.html')\n"
] | [
"@app.route('/level-1/<page>')...\n",
"return render_template('level-1/' + page + '.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"fork(['svn', 'checkout', self.url.geturl(), self.directory])\n"
] | [
"def checkout(self):...\n",
"fork(['svn', 'checkout', self.url.geturl(), self.directory])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"import os\n",
"import subprocess\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0 = subprocess.run(['/opt/tljh/user/bin/jupyter-serverextension',\n 'list', '--sys-prefix'], stderr=subprocess.PIPE)\n",
"VAR_1 = ['jupyterlab 0.35.3', 'nbgitpuller 0.6.1',\n 'nteract_on_jupyter 1.9.12', 'nbr... | [
"import os\n",
"import subprocess\n",
"def test_serverextensions():...\n",
"\"\"\"docstring\"\"\"\n",
"proc = subprocess.run(['/opt/tljh/user/bin/jupyter-serverextension', 'list',\n '--sys-prefix'], stderr=subprocess.PIPE)\n",
"extensions = ['jupyterlab 0.35.3', 'nbgitpuller 0.6.1',\n 'nteract_on_ju... | [
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assert'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assert'",
"Assert'",
"FunctionDef'",
"Docstring",
"Assert'"
] |
[
"from __future__ import unicode_literals\n",
"import json\n",
"from django.test import TestCase\n",
"def FUNC_0(self):...\n",
"VAR_1, VAR_2 = 'firstuser', 'password'\n",
"VAR_3 = 'autotest@deis.io'\n",
"VAR_4 = {'username': VAR_1, 'password': VAR_2, 'email': VAR_3}\n",
"VAR_5 = '/api/auth/register'\n"... | [
"from __future__ import unicode_literals\n",
"import json\n",
"from django.test import TestCase\n",
"def test_first_signup(self):...\n",
"username, password = 'firstuser', 'password'\n",
"email = 'autotest@deis.io'\n",
"submit = {'username': username, 'password': password, 'email': email}\n",
"url = '... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
5,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
... |
[
"def FUNC_0(self, VAR_0, VAR_1, VAR_2):...\n",
"return [name for name in cmd.commands().keys() if name.startswith(VAR_0)]\n"
] | [
"def complete(self, token, parsed, parser):...\n",
"return [name for name in cmd.commands().keys() if name.startswith(token)]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.threads = VAR_75\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.threads = threads\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"super().halt_dut('halt 3', ['- TARGET: core #0 has entered debug mode',\n '- TARGET: core #1 has entered debug mode'])\n"
] | [
"def halt_dut(self):...\n",
"super().halt_dut('halt 3', ['- TARGET: core #0 has entered debug mode',\n '- TARGET: core #1 has entered debug mode'])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"def FUNC_1():...\n",
"return FUNC_1\n"
] | [
"def a():...\n",
"def b():...\n",
"return b\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self, VAR_1, VAR_32):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1.shape != (2, 2):\n",
"VAR_1 = self.expand_one(VAR_1, VAR_32)\n",
"VAR_37 = np.vdot(self._state, VAR_1 @ self._state)\n",
"if np.abs(VAR_37.imag) > VAR_0:\n",
"log.warning('Nonvanishing imaginary part {} in expectation value.'... | [
"def ev(self, A, wires):...\n",
"\"\"\"docstring\"\"\"\n",
"if A.shape != (2, 2):\n",
"A = self.expand_one(A, wires)\n",
"expectation = np.vdot(self._state, A @ self._state)\n",
"if np.abs(expectation.imag) > tolerance:\n",
"log.warning('Nonvanishing imaginary part {} in expectation value.'.format(\n ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self, VAR_4, VAR_5):...\n",
"return True\n"
] | [
"def handle(self, request, data):...\n",
"return True\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_18(self):...\n",
"VAR_6 = None, '', False\n",
"for invalid in VAR_6:\n",
"next(open_zip(invalid).gen)\n"
] | [
"def test_open_zip_raises_exception_on_falsey_paths(self):...\n",
"falsey = None, '', False\n",
"for invalid in falsey:\n",
"next(open_zip(invalid).gen)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'"
] |
[
"@VAR_19.route('/test3')...\n",
"return 'OK'\n"
] | [
"@test_views.route('/test3')...\n",
"return 'OK'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"import collections\n",
"import os\n",
"import pymongo\n",
"from django.http import Http404\n",
"from cuckoo.core.database import Database, TASK_PENDING\n",
"from cuckoo.common.mongo import mongo\n",
"VAR_0 = Database()\n",
"@staticmethod...\n",
"if not isinstance(VAR_1, int):\n",
"VAR_9 = {}\n",
... | [
"import collections\n",
"import os\n",
"import pymongo\n",
"from django.http import Http404\n",
"from cuckoo.core.database import Database, TASK_PENDING\n",
"from cuckoo.common.mongo import mongo\n",
"db = Database()\n",
"@staticmethod...\n",
"if not isinstance(task_id, int):\n",
"data = {}\n",
... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
1,
0,
1,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1
] | [
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"... |
[
"def FUNC_9(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"FUNC_1(VAR_0)\n",
"os.chdir(VAR_0.folderName)\n",
"FUNC_8(VAR_0)\n"
] | [
"def repost_folder(args):...\n",
"\"\"\"docstring\"\"\"\n",
"get_folder_data(args)\n",
"os.chdir(args.folderName)\n",
"repost_ad(args)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"VAR_0 = self.current_course_instance.get_submitted_profiles()\n",
"self.assertEquals(1, len(VAR_0))\n",
"self.assertEquals('testUser', VAR_0[0].shortname)\n",
"VAR_1 = Submission.objects.create(exercise=self.base_exercise, grader=self.\n grader.userprofile)\n",
"VAR_1.submitt... | [
"def test_course_instance_submitters(self):...\n",
"students = self.current_course_instance.get_submitted_profiles()\n",
"self.assertEquals(1, len(students))\n",
"self.assertEquals('testUser', students[0].shortname)\n",
"submission2 = Submission.objects.create(exercise=self.base_exercise, grader\n =self.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"self.run_test_case(self.scenario.upsert_load_balancer(VAR_5=True))\n"
] | [
"def test_b_upsert_load_balancer_vpc(self):...\n",
"self.run_test_case(self.scenario.upsert_load_balancer(use_vpc=True))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"VAR_0 = {}\n",
"\"\"\"Configuration of remote applications.\"\"\"\n",
"VAR_1 = 'oauth_token'\n",
"\"\"\"Session key prefix used when storing the access token for a remote app.\"\"\"\n"
] | [
"\"\"\" Configuration variables for defining remote applications.\n\n================================ ==============================================\n`OAUTHCLIENT_REMOTE_APPS` Dictionary of remote applications. See example\n below. **Default:** ``{}``.\n`OAUTHCLIENT_SESSION_KE... | [
0,
0,
0,
0,
0
] | [
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_19(self, *VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"self.order.append(list(VAR_18))\n"
] | [
"def add(self, *rulenames):...\n",
"\"\"\"docstring\"\"\"\n",
"self.order.append(list(rulenames))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_12(**VAR_19):...\n",
"VAR_39 = {'name': VAR_19.get('name'), 'title': VAR_19.get('title')}\n",
"VAR_35 = FUNC_8('tasks/add', VAR_16=add_args)\n",
"VAR_43 = VAR_35.text\n",
"VAR_44 = re.search('/task/([0-9]+)$', VAR_35.url)\n",
"VAR_45 = re.search('/dataset/([0-9]+)', VAR_43)\n",
"if VAR_44 and ... | [
"def add_task(**kwargs):...\n",
"add_args = {'name': kwargs.get('name'), 'title': kwargs.get('title')}\n",
"r = admin_req('tasks/add', args=add_args)\n",
"response = r.text\n",
"match_task_id = re.search('/task/([0-9]+)$', r.url)\n",
"match_dataset_id = re.search('/dataset/([0-9]+)', response)\n",
"if m... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Return'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_8(self, VAR_8, VAR_9, VAR_10=None):...\n",
"VAR_21 = self._products.get_data(VAR_8)\n",
"if DependencyContext.global_instance().defaulted_property(VAR_9, lambda x:\n",
"VAR_26 = VAR_9.strict_dependencies(DependencyContext.global_instance())\n",
"VAR_26 = DependencyContext.global_instance().all_dep... | [
"def compile_classpath_entries(self, classpath_product_key, target,...\n",
"classpath_product = self._products.get_data(classpath_product_key)\n",
"if DependencyContext.global_instance().defaulted_property(target, lambda x:\n",
"dependencies = target.strict_dependencies(DependencyContext.global_instance())\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"VAR_9 = 'foo'\n",
"VAR_7 = BokChoyTestSuite('', VAR_9=test_dir)\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=test_dir))\n"
] | [
"def test_test_dir(self):...\n",
"test_dir = 'foo'\n",
"suite = BokChoyTestSuite('', test_dir=test_dir)\n",
"self.assertEqual(suite.cmd, self._expected_command(name=test_dir))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"import re\n",
"from lib.core.data import conf\n",
"from lib.core.settings import MATCH_RATIO\n",
"def FUNC_0(VAR_0, VAR_1=None, VAR_2=False):...\n",
"VAR_3 = None\n",
"if conf.eString and conf.eString in VAR_0:\n",
"VAR_4 = VAR_0.index(conf.eString)\n",
"if conf.eRegexp:\n",... | [
"\"\"\"\n$Id$\n\nThis file is part of the sqlmap project, http://sqlmap.sourceforge.net.\n\nCopyright (c) 2006-2008 Bernardo Damele A. G. <bernardo.damele@gmail.com>\n and Daniele Bellucci <daniele.bellucci@gmail.com>\n\nsqlmap is free software; you can redistribute it and/or modify it under\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"AugAssign'",
"For",
"Return'",
"Return'",
"Condition",
"Expr'",
"Assign'... |
[
"def FUNC_9(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if not isinstance(VAR_1, str):\n",
"self.validate()\n",
"return self._validated_executable(VAR_1)\n"
] | [
"def binary(self, name):...\n",
"\"\"\"docstring\"\"\"\n",
"if not isinstance(name, str):\n",
"self.validate()\n",
"return self._validated_executable(name)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_2(VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = 2.55 + 1\n",
"VAR_15 = float(len(VAR_4)) / VAR_14\n",
"VAR_16 = [word for word in re.split('\\\\W', VAR_4) if word.isalpha()]\n",
"VAR_17 = len(VAR_16)\n",
"return VAR_17 > VAR_15\n"
] | [
"def _is_english_text(text):...\n",
"\"\"\"docstring\"\"\"\n",
"avg_word_length = 2.55 + 1\n",
"expected_word_number = float(len(text)) / avg_word_length\n",
"words = [word for word in re.split('\\\\W', text) if word.isalpha()]\n",
"word_number = len(words)\n",
"return word_number > expected_word_number... | [
0,
0,
7,
7,
7,
7,
7
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self, VAR_64):...\n",
"self._onerror = VAR_64\n"
] | [
"def onerror(self, func):...\n",
"self._onerror = func\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_44(self):...\n",
"return self._names\n"
] | [
"def keys(self):...\n",
"return self._names\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_17(self, VAR_19, VAR_18, VAR_20):...\n",
"if VAR_18.collection:\n",
"VAR_30 = self._ds.get_collection(VAR_18.collection)\n",
"return 'X',\n",
"return VAR_30[0],\n"
] | [
"def get_parameters(self, key, levelctx, pathctxlist):...\n",
"if levelctx.collection:\n",
"coll = self._ds.get_collection(levelctx.collection)\n",
"return 'X',\n",
"return coll[0],\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"if not self.route:\n",
"return frappe.db.get_value('Blog Category', self.blog_category, 'route'\n ) + '/' + self.scrub(self.title)\n"
] | [
"def make_route(self):...\n",
"if not self.route:\n",
"return frappe.db.get_value('Blog Category', self.blog_category, 'route'\n ) + '/' + self.scrub(self.title)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"import logging\n",
"import os\n",
"from xml.sax import SAXParseException\n",
"from twisted.cred import credentials\n",
"from twisted.internet import defer\n",
"from twisted.web import util\n",
"from twisted.web.error import FlattenerError\n",
"from twisted.web.http import UNAUTHORIZED, OK\n",
"from... | [
"import logging\n",
"import os\n",
"from xml.sax import SAXParseException\n",
"from twisted.cred import credentials\n",
"from twisted.internet import defer\n",
"from twisted.web import util\n",
"from twisted.web.error import FlattenerError\n",
"from twisted.web.http import UNAUTHORIZED, OK\n",
"from... | [
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@classmethod...\n",
"return super(CLASS_0, VAR_6).subsystem_dependencies() + (JvmPlatform,)\n"
] | [
"@classmethod...\n",
"return super(JavacCompile, cls).subsystem_dependencies() + (JvmPlatform,)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"VAR_7 = Pa11yCrawler('')\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_7.pa11y_report_dir,\n VAR_7.start_urls))\n"
] | [
"def test_default(self):...\n",
"suite = Pa11yCrawler('')\n",
"self.assertEqual(suite.cmd, self._expected_command(suite.pa11y_report_dir,\n suite.start_urls))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self, VAR_11='', VAR_6=None):...\n",
"VAR_5 = self.session.query(self.obj)\n",
"VAR_5 = self._get_base_query(VAR_5=query, VAR_6=filters)\n",
"VAR_25 = VAR_5.all()\n",
"VAR_26 = GroupByDateMonth(VAR_11, 'Group by Month')\n",
"return VAR_26.apply(VAR_25)\n"
] | [
"def query_month_group(self, group_by='', filters=None):...\n",
"query = self.session.query(self.obj)\n",
"query = self._get_base_query(query=query, filters=filters)\n",
"query_result = query.all()\n",
"group = GroupByDateMonth(group_by, 'Group by Month')\n",
"return group.apply(query_result)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_1:\n",
"if not VAR_8:\n",
"VAR_8 = CLASS_0.get_report(VAR_1)['signatures']\n",
"VAR_9 = collections.OrderedDict()\n",
"for signature in VAR_8:\n",
"VAR_25 = signature['severity']\n",
"return VAR_9\n",
"if VAR_25 > 3:\n",
"VAR_25 = 3\n"... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if not task_id:\n",
"if not signatures:\n",
"signatures = AnalysisController.get_report(task_id)['signatures']\n",
"data = collections.OrderedDict()\n",
"for signature in signatures:\n",
"severity = signature['severity']\n",
"return data\n",
"if se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_25=''):...\n",
"self.marks = [(VAR_25, time.time())]\n",
"self.final = None\n"
] | [
"def __init__(self, name=''):...\n",
"self.marks = [(name, time.time())]\n",
"self.final = None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_13(self, VAR_10=None, VAR_14=None, VAR_15=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_15:\n",
"VAR_10 = sys.argv[1:] if VAR_10 is None else VAR_10\n",
"return super().parse_known_args(VAR_10, VAR_14)\n",
"VAR_10 = [a for a in VAR_10 if a != '-h' and a != '--help']\n"
] | [
"def parse_known_args(self, args=None, namespace=None, nohelp=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if nohelp:\n",
"args = sys.argv[1:] if args is None else args\n",
"return super().parse_known_args(args, namespace)\n",
"args = [a for a in args if a != '-h' and a != '--help']\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"@staticmethod...\n",
"if not VAR_1 or not VAR_6:\n",
"if not VAR_5:\n",
"VAR_5 = CLASS_0.get_report(VAR_1)['analysis']\n",
"VAR_16 = VAR_5['behavior']['generic']\n",
"VAR_17 = [z for z in VAR_16 if z['pid'] == VAR_6]\n",
"if not VAR_17:\n",
"VAR_17 = VAR_17[0]\n",
"VAR_9 = {}\n",
"for VAR_30, VAR... | [
"@staticmethod...\n",
"if not task_id or not pid:\n",
"if not report:\n",
"report = AnalysisController.get_report(task_id)['analysis']\n",
"behavior_generic = report['behavior']['generic']\n",
"process = [z for z in behavior_generic if z['pid'] == pid]\n",
"if not process:\n",
"process = process[0]\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"if self._session is not None:\n",
"if self._adapter is not None:\n",
"self._session.close()\n",
"self._adapter.close()\n"
] | [
"def _close(self):...\n",
"if self._session is not None:\n",
"if self._adapter is not None:\n",
"self._session.close()\n",
"self._adapter.close()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(VAR_11):...\n",
"return '/%s' % '/'.join(VAR_11)\n"
] | [
"def rebuild_path(url_parts):...\n",
"return '/%s' % '/'.join(url_parts)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@FUNC_7...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16.pop(VAR_17(VAR_1.name) + '_autoregister', None)\n",
"VAR_5 = FUNC_1(VAR_1, VAR_2)\n",
"VAR_19 = signup_handlers[VAR_1.name]\n",
"if not current_user.is_authenticated():\n",
"VAR_27 = VAR_19['info'](VAR_2)\n",
"if not VAR_5.remote_account.extra_data an... | [
"@oauth_error_handler...\n",
"\"\"\"docstring\"\"\"\n",
"session.pop(token_session_key(remote.name) + '_autoregister', None)\n",
"token = response_token_setter(remote, resp)\n",
"handlers = signup_handlers[remote.name]\n",
"if not current_user.is_authenticated():\n",
"account_info = handlers['info'](res... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
5
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Return'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name}\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'access',\n 'delete', '1')\n",
"self.mox.ReplayAll()\n",
"self.driver.terminate_connection(VAR_1,... | [
"def test_terminate_connection(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name}\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'access',\n 'delete', '1')\n",
"self.mox.ReplayAll()\n",
"self.driver.termina... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/')...\n",
"return render_template('home.html')\n"
] | [
"@app.route('/')...\n",
"return render_template('home.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"VAR_6 = 'SELECT MAX(bno) FROM bookings'\n",
"self.cursor.execute(VAR_6)\n",
"VAR_8 = self.cursor.fetchone()\n",
"return int(VAR_8[0]) + 1\n"
] | [
"def generate_bno(self):...\n",
"query = 'SELECT MAX(bno) FROM bookings'\n",
"self.cursor.execute(query)\n",
"max_bno = self.cursor.fetchone()\n",
"return int(max_bno[0]) + 1\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@app.route('/api/version')...\n",
"return app.config['version']\n"
] | [
"@app.route('/api/version')...\n",
"return app.config['version']\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"while True:\n",
"VAR_1 = input('$ ')\n",
"if len(VAR_1) > 0:\n",
"return VAR_1\n"
] | [
"def readline(self):...\n",
"\"\"\"docstring\"\"\"\n",
"while True:\n",
"raw = input('$ ')\n",
"if len(raw) > 0:\n",
"return raw\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_13():...\n",
"VAR_6.info('stats', VAR_52='24d92d16-770e-4088-b769-4020e127a7ff', **self.stats\n )\n"
] | [
"def logStats():...\n",
"logger.info('stats', uuid='24d92d16-770e-4088-b769-4020e127a7ff', **self.stats)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"if type(VAR_16) == str:\n",
"VAR_16 = self.locate(VAR_16)\n",
"VAR_48 = VAR_16.parent\n",
"if not VAR_16:\n",
"self._remove_recursive(VAR_16)\n",
"return False\n",
"if VAR_48:\n",
"VAR_48.sub_items.remove(VAR_16)\n",
"return True\n",... | [
"def remove(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"if type(path) == str:\n",
"path = self.locate(path)\n",
"par = path.parent\n",
"if not path:\n",
"self._remove_recursive(path)\n",
"return False\n",
"if par:\n",
"par.sub_items.remove(path)\n",
"return True\n",
"self._update_in_db(par... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Condition",
"Expr'",
"Return'",
"Expr'"
] |
[
"def FUNC_59(self):...\n",
"self.cursor.execute('select 1')\n",
"self.cursor.execute('select 1')\n",
"self.cursor.execute('select 1')\n"
] | [
"def test_no_fetch(self):...\n",
"self.cursor.execute('select 1')\n",
"self.cursor.execute('select 1')\n",
"self.cursor.execute('select 1')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_12(self, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = Urtext.get_path(self.view.window())\n",
"VAR_27 = VAR_12.name.split('->')[1].strip()\n",
"VAR_25 = CLASS_1(os.path.join(VAR_26, VAR_27))\n",
"self.errors.append('Broken link: -> %s\\n' % VAR_27)\n",
"for entry in VAR_25.entries:\n",... | [
"def add_children(self, parent):...\n",
"\"\"\"docstring\"\"\"\n",
"path = Urtext.get_path(self.view.window())\n",
"parent_filename = parent.name.split('->')[1].strip()\n",
"this_meta = NodeMetadata(os.path.join(path, parent_filename))\n",
"self.errors.append('Broken link: -> %s\\n' % parent_filename)\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.