lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_20(self, VAR_9=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(VAR_13.PROCESS_TYPE_MONITOR, VAR_9=check_alive)\n"
] | [
"def kill_monitor(self, check_alive=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(ray_constants.PROCESS_TYPE_MONITOR, check_alive=\n check_alive)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def __init__(self, *VAR_2, **VAR_3):...\n",
"super(CLASS_1, self).__init__(*VAR_2, **kwargs)\n",
"self.OIDC_OP_AUTH_ENDPOINT = import_from_settings(\n 'OIDC_OP_AUTHORIZATION_ENDPOINT')\n",
"self.OIDC_RP_CLIENT_ID = import_from_settings('OIDC_RP_CLIENT_ID')\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super(OIDCAuthenticationRequestView, self).__init__(*args, **kwargs)\n",
"self.OIDC_OP_AUTH_ENDPOINT = import_from_settings(\n 'OIDC_OP_AUTHORIZATION_ENDPOINT')\n",
"self.OIDC_RP_CLIENT_ID = import_from_settings('OIDC_RP_CLIENT_ID')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"if not FUNC_4('pdftotext'):\n",
"VAR_0.warning(\n 'GNU file was not found on the system. Switching to a weak file extension test.'\n )\n",
"VAR_9 = os.popen('file ' + re.escape(VAR_2)).read()\n",
"if VAR_2.lower().endswith('.pdf'):\n",
"VAR_19... | [
"def is_pdf(document):...\n",
"\"\"\"docstring\"\"\"\n",
"if not executable_exists('pdftotext'):\n",
"log.warning(\n 'GNU file was not found on the system. Switching to a weak file extension test.'\n )\n",
"file_output = os.popen('file ' + re.escape(document)).read()\n",
"if document.lower().endswit... | [
0,
0,
0,
0,
0,
0,
7,
7,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_8(self, VAR_8, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.fileExists(VAR_8):\n",
"VAR_7 = \"UPDATE {0} SET mod_time={1} WHERE path='{2}';\".format(VAR_2, VAR_9,\n VAR_8)\n",
"print(\"updateModTime: file doesn't exist!\")\n",
"self._run_command(VAR_7)\n"
] | [
"def updateModTime(self, pth, mod_time):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.fileExists(pth):\n",
"command = \"UPDATE {0} SET mod_time={1} WHERE path='{2}';\".format(TABLE_NAME,\n mod_time, pth)\n",
"print(\"updateModTime: file doesn't exist!\")\n",
"self._run_command(command)\n"
] | [
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@wraps(VAR_5)...\n",
"VAR_26 = json.dumps(VAR_5(*VAR_18, **kwargs) or {'error':\n 'No data found for your request'}, default=serialize_to_json)\n",
"VAR_63 = [('Content-Type', 'application/json'), ('Content-Length', str(len(\n VAR_26)))]\n",
"return Response(VAR_26, status=200, VAR_63=headers)\n"
] | [
"@wraps(func)...\n",
"result = json.dumps(func(*args, **kwargs) or {'error':\n 'No data found for your request'}, default=serialize_to_json)\n",
"headers = [('Content-Type', 'application/json'), ('Content-Length', str(len\n (result)))]\n",
"return Response(result, status=200, headers=headers)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self, VAR_9):...\n",
"if not self.logged_in():\n",
"print('shrub: unauthenticated; use \"login [username] to log in first')\n",
"VAR_20 = self.send_cmd('list_issues{} {}'.format(self.insecure_mode, VAR_9))\n",
"return\n",
"print(VAR_20)\n"
] | [
"def do_list_issues(self, line):...\n",
"if not self.logged_in():\n",
"print('shrub: unauthenticated; use \"login [username] to log in first')\n",
"response = self.send_cmd('list_issues{} {}'.format(self.insecure_mode, line))\n",
"return\n",
"print(response)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"return 'check submission %s' % self.submission_id\n"
] | [
"def describe(self):...\n",
"return 'check submission %s' % self.submission_id\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8():...\n",
"if FUNC_7():\n",
"VAR_29 = json.loads(FUNC_0(VAR_0['cache_file_32bit']))\n",
"VAR_9 = FUNC_2()\n",
"VAR_30 = json.loads(FUNC_0(VAR_0['cache_file_64bit']))\n",
"VAR_29 = FUNC_6(VAR_9, VAR_1)\n",
"return VAR_29, VAR_30\n",
"VAR_30 = FUNC_6(VAR_9, VAR_2)\n",
"FUNC_1(VAR_0['cache_... | [
"def check_cache():...\n",
"if cache_files_exist():\n",
"syscalls_32bit = json.loads(read_file_content(CONFIG['cache_file_32bit']))\n",
"syscall_names = parse_syscall_names()\n",
"syscalls_64bit = json.loads(read_file_content(CONFIG['cache_file_64bit']))\n",
"syscalls_32bit = generate_syscalls(syscall_nam... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"return self.data['count']\n"
] | [
"def count(self):...\n",
"return self.data['count']\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_46 = None\n",
"if self.xsrf_token_header:\n",
"VAR_46 = self.request.headers.get(self.xsrf_token_header)\n",
"if not VAR_46 and self.xsrf_token_request_param:\n",
"VAR_53 = self.request.get_all(self.xsrf_token_request_param)\n",
"return VAR_46\n",
"V... | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"token = None\n",
"if self.xsrf_token_header:\n",
"token = self.request.headers.get(self.xsrf_token_header)\n",
"if not token and self.xsrf_token_request_param:\n",
"param = self.request.get_all(self.xsrf_token_request_param)\n",
"return token\n",
"token ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"@VAR_0.route('/email/resend', methods=['POST'])...\n",
"VAR_11 = dict()\n",
"VAR_6 = request.form.get('email')\n",
"VAR_10 = User.query.filter_by(VAR_6=request.form.get('email')).first()\n",
"if '@' not in VAR_6:\n",
"VAR_11['email'] = 'Please check your e-mail address is valid.'\n",
"if VAR_10:\n",
... | [
"@app.route('/email/resend', methods=['POST'])...\n",
"error = dict()\n",
"email = request.form.get('email')\n",
"u = User.query.filter_by(email=request.form.get('email')).first()\n",
"if '@' not in email:\n",
"error['email'] = 'Please check your e-mail address is valid.'\n",
"if u:\n",
"return make_r... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_5 = CLASS_0._get_report(VAR_1)\n",
"if not VAR_5:\n",
"VAR_9 = {'analysis': VAR_5}\n",
"VAR_13 = CLASS_0._get_dnsinfo(VAR_5)\n",
"VAR_9.update(VAR_13)\n",
"return VAR_9\n"
] | [
"@staticmethod...\n",
"report = AnalysisController._get_report(task_id)\n",
"if not report:\n",
"data = {'analysis': report}\n",
"dnsinfo = AnalysisController._get_dnsinfo(report)\n",
"data.update(dnsinfo)\n",
"return data\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_19 = self.common.create_cloned_volume(VAR_6, VAR_7)\n",
"self.common.client_logout()\n",
"return {'metadata': VAR_19}\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"new_vol = self.common.create_cloned_volume(volume, src_vref)\n",
"self.common.client_logout()\n",
"return {'metadata': new_vol}\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_25(VAR_3, VAR_6):...\n",
"VAR_38 = FUNC_1(VAR_3)\n",
"VAR_45, VAR_41 = VAR_38.accept()\n",
"return Connection(VAR_45, VAR_38)\n"
] | [
"def connect(addr, timeout):...\n",
"server = create_server(addr)\n",
"client, _ = server.accept()\n",
"return Connection(client, server)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@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_18(self, VAR_7):...\n",
"self.__process_text(VAR_7)\n",
"self.__process_percent(VAR_7)\n"
] | [
"def __process_status(self, job_id):...\n",
"self.__process_text(job_id)\n",
"self.__process_percent(job_id)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"return expm(-1.0j * VAR_8 / 2 * VAR_4)\n"
] | [
"def fry(theta):...\n",
"\"\"\"docstring\"\"\"\n",
"return expm(-1.0j * theta / 2 * Y)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_35(VAR_29):...\n",
"VAR_40 = VAR_29.group('name')\n",
"VAR_16 = VAR_11[VAR_40]\n",
"if VAR_15:\n",
"if VAR_13 and VAR_16 == VAR_14:\n",
"return '{{{}}}'.format(VAR_40)\n",
"if VAR_12:\n",
"return str(VAR_16)\n",
"return VAR_14\n"
] | [
"def format_match(match):...\n",
"name = match.group('name')\n",
"value = wildcards[name]\n",
"if keep_dynamic:\n",
"if fail_dynamic and value == dynamic_fill:\n",
"return '{{{}}}'.format(name)\n",
"if fill_missing:\n",
"return str(value)\n",
"return dynamic_fill\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"if self._user_notified_about_crash or self._IsServerAlive():\n",
"return\n",
"self._user_notified_about_crash = True\n",
"if self._server_stderr:\n",
"VAR_27 = ''.join(server_stderr_file.readlines()[:-VAR_1])\n",
"vimsupport.PostVimMessage(VAR_3)\n",
"vimsupport.PostMultiLin... | [
"def _NotifyUserIfServerCrashed(self):...\n",
"if self._user_notified_about_crash or self._IsServerAlive():\n",
"return\n",
"self._user_notified_about_crash = True\n",
"if self._server_stderr:\n",
"error_output = ''.join(server_stderr_file.readlines()[:-\n NUM_YCMD_STDERR_LINES_ON_CRASH])\n",
"vimsup... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_8=False):...\n",
"if not self.NativeFiletypeCompletionAvailable(\n",
"self._latest_completion_request = OmniCompletionRequest(self._omnicomp)\n",
"VAR_5 = {}\n",
"return self._latest_completion_request\n",
"self._AddExtraConfDataIfNeeded(VAR_5)\n",
"if VAR_8:\n",
"VAR_5['force_se... | [
"def CreateCompletionRequest(self, force_semantic=False):...\n",
"if not self.NativeFiletypeCompletionAvailable(\n",
"self._latest_completion_request = OmniCompletionRequest(self._omnicomp)\n",
"extra_data = {}\n",
"return self._latest_completion_request\n",
"self._AddExtraConfDataIfNeeded(extra_data)\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_12(self, VAR_10=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = vars(self.parse_known_args(VAR_15=True)[0])\n",
"VAR_13 = VAR_30.get('image_mode', None)\n",
"if VAR_13 is not None and VAR_13 != 'none':\n",
"self.add_image_args(VAR_13)\n",
"VAR_12 = VAR_30.get('task', None)\n",
"if VAR_12 ... | [
"def add_extra_args(self, args=None):...\n",
"\"\"\"docstring\"\"\"\n",
"parsed = vars(self.parse_known_args(nohelp=True)[0])\n",
"image_mode = parsed.get('image_mode', None)\n",
"if image_mode is not None and image_mode != 'none':\n",
"self.add_image_args(image_mode)\n",
"task = parsed.get('task', None... | [
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_2=False):...\n",
"VAR_12 = 'campaign-data/' + str(self.campaign_data['id'])\n",
"if VAR_2:\n",
"VAR_12 += '/aux-files/'\n",
"VAR_12 += '/dut-files/'\n",
"VAR_11 = []\n",
"for item in os.listdir(VAR_12):\n",
"VAR_11.append(VAR_12 + item)\n",
"if VAR_2:\n",
"self.debugger.aux.s... | [
"def send_dut_files(self, aux=False):...\n",
"location = 'campaign-data/' + str(self.campaign_data['id'])\n",
"if aux:\n",
"location += '/aux-files/'\n",
"location += '/dut-files/'\n",
"files = []\n",
"for item in os.listdir(location):\n",
"files.append(location + item)\n",
"if aux:\n",
"self.debu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"AugAssign'",
"AugAssign'",
"Assign'",
"For",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@http.route(['/fit_subscribe_controller/subscribe'], type='http', auth=...\n",
"VAR_1 = int(VAR_1)\n",
"VAR_2 = VAR_2\n",
"VAR_4 = http.request.env['event.event'].sudo().browse(VAR_1)\n",
"VAR_6 = 0\n",
"VAR_5 = http.request.env.user.partner_id\n",
"VAR_7 = int(VAR_5.id)\n",
"if VAR_2:\n",
"for reg... | [
"@http.route(['/fit_subscribe_controller/subscribe'], type='http', auth=...\n",
"event_id = int(event_id)\n",
"event_is_participating = event_is_participating\n",
"event = http.request.env['event.event'].sudo().browse(event_id)\n",
"subscription_update_counter = 0\n",
"partner = http.request.env.user.part... | [
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,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"For",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
... |
[
"def FUNC_1(self, VAR_1, VAR_2=1):...\n",
"\"\"\"docstring\"\"\"\n",
"self.log_error(VAR_1)\n",
"self.close_all_connections()\n",
"sys.exit(VAR_2)\n"
] | [
"def _exit(self, msg, error=1):...\n",
"\"\"\"docstring\"\"\"\n",
"self.log_error(msg)\n",
"self.close_all_connections()\n",
"sys.exit(error)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self):...\n",
"self.filteredImagesCache = []\n",
"if not self.randomImageFilter:\n",
"return\n",
"VAR_33 = self.randomImageFilter.lower()\n",
"for imagePath in VAR_4:\n",
"if VAR_33 in imagePath.lower():\n",
"print('\\tFiltered images with \"{}\"; {} images matching filter'.format(self.\n... | [
"def cacheFilteredImages(self):...\n",
"self.filteredImagesCache = []\n",
"if not self.randomImageFilter:\n",
"return\n",
"randomImageFilterLower = self.randomImageFilter.lower()\n",
"for imagePath in savedImagesCache:\n",
"if randomImageFilterLower in imagePath.lower():\n",
"print('\\tFiltered images... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_16(self):...\n",
"if self.doctype not in VAR_54.local.valid_columns:\n",
"if self.doctype in ('DocField', 'DocPerm') and self.parent in ('DocType',\n",
"return VAR_54.local.valid_columns[self.doctype]\n",
"from frappe.model.meta import get_table_columns\n",
"VAR_65 = self.meta.get_valid_columns(... | [
"def get_valid_columns(self):...\n",
"if self.doctype not in frappe.local.valid_columns:\n",
"if self.doctype in ('DocField', 'DocPerm') and self.parent in ('DocType',\n",
"return frappe.local.valid_columns[self.doctype]\n",
"from frappe.model.meta import get_table_columns\n",
"valid = self.meta.get_valid... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self\n",
"VAR_12 = []\n",
"VAR_5 = model.Identity(model.IDENTITY_USER, 'joe@example.com')\n",
"def FUNC_27(VAR_13):...\n",
"self.assertEqual('/request', VAR_13.path)\n",
"VAR_12.append('not_applicable')\n",
"return None\n"
] | [
"def test_auth_method_order(self):...\n",
"\"\"\"docstring\"\"\"\n",
"test = self\n",
"calls = []\n",
"ident = model.Identity(model.IDENTITY_USER, 'joe@example.com')\n",
"def not_applicable(request):...\n",
"self.assertEqual('/request', request.path)\n",
"calls.append('not_applicable')\n",
"return N... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"if not VAR_101.user_is_admin:\n",
"abort(404, 'page not found')\n"
] | [
"def run(self):...\n",
"if not c.user_is_admin:\n",
"abort(404, 'page not found')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0.debug(_('Updating volume stats'))\n",
"VAR_34 = {}\n",
"VAR_35 = 'eqlx'\n",
"if self.configuration:\n",
"VAR_35 = self.configuration.safe_get('volume_backend_name')\n",
"VAR_34['volume_backend_name'] = VAR_35 or 'eqlx'\n",
"VAR_34['vendor_n... | [
"def _update_volume_stats(self):...\n",
"\"\"\"docstring\"\"\"\n",
"LOG.debug(_('Updating volume stats'))\n",
"data = {}\n",
"backend_name = 'eqlx'\n",
"if self.configuration:\n",
"backend_name = self.configuration.safe_get('volume_backend_name')\n",
"data['volume_backend_name'] = backend_name or 'eql... | [
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",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_10(VAR_12, VAR_5):...\n",
"return any(VAR_12[col_name] in values_list for col_name, values_list in\n VAR_5.items())\n"
] | [
"def _match_any_filters(element_year, filters):...\n",
"return any(element_year[col_name] in values_list for col_name, values_list in\n filters.items())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_1, VAR_2, VAR_3='', VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_4(VAR_1, VAR_2['access_token'], VAR_6='', VAR_3=token_type,\n VAR_4=extra_data)\n"
] | [
"def oauth2_token_setter(remote, resp, token_type='', extra_data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return token_setter(remote, resp['access_token'], secret='', token_type=\n token_type, extra_data=extra_data)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"\"\"\"\nUnit tests for the SIEVE language parser.\n\"\"\"\n",
"from sievelib.parser import Parser\n",
"import sievelib.commands\n",
"import unittest\n",
"import cStringIO\n",
"VAR_0 = [{'name': 'testtag', 'type': ['tag'], 'write_tag': True, 'values':\n [':testtag'], 'extra_arg': {'type': 'number', 're... | [
"\"\"\"\nUnit tests for the SIEVE language parser.\n\"\"\"\n",
"from sievelib.parser import Parser\n",
"import sievelib.commands\n",
"import unittest\n",
"import cStringIO\n",
"args_definition = [{'name': 'testtag', 'type': ['tag'], 'write_tag': True,\n 'values': [':testtag'], 'extra_arg': {'type': 'nu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Assign'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Expr'",
"Expr'",
"... |
[
"def __init__(self, VAR_18, VAR_35=100, **VAR_16):...\n",
"CLASS_17.__init__(self, VAR_18, VAR_35=length, VAR_37=errors.\n LOCATION_TOO_LONG, VAR_36=None, **kw)\n"
] | [
"def __init__(self, item, length=100, **kw):...\n",
"VLength.__init__(self, item, length=length, length_error=errors.\n LOCATION_TOO_LONG, empty_error=None, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_1):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = \"INSERT INTO crimes (description) VALUES ('{}');\".format(VAR_1)\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"VAR_2.commit()\n"
] | [
"def add_input(self, data):...\n",
"connection = self.connect()\n",
"query = \"INSERT INTO crimes (description) VALUES ('{}');\".format(data)\n",
"connection.close()\n",
"cursor.execute(query)\n",
"connection.commit()\n"
] | [
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._get_users_api().get_current_user(self.request)\n"
] | [
"def get_current_user(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._get_users_api().get_current_user(self.request)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_6(self, VAR_33):...\n",
"if VAR_33 and self.valid_re.match(VAR_33):\n",
"return self.splitter.split(VAR_33)\n"
] | [
"def run(self, val):...\n",
"if val and self.valid_re.match(val):\n",
"return self.splitter.split(val)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_1(self, VAR_4):...\n",
"VAR_28 = decimal.Context(prec=self.max_digits)\n",
"return VAR_4.quantize(decimal.Decimal(1), VAR_28=context\n ) if VAR_4 == VAR_4.to_integral() else VAR_4.normalize(VAR_28)\n"
] | [
"def _transform_decimal(self, value):...\n",
"context = decimal.Context(prec=self.max_digits)\n",
"return value.quantize(decimal.Decimal(1), context=context\n ) if value == value.to_integral() else value.normalize(context)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_23 = []\n",
"VAR_24 = []\n",
"for VAR_21 in range(0, self.dim_x):\n",
"for VAR_22 in range(0, self.dim_y):\n",
"VAR_24.append(str(self.board[VAR_21][VAR_22]))\n",
"print(''.join(VAR_24))\n",
"VAR_24 = []\n"
] | [
"def print_board(self):...\n",
"x_str = []\n",
"y_str = []\n",
"for x in range(0, self.dim_x):\n",
"for y in range(0, self.dim_y):\n",
"y_str.append(str(self.board[x][y]))\n",
"print(''.join(y_str))\n",
"y_str = []\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"For",
"Expr'",
"Expr'",
"Assign'"
] |
[
"@FUNC_0...\n",
"VAR_27 = VAR_10.get_transport()\n",
"VAR_7 = VAR_27.open_session()\n",
"VAR_7.invoke_shell()\n",
"VAR_0.debug(_('Reading CLI MOTD'))\n",
"self._get_output(VAR_7)\n",
"VAR_28 = 'stty columns 255'\n",
"VAR_0.debug(_(\"Setting CLI terminal width: '%s'\"), VAR_28)\n",
"VAR_7.send(VAR_28... | [
"@with_timeout...\n",
"transport = ssh.get_transport()\n",
"chan = transport.open_session()\n",
"chan.invoke_shell()\n",
"LOG.debug(_('Reading CLI MOTD'))\n",
"self._get_output(chan)\n",
"cmd = 'stty columns 255'\n",
"LOG.debug(_(\"Setting CLI terminal width: '%s'\"), cmd)\n",
"chan.send(cmd + '\\r'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Return'",
"Assign'",
"Expr'"
] |
[
"@Endpoint('GET', '/fsals')...\n",
"return Ganesha.fsals_available()\n"
] | [
"@Endpoint('GET', '/fsals')...\n",
"return Ganesha.fsals_available()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_19(self, VAR_6, VAR_14):...\n",
"self.common.extend_volume(VAR_6, VAR_14)\n"
] | [
"def extend_volume(self, volume, new_size):...\n",
"self.common.extend_volume(volume, new_size)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@odin.assign_field...\n",
"return 'Foo'\n"
] | [
"@odin.assign_field...\n",
"return 'Foo'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_33(self, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.warn('Handling SAML errors')\n",
"VAR_26 = {'message': 'SAML request failed', 'errors': VAR_11.get_errors(),\n 'reason': VAR_11.get_last_error_reason(), 'request_id': VAR_11.\n get_last_request_id()}\n",
"logging.warn('Errors: {0}'... | [
"def _render_saml_errors_json(self, auth):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.warn('Handling SAML errors')\n",
"data = {'message': 'SAML request failed', 'errors': auth.get_errors(),\n 'reason': auth.get_last_error_reason(), 'request_id': auth.\n get_last_request_id()}\n",
"logging.warn('Error... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9, VAR_10 = VAR_0.partition(' ')[::2]\n",
"VAR_11 = cmd.get_command(VAR_9)\n",
"VAR_12 = self.tokenizer.tokenize(VAR_10.strip())\n",
"return VAR_11(self), VAR_12\n"
] | [
"def parse_line(self, line):...\n",
"\"\"\"docstring\"\"\"\n",
"cmd_name, cmd_args = line.partition(' ')[::2]\n",
"command_cls = cmd.get_command(cmd_name)\n",
"tokenized_cmd_args = self.tokenizer.tokenize(cmd_args.strip())\n",
"return command_cls(self), tokenized_cmd_args\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(VAR_5):...\n",
"for i in VAR_5:\n",
"if i not in string.ascii_letters and i not in string.digits:\n",
"return True\n",
"return False\n"
] | [
"def is_valid_username(uname):...\n",
"for i in uname:\n",
"if i not in string.ascii_letters and i not in string.digits:\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self):...\n",
"Tester.__init__(self, 'NavLoc')\n",
"self.jerky = False\n",
"self.walking_speed = 1\n",
"self.reached_goal = False\n",
"self.reached_corner = [False, False, False, False]\n",
"self.cc_square = [(0, 0), (1, 0), (1, 1), (0, 1)]\n",
"self.c_square = [(0, 0), (1, 0), (1, -1), ... | [
"def __init__(self):...\n",
"Tester.__init__(self, 'NavLoc')\n",
"self.jerky = False\n",
"self.walking_speed = 1\n",
"self.reached_goal = False\n",
"self.reached_corner = [False, False, False, False]\n",
"self.cc_square = [(0, 0), (1, 0), (1, 1), (0, 1)]\n",
"self.c_square = [(0, 0), (1, 0), (1, -1), ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_16(self, VAR_16, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_46 = self.configuration.volume_name_template % VAR_19['id']\n",
"VAR_0.error(_('Failed to create clone of volume %s'), VAR_16['name'])\n",
"VAR_25 = self._eql_execute('volume', 'select', VAR_46, 'clone', VAR_16['name'])\n",
"return... | [
"def create_cloned_volume(self, volume, src_vref):...\n",
"\"\"\"docstring\"\"\"\n",
"src_volume_name = self.configuration.volume_name_template % src_vref['id']\n",
"LOG.error(_('Failed to create clone of volume %s'), volume['name'])\n",
"out = self._eql_execute('volume', 'select', src_volume_name, 'clone',... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, **VAR_2):...\n",
"CLASS_0.invalidate(VAR_1.recipient.user)\n"
] | [
"def invalidate_notifications(sender, instance, **kwargs):...\n",
"CachedNotifications.invalidate(instance.recipient.user)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_24(self, VAR_37='/tmp/soledad-test/test'):...\n",
"return os.path.join(VAR_37, str(VAR_1.uuid4()))\n"
] | [
"def _generate_soledad_test_folder_name(self, soledad_test_folder=...\n",
"return os.path.join(soledad_test_folder, str(uuid.uuid4()))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(VAR_0):...\n",
"VAR_6 = sqlite3.connect('database.db')\n",
"VAR_7 = VAR_6.cursor()\n",
"VAR_8 = getBotUsername()\n",
"for VAR_1 in VAR_0:\n",
"if VAR_7.execute(\n",
"VAR_6.close()\n",
"VAR_14 = False\n",
"for reply in VAR_1.comments:\n",
"if not VAR_14 and FUNC_5(VAR_1) <= FUNC_6(VAR_1... | [
"def checkForSeriesSubmissions(submissionList):...\n",
"database = sqlite3.connect('database.db')\n",
"cursor = database.cursor()\n",
"botUsername = getBotUsername()\n",
"for submission in submissionList:\n",
"if cursor.execute(\n",
"database.close()\n",
"alreadyPosted = False\n",
"for reply in subm... | [
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Assign'",
"For",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"if self._services is None:\n",
"VAR_79 = mock(Services)\n",
"return self._services\n",
"VAR_79.keymanager = self.keymanager\n",
"VAR_79.mail_service = self.mail_service\n",
"VAR_79.draft_service = self.draft_service\n",
"VAR_79.search_engine = self.search_engine\n",
"VAR_79.feedba... | [
"@property...\n",
"if self._services is None:\n",
"services = mock(Services)\n",
"return self._services\n",
"services.keymanager = self.keymanager\n",
"services.mail_service = self.mail_service\n",
"services.draft_service = self.draft_service\n",
"services.search_engine = self.search_engine\n",
"ser... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_2, VAR_3, VAR_4, *VAR_5):...\n",
"self.write_data({'type': 'upgrader_finished'})\n"
] | [
"def on_upgrader_finished(self, subject, changetype, objectID, *args):...\n",
"self.write_data({'type': 'upgrader_finished'})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_13(self, *VAR_16, **VAR_10):...\n",
"if not self.is_group_user(VAR_8):\n",
"return VAR_7(self, *VAR_16, **kwargs)\n"
] | [
"def wrapper(self, *args, **kwargs):...\n",
"if not self.is_group_user(group):\n",
"return method(self, *args, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_29(VAR_39):...\n",
"if not VAR_39 or VAR_39 == 'None':\n",
"VAR_39 = datetime.today().strftime('%Y-%m-%d')\n",
"VAR_39 = VAR_39[:10]\n",
"return datetime.strptime(VAR_39, '%Y-%m-%d')\n"
] | [
"def str_to_datetime(str):...\n",
"if not str or str == 'None':\n",
"str = datetime.today().strftime('%Y-%m-%d')\n",
"str = str[:10]\n",
"return datetime.strptime(str, '%Y-%m-%d')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_18, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"self.auth = VAR_18\n",
"self.data = None\n",
"self.station_data = None\n",
"self.station = VAR_19\n"
] | [
"def __init__(self, auth, station):...\n",
"\"\"\"docstring\"\"\"\n",
"self.auth = auth\n",
"self.data = None\n",
"self.station_data = None\n",
"self.station = station\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'GNAT', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='NAT', VAR_10=[{'name': '----NAT'}, {'name':\n 'GNAT'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'GNAT', id='1')\n",
"verify_results(client, jwt, query='NAT', expected=[{'name': '----NAT'}, {\n 'name': 'GNAT'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/<page_name>/history')...\n",
"VAR_3 = VAR_1.query('string' % VAR_2)\n",
"VAR_11 = VAR_3.namedresult()\n",
"return render_template('page_history.html', VAR_2=page_name, VAR_11=\n page_histories)\n"
] | [
"@app.route('/<page_name>/history')...\n",
"query = db.query(\n \"select page_content.timestamp, page_content.id from page, page_content where page.id = page_content.page_id and page.page_name = '%s'\"\n % page_name)\n",
"page_histories = query.namedresult()\n",
"return render_template('page_history.ht... | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'FEEL', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='FILL', VAR_10=[{'name': '----FILL'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'FEEL', id='1')\n",
"verify_results(client, jwt, query='FILL', expected=[{'name': '----FILL'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_7):...\n",
"if VAR_7.model_class._meta.primary_key:\n",
"VAR_28 = VAR_7.values['id']\n",
"VAR_19 = ','.join([VAR_45.encode('utf-8') for VAR_45 in VAR_7.values.keys()])\n",
"VAR_20 = ','.join([VAR_45.encode('utf-8') for VAR_45 in VAR_7.values.values()])\n",
"if VAR_7.model_class._met... | [
"def generate_update(self, query):...\n",
"if query.model_class._meta.primary_key:\n",
"_id = query.values['id']\n",
"keys = ','.join([x.encode('utf-8') for x in query.values.keys()])\n",
"values = ','.join([x.encode('utf-8') for x in query.values.values()])\n",
"if query.model_class._meta.primary_key:\n"... | [
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"AugAssign'",
"AugAssign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"return self.get_secure_cookie('user')\n"
] | [
"def get_current_user(self):...\n",
"return self.get_secure_cookie('user')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1.info('Setting up user environment...')\n",
"VAR_12 = '4.5.4'\n",
"VAR_13 = 'a946ea1d0c4a642ddf0c3a26a18bb16d'\n",
"if not conda.check_miniconda_version(USER_ENV_PREFIX, VAR_12):\n",
"VAR_1.info('Downloading & setting up user environment...')\n... | [
"def ensure_user_environment(user_requirements_txt_file):...\n",
"\"\"\"docstring\"\"\"\n",
"logger.info('Setting up user environment...')\n",
"miniconda_version = '4.5.4'\n",
"miniconda_installer_md5 = 'a946ea1d0c4a642ddf0c3a26a18bb16d'\n",
"if not conda.check_miniconda_version(USER_ENV_PREFIX, miniconda... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"VAR_5 = Mock()\n",
"VAR_5.sendmail.side_effect = lambda VAR_68: succeed(VAR_68)\n",
"return VAR_5\n"
] | [
"def _create_mail_sender(self):...\n",
"mail_sender = Mock()\n",
"mail_sender.sendmail.side_effect = lambda mail: succeed(mail)\n",
"return mail_sender\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"CLASS_1.query.filter(CLASS_1.to_user_id == VAR_21, CLASS_1.id.in_(VAR_22)\n ).delete(synchronize_session=False)\n",
"db.session.commit()\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"Message.query.filter(Message.to_user_id == user_id, Message.id.in_(message_ids)\n ).delete(synchronize_session=False)\n",
"db.session.commit()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"@wraps(VAR_5)...\n",
"VAR_26 = json.dumps(VAR_5(*VAR_18, **kwargs) or {'error':\n 'No data found for your request'}, default=serialize_to_json)\n",
"VAR_63 = [('Content-Type', 'application/json'), ('Content-Length', str(len(\n VAR_26)))]\n",
"re... | [
"def json_response(func):...\n",
"\"\"\"docstring\"\"\"\n",
"@wraps(func)...\n",
"result = json.dumps(func(*args, **kwargs) or {'error':\n 'No data found for your request'}, default=serialize_to_json)\n",
"headers = [('Content-Type', 'application/json'), ('Content-Length', str(len\n (result)))]\n",
... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, *VAR_2, **VAR_1):...\n",
"if VAR_1.pop('add_xsrf_token', True):\n",
"VAR_1 = self._set_xsrf_headers(VAR_1)\n",
"VAR_0 = super(CLASS_0, self).put(*VAR_2, **kwargs)\n",
"self._store_xsrf_token(VAR_0)\n",
"return VAR_0\n"
] | [
"def put(self, *args, **kwargs):...\n",
"if kwargs.pop('add_xsrf_token', True):\n",
"kwargs = self._set_xsrf_headers(kwargs)\n",
"response = super(Session, self).put(*args, **kwargs)\n",
"self._store_xsrf_token(response)\n",
"return response\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"Test creating a Push via the API\"\"\"\n",
"self.client.login(VAR_8='autotest2', VAR_9='password')\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
... | [
"def test_admin_can_hook(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"Test creating a Push via the API\"\"\"\n",
"self.client.login(username='autotest2', password='password')\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = ... | [
0,
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@VAR_1.route('/signup', methods=['POST'])...\n",
"VAR_12 = request.form['email']\n",
"VAR_13 = query_user(VAR_12)\n",
"if VAR_13 == None:\n",
"VAR_14 = request.form['password']\n",
"flash('Email already in use')\n",
"VAR_19 = generate_password_hash(VAR_14)\n",
"return redirect('/signup')\n",
"inser... | [
"@app.route('/signup', methods=['POST'])...\n",
"email = request.form['email']\n",
"user = query_user(email)\n",
"if user == None:\n",
"password = request.form['password']\n",
"flash('Email already in use')\n",
"password_hash = generate_password_hash(password)\n",
"return redirect('/signup')\n",
"in... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"async def FUNC_2(self, VAR_5):...\n",
"if isinstance(VAR_5, RequestResponsePair):\n",
"self.stats['requests'] += 1\n",
"if not VAR_5.response:\n",
"self.stats['failed'] += 1\n",
"self.stats['finished'] += 1\n",
"self.stats['bytesRcv'] += VAR_5.response.bytesReceived\n"
] | [
"async def push(self, item):...\n",
"if isinstance(item, RequestResponsePair):\n",
"self.stats['requests'] += 1\n",
"if not item.response:\n",
"self.stats['failed'] += 1\n",
"self.stats['finished'] += 1\n",
"self.stats['bytesRcv'] += item.response.bytesReceived\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"AugAssign'",
"AugAssign'"
] |
[
"def FUNC_6(VAR_0, VAR_5, VAR_6, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_7:\n",
"print('FILL NULL FAILED WITH FOLLOWING MESSAGE:\\n' + str(e))\n",
"db.engine.execute(\n 'UPDATE \"{0}\" SET \"{1}\" = \\'{2}\\' WHERE (\"{1}\" = \\'\\') IS NOT FALSE'.\n format(VAR_0, VAR_5, VAR_6))\n",
"db.en... | [
"def fill_null_with(table_name, attr, value, text_type):...\n",
"\"\"\"docstring\"\"\"\n",
"if text_type:\n",
"print('FILL NULL FAILED WITH FOLLOWING MESSAGE:\\n' + str(e))\n",
"db.engine.execute(\n 'UPDATE \"{0}\" SET \"{1}\" = \\'{2}\\' WHERE (\"{1}\" = \\'\\') IS NOT FALSE'.\n format(table_name, at... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(VAR_7=None, VAR_8=None):...\n",
"VAR_49 = [VAR_8, VAR_7]\n",
"if not any(VAR_49) or all(VAR_49):\n",
"if VAR_8:\n",
"VAR_58 = 'child_leaf'\n",
"VAR_58 = 'child_branch'\n",
"VAR_59 = VAR_8\n",
"VAR_59 = VAR_7\n",
"return '{branch_part}_{id_part}'.format(**locals())\n"
] | [
"def _build_child_key(child_branch=None, child_leaf=None):...\n",
"args = [child_leaf, child_branch]\n",
"if not any(args) or all(args):\n",
"if child_leaf:\n",
"branch_part = 'child_leaf'\n",
"branch_part = 'child_branch'\n",
"id_part = child_leaf\n",
"id_part = child_branch\n",
"return '{branch_pa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __repr__(self):...\n",
"return self.get_name()\n"
] | [
"def __repr__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12(VAR_5, VAR_6):...\n",
"VAR_8 = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"VAR_9 = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"VAR_11 = requests.get(VAR_5['diff_url'], VAR_8=headers, VAR_9=auth)\n",
"VAR_20 = unidiff.PatchSet(VAR_11.content.splitlines(), encodi... | [
"def autopep8(data, config):...\n",
"headers = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"auth = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"r = requests.get(data['diff_url'], headers=headers, auth=auth)\n",
"patch = unidiff.PatchSet(r.content.splitlines(), encoding=r.enco... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"For",
"For",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
... |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return sum(map(len, VAR_3.values()))\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return sum(map(len, wildcards.values()))\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"from django import forms\n",
"from django.contrib.auth import get_user_model, authenticate\n",
"from django.contrib.auth.forms import UserCreationForm\n",
"from django.utils.translation import gettext as _\n",
"import magic, mimetypes\n",
"from .models import ScreenDoorUser, Position, Applicant\n",
"fr... | [
"from django import forms\n",
"from django.contrib.auth import get_user_model, authenticate\n",
"from django.contrib.auth.forms import UserCreationForm\n",
"from django.utils.translation import gettext as _\n",
"import magic, mimetypes\n",
"from .models import ScreenDoorUser, Position, Applicant\n",
"fr... | [
0,
0,
0,
6,
6,
0,
6,
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,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"... |
[
"def FUNC_2(self, VAR_7, VAR_8, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def _responseFailed(self, failure, csessid, request):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"\"\"\"Serve files directly from the ContentsManager.\"\"\"\n",
"import mimetypes\n",
"import json\n",
"from base64 import decodebytes\n",
"from tornado import web\n",
"from notebook.base.handlers import IPythonHandler\n",
"from notebook.utils import maybe_future\n",
"\"\"\"string\"\"\"\n",
"@proper... | [
"\"\"\"Serve files directly from the ContentsManager.\"\"\"\n",
"import mimetypes\n",
"import json\n",
"from base64 import decodebytes\n",
"from tornado import web\n",
"from notebook.base.handlers import IPythonHandler\n",
"from notebook.utils import maybe_future\n",
"\"\"\"serve files via ContentsMan... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Condition",
"Return'"
] |
[
"def FUNC_9(self, VAR_0):...\n",
"if not cint(self.published):\n",
"VAR_0.full_name = get_fullname(self.owner)\n",
"VAR_0.updated = global_date_format(self.published_on)\n",
"if self.blogger:\n",
"VAR_0.blogger_info = frappe.get_doc('Blogger', self.blogger).as_dict()\n",
"VAR_0.description = self.blog_i... | [
"def get_context(self, context):...\n",
"if not cint(self.published):\n",
"context.full_name = get_fullname(self.owner)\n",
"context.updated = global_date_format(self.published_on)\n",
"if self.blogger:\n",
"context.blogger_info = frappe.get_doc('Blogger', self.blogger).as_dict()\n",
"context.descriptio... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_2, VAR_3, VAR_4=None):...\n",
"VAR_8 = self.find_ord(VAR_2)\n",
"VAR_9 = self.find_ord(VAR_3)\n",
"if VAR_8 is None or VAR_9 is None:\n",
"self.edges.append((VAR_8, VAR_9, VAR_4))\n"
] | [
"def add_edge(self, from_obj, to_obj, label=None):...\n",
"from_obj_ord = self.find_ord(from_obj)\n",
"to_obj_ord = self.find_ord(to_obj)\n",
"if from_obj_ord is None or to_obj_ord is None:\n",
"self.edges.append((from_obj_ord, to_obj_ord, label))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_11(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"def __init__(self, VAR_9, VAR_12):...\n",
"self._splitpath = fs.split_path(VAR_9)\n",
"self._lensplitpath = len(self._splitpath)\n",
"self._store = {}\n",
"self._ds = VAR_12\n",
"def FUNC_13(self, VAR_16):...\n",
"return True\n"
] | [
"def get_path_context(self, targetpath):...\n",
"\"\"\"docstring\"\"\"\n",
"def __init__(self, targetpath, client):...\n",
"self._splitpath = fs.split_path(targetpath)\n",
"self._lensplitpath = len(self._splitpath)\n",
"self._store = {}\n",
"self._ds = client\n",
"def does_intersect_rule(self, rulectx... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"return True\n"
] | [
"def is_active(self):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_27, VAR_28):...\n",
"VAR_15.pack_forget()\n",
"VAR_10.forget()\n",
"VAR_36 = Frame(self, bg='#f8f8f8')\n",
"VAR_36.rowconfigure(0, weight=1)\n",
"VAR_36.columnconfigure(0, weight=1)\n",
"VAR_36.rowconfigure(1, weight=3)\n",
"VAR_36.columnconfigure(1, weight=3)\n",
"VAR_36.pack()\n",
... | [
"def add_meal(rowLocation, columnLocation):...\n",
"menu.pack_forget()\n",
"viewRecipeFrame.forget()\n",
"add_meal_frame = Frame(self, bg='#f8f8f8')\n",
"add_meal_frame.rowconfigure(0, weight=1)\n",
"add_meal_frame.columnconfigure(0, weight=1)\n",
"add_meal_frame.rowconfigure(1, weight=3)\n",
"add_mea... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/dashboard')...\n",
"VAR_28 = VAR_1.connection.cursor()\n",
"VAR_29 = VAR_28.execute(\n 'SELECT cid, crawl_date, pdf_crawled, pdf_processed, domain, url FROM Crawls'\n )\n",
"VAR_47 = VAR_28.fetchall()\n",
"if VAR_29 > 0:\n",
"return render_template('dashboard.html', VAR_47=crawls)\n"... | [
"@app.route('/dashboard')...\n",
"cur = mysql.connection.cursor()\n",
"result = cur.execute(\n 'SELECT cid, crawl_date, pdf_crawled, pdf_processed, domain, url FROM Crawls'\n )\n",
"crawls = cur.fetchall()\n",
"if result > 0:\n",
"return render_template('dashboard.html', crawls=crawls)\n",
"msg = ... | [
0,
0,
4,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_11, VAR_3):...\n",
"return set(VAR_11['bookmarks'] if 'bookmarks' in VAR_11 else [])\n"
] | [
"def get_bookmarks(self, levelfields, doc):...\n",
"return set(levelfields['bookmarks'] if 'bookmarks' in levelfields else [])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(*VAR_13, **VAR_14):...\n",
"VAR_15 = 'memory alloced: %s kb' % str(gc.mem_alloc() / 1024)\n",
"VAR_16 = 'memory free: %s kb' % str(gc.mem_free() / 1024)\n",
"gc.collect()\n",
"VAR_17 = 'after collect: %s kb available' % str(gc.mem_free() / 1024)\n",
"print(FUNC_3(VAR_15, VAR_2='red'))\n",
"p... | [
"def wrapper(*args, **kwargs):...\n",
"memory_alloc = 'memory alloced: %s kb' % str(gc.mem_alloc() / 1024)\n",
"memory_free = 'memory free: %s kb' % str(gc.mem_free() / 1024)\n",
"gc.collect()\n",
"memory_after_collect = 'after collect: %s kb available' % str(gc.mem_free() /\n 1024)\n",
"print(rainbow(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_46=50, VAR_47=100):...\n",
"\"\"\"docstring\"\"\"\n",
"self.regex = re.compile(\n '((?P<value>.+)(?P=value){{{min_repeat},{max_repeat}}})$'.format(VAR_46\n =min_repeat - 1, VAR_47=max_repeat - 1))\n"
] | [
"def __init__(self, min_repeat=50, max_repeat=100):...\n",
"\"\"\"docstring\"\"\"\n",
"self.regex = re.compile(\n '((?P<value>.+)(?P=value){{{min_repeat},{max_repeat}}})$'.format(\n min_repeat=min_repeat - 1, max_repeat=max_repeat - 1))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.bindings['TEST_APP_COMPONENT_NAME']\n",
"VAR_1 = self.bindings\n",
"VAR_9 = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider': 'gce', 'loadBalancerName':\n load_balancer_name, 'region': bind... | [
"def delete_load_balancer(self):...\n",
"\"\"\"docstring\"\"\"\n",
"load_balancer_name = self.bindings['TEST_APP_COMPONENT_NAME']\n",
"bindings = self.bindings\n",
"payload = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider': 'gce', 'loadBalancerName':\n lo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._name\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._name\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_25(self):...\n",
"self.cursor.execute('create table t1(s varchar(20))')\n",
"self.cursor.execute('insert into t1 values(?)', '1')\n",
"VAR_24 = self.cursor.execute('select * from t1').fetchone()\n",
"self.assertEqual(VAR_24[0], '1')\n",
"self.assertEqual(VAR_24[-1], '1')\n"
] | [
"def test_negative_row_index(self):...\n",
"self.cursor.execute('create table t1(s varchar(20))')\n",
"self.cursor.execute('insert into t1 values(?)', '1')\n",
"row = self.cursor.execute('select * from t1').fetchone()\n",
"self.assertEqual(row[0], '1')\n",
"self.assertEqual(row[-1], '1')\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'LOW': 4, 'MEDIUM': 5, 'HIGH': 0}, 'CONFIDENCE': {\n 'HIGH': 9}}\n",
"self.check_example('imports-aliases.py', VAR_2)\n"
] | [
"def test_imports_aliases(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'LOW': 4, 'MEDIUM': 5, 'HIGH': 0}, 'CONFIDENCE': {\n 'HIGH': 9}}\n",
"self.check_example('imports-aliases.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"return self.CurrentFiletypeCompletionEnabled(\n ) and self.NativeFiletypeCompletionAvailable()\n"
] | [
"def NativeFiletypeCompletionUsable(self):...\n",
"return self.CurrentFiletypeCompletionEnabled(\n ) and self.NativeFiletypeCompletionAvailable()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(VAR_20, VAR_21, VAR_22=None):...\n",
"if VAR_20 not in VAR_5:\n",
"VAR_5[VAR_20] = []\n",
"VAR_45 = VAR_5[VAR_20]\n",
"VAR_21 = str(VAR_21)\n",
"VAR_22 = VAR_22 or ''\n",
"VAR_46 = VAR_22, VAR_21\n",
"VAR_0.info('Appending %s to targets[%s]', repr(VAR_46), VAR_20)\n",
"VAR_45.append(VAR_... | [
"def add_target(domain, id_, tuser=None):...\n",
"if domain not in targets:\n",
"targets[domain] = []\n",
"tlist = targets[domain]\n",
"id_ = str(id_)\n",
"tuser = tuser or ''\n",
"t = tuser, id_\n",
"logger.info('Appending %s to targets[%s]', repr(t), domain)\n",
"tlist.append(t)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/')...\n",
"return flask.render_template('addObsIndex.html', configuration=config,\n page_title=u'Interface de saisie des données')\n"
] | [
"@addObs.route('/')...\n",
"return flask.render_template('addObsIndex.html', configuration=config,\n page_title=u'Interface de saisie des données')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_5(self):...\n",
""
] | [
"def run(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_8(self, VAR_13):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def p_expr(self, p):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"@VAR_0.route('/api/issue/<int:id>', methods=['GET'])...\n",
"VAR_5 = FUNC_1().cursor()\n",
"VAR_7 = FUNC_3(VAR_5, VAR_6)\n",
"VAR_14 = []\n",
"VAR_15 = 200\n",
"if VAR_7 is None:\n",
"VAR_14.append(f'issue #{VAR_6} does not exist')\n",
"return jsonify({'data': list(issues.values()), 'errors': VAR_14}... | [
"@app.route('/api/issue/<int:id>', methods=['GET'])...\n",
"cursor = get_database_connection().cursor()\n",
"issue = fetch_issue(cursor, id)\n",
"errors = []\n",
"status_code = 200\n",
"if issue is None:\n",
"errors.append(f'issue #{id} does not exist')\n",
"return jsonify({'data': list(issues.values(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Assign'"
] |
[
"def FUNC_16(self):...\n",
"self.run_test_case(self.scenario.destroy_server_group('v000'))\n"
] | [
"def test_g_destroy_server_group_v000(self):...\n",
"self.run_test_case(self.scenario.destroy_server_group('v000'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_7, VAR_14=errors.NO_THING_ID, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_7, VAR_14, *VAR_15, **kw)\n"
] | [
"def __init__(self, param, error=errors.NO_THING_ID, *a, **kw):...\n",
"VRequired.__init__(self, param, error, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_15(VAR_1, VAR_2, VAR_13, VAR_14, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"flash('Authorization with remote service failed.')\n",
"return redirect('/')\n"
] | [
"def oauth2_handle_error(remote, resp, error_code, error_uri, error_description...\n",
"\"\"\"docstring\"\"\"\n",
"flash('Authorization with remote service failed.')\n",
"return redirect('/')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.testPath()\n",
"self.navloc.csvLogEKF(self.test_name)\n",
"self.navloc.csvLogMap(self.test_name)\n",
"self.navloc.csvLogTransform(self.test_name)\n",
"self.navloc.csvLogRawTags(self.test_name)\n",
"self.navloc.csvLogOdomTags(self.test_name)\n"... | [
"def main(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.testPath()\n",
"self.navloc.csvLogEKF(self.test_name)\n",
"self.navloc.csvLogMap(self.test_name)\n",
"self.navloc.csvLogTransform(self.test_name)\n",
"self.navloc.csvLogRawTags(self.test_name)\n",
"self.navloc.csvLogOdomTags(self.test_name)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"return '%s_%s' % (cfg['OAUTHCLIENT_SESSION_KEY_PREFIX'], VAR_0)\n"
] | [
"def token_session_key(remote_app):...\n",
"\"\"\"docstring\"\"\"\n",
"return '%s_%s' % (cfg['OAUTHCLIENT_SESSION_KEY_PREFIX'], remote_app)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.