lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(VAR_3):...\n",
"VAR_8 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) +\n '\\\\users\\\\' + VAR_3 + '.db')\n",
"VAR_9 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\\\cf.db')\n",
"VAR_10 = VAR_8.cursor()\n",
"VAR_11 = VAR_9.cursor()\n",
"VAR_18 = list()\n",
... | [
"def create_stats_picture(username):...\n",
"conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) +\n '\\\\users\\\\' + username + '.db')\n",
"conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\\\cf.db')\n",
"cursor = conn.cursor()\n",
"cursor2 = conn2.cursor()\n",
"a ... | [
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
0,
0,
4,
4,
4,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Return'",
"For",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'... |
[
"def FUNC_5(self):...\n",
"self.log('')\n",
"self.log('POST ' + self.req)\n",
"if self.headers['expect'].lower() == '100-continue':\n",
"self.parser = MultipartParser(self.log, self.sr, self.headers)\n",
"self.s.send(b'HTTP/1.1 100 Continue\\r\\n\\r\\n')\n",
"self.parser.parse()\n",
"VAR_15 = self.par... | [
"def handle_post(self):...\n",
"self.log('')\n",
"self.log('POST ' + self.req)\n",
"if self.headers['expect'].lower() == '100-continue':\n",
"self.parser = MultipartParser(self.log, self.sr, self.headers)\n",
"self.s.send(b'HTTP/1.1 100 Continue\\r\\n\\r\\n')\n",
"self.parser.parse()\n",
"act = self.p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_33(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_54.flags.in_install:\n",
"return\n",
"for VAR_16, VAR_9 in self.get_valid_dict().items():\n",
"if not VAR_9 or not isinstance(VAR_9, string_types):\n",
"VAR_9 = VAR_54.as_unicode(VAR_9)\n",
"if u'<' not in VAR_9 and u'>' not in VAR_9:\n",
... | [
"def _sanitize_content(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if frappe.flags.in_install:\n",
"return\n",
"for fieldname, value in self.get_valid_dict().items():\n",
"if not value or not isinstance(value, string_types):\n",
"value = frappe.as_unicode(value)\n",
"if u'<' not in value and u'>' not in... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"For",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_1 in DataDocument.objects.all():\n",
"VAR_22 = ExtractedText.objects.get_subclass(data_document=doc)\n",
"if VAR_1.data_group.group_type.code == 'CP':\n",
"self.assertEqual(type(VAR_22), ExtractedCPCat)\n",
"if VAR_1.data_group.group_type.cod... | [
"def test_extractedsubclasses(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for doc in DataDocument.objects.all():\n",
"extsub = ExtractedText.objects.get_subclass(data_document=doc)\n",
"if doc.data_group.group_type.code == 'CP':\n",
"self.assertEqual(type(extsub), ExtractedCPCat)\n",
"if doc.data_group.gr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_34(self):...\n",
"self.cursor.execute('create table t1(i int)')\n",
"self.cursor.execute('insert into t1 values (1)')\n",
"VAR_4 = self.cursor.execute('select * from t1')\n",
"self.assertEqual(VAR_4, self.cursor)\n"
] | [
"def test_retcursor_select(self):...\n",
"self.cursor.execute('create table t1(i int)')\n",
"self.cursor.execute('insert into t1 values (1)')\n",
"v = self.cursor.execute('select * from t1')\n",
"self.assertEqual(v, self.cursor)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_29(self, VAR_5):...\n",
"def FUNC_31():...\n",
"VAR_24 = vim.eval('tagfiles()')\n",
"VAR_25 = VAR_0.getcwd()\n",
"return [VAR_0.path.join(VAR_25, x) for x in VAR_24]\n"
] | [
"def _AddTagsFilesIfNeeded(self, extra_data):...\n",
"def GetTagFiles():...\n",
"tag_files = vim.eval('tagfiles()')\n",
"current_working_directory = os.getcwd()\n",
"return [os.path.join(current_working_directory, x) for x in tag_files]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_38):...\n",
"if not VAR_38:\n",
"VAR_101.errors.add(errors.NO_TITLE)\n",
"if len(VAR_38) > 100:\n",
"VAR_101.errors.add(errors.TITLE_TOO_LONG)\n",
"return VAR_38\n"
] | [
"def run(self, title):...\n",
"if not title:\n",
"c.errors.add(errors.NO_TITLE)\n",
"if len(title) > 100:\n",
"c.errors.add(errors.TITLE_TOO_LONG)\n",
"return title\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Return'"
] |
[
"import os\n",
"import vim\n",
"import tempfile\n",
"import json\n",
"import signal\n",
"from subprocess import PIPE\n",
"from ycm import vimsupport\n",
"from ycm import utils\n",
"from ycm.diagnostic_interface import DiagnosticInterface\n",
"from ycm.completers.all.omni_completer import OmniCompl... | [
"import os\n",
"import vim\n",
"import tempfile\n",
"import json\n",
"import signal\n",
"from subprocess import PIPE\n",
"from ycm import vimsupport\n",
"from ycm import utils\n",
"from ycm.diagnostic_interface import DiagnosticInterface\n",
"from ycm.completers.all.omni_completer import OmniCompl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
7,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'"... |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"db.session.add(self)\n",
"db.session.commit()\n"
] | [
"def create(self):...\n",
"\"\"\"docstring\"\"\"\n",
"db.session.add(self)\n",
"db.session.commit()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_9(VAR_8, VAR_9):...\n",
"VAR_30 = {}\n",
"for VAR_36 in ('point', 'line', 'polygon'):\n",
"VAR_35 = VAR_9 * VAR_18[VAR_36]\n",
"return VAR_30\n",
"VAR_30[VAR_36] = bounds_buffer(VAR_8, VAR_35)\n"
] | [
"def bounds_pad(bounds, meters_per_pixel_dim):...\n",
"buffered_by_type = {}\n",
"for geometry_type in ('point', 'line', 'polygon'):\n",
"offset = meters_per_pixel_dim * buf_by_type[geometry_type]\n",
"return buffered_by_type\n",
"buffered_by_type[geometry_type] = bounds_buffer(bounds, offset)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_14(self, VAR_9, VAR_10=None):...\n",
"if isinstance(VAR_9, str) or callable(VAR_9):\n",
"self.log.append(IOFile(VAR_9, VAR_16=self) if isinstance(VAR_9, str) else VAR_9\n )\n",
"VAR_48 = len(self.log)\n",
"if VAR_10:\n",
"for VAR_51 in VAR_9:\n",
"self.log.add_name(VAR_10)\n",
"self._set_... | [
"def _set_log_item(self, item, name=None):...\n",
"if isinstance(item, str) or callable(item):\n",
"self.log.append(IOFile(item, rule=self) if isinstance(item, str) else item)\n",
"start = len(self.log)\n",
"if name:\n",
"for i in item:\n",
"self.log.add_name(name)\n",
"self._set_log_item(i)\n",
"if... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"For",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = len(self.log_files)\n",
"VAR_9 = self.redis_client.lrange('LOG_FILENAMES:{}'.format(self.\n node_ip_address), VAR_8, -1)\n",
"for VAR_10 in VAR_9:\n",
"VAR_0.info('Beginning to track file {}'.format(VAR_10))\n",
"assert VAR_10 not in self.... | [
"def update_log_filenames(self):...\n",
"\"\"\"docstring\"\"\"\n",
"num_current_log_files = len(self.log_files)\n",
"new_log_filenames = self.redis_client.lrange('LOG_FILENAMES:{}'.format(self\n .node_ip_address), num_current_log_files, -1)\n",
"for log_filename in new_log_filenames:\n",
"logger.info('... | [
0,
0,
6,
6,
6,
0,
6,
6
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assert'",
"Assign'"
] |
[
"def FUNC_2():...\n",
""
] | [
"def config_path():...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_7(self, VAR_3):...\n",
""
] | [
"def t_error(self, tok):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_19(VAR_12):...\n",
"VAR_58 = 0\n",
"for line in VAR_12:\n",
"VAR_58 = VAR_58 + 1\n",
"VAR_77 = 'line3' if VAR_58 % 2 == 0 else 'line'\n",
"print('<div class=\"' + VAR_77 + '\">' + FUNC_23(line) + '</div>')\n"
] | [
"def show_log(stdout):...\n",
"i = 0\n",
"for line in stdout:\n",
"i = i + 1\n",
"line_class = 'line3' if i % 2 == 0 else 'line'\n",
"print('<div class=\"' + line_class + '\">' + escape_html(line) + '</div>')\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_9, VAR_10, VAR_11, VAR_16={}):...\n",
"get_and_check_project(VAR_9, VAR_11)\n",
"VAR_28 = self.queryset.annotate(**annotate).get(VAR_10=pk, VAR_1=project_pk)\n",
"return VAR_28\n"
] | [
"def get_and_check_task(self, request, pk, project_pk, annotate={}):...\n",
"get_and_check_project(request, project_pk)\n",
"task = self.queryset.annotate(**annotate).get(pk=pk, project=project_pk)\n",
"return task\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/statistics')...\n",
"VAR_28 = VAR_1.connection.cursor()\n",
"VAR_28.execute(\n 'SELECT cid FROM Crawls WHERE crawl_date = (SELECT max(crawl_date) FROM Crawls)'\n )\n",
"VAR_29 = VAR_28.fetchone()\n",
"VAR_28.close()\n",
"if VAR_29:\n",
"VAR_49 = VAR_29['cid']\n",
"flash(\n 'Th... | [
"@app.route('/statistics')...\n",
"cur = mysql.connection.cursor()\n",
"cur.execute(\n 'SELECT cid FROM Crawls WHERE crawl_date = (SELECT max(crawl_date) FROM Crawls)'\n )\n",
"result = cur.fetchone()\n",
"cur.close()\n",
"if result:\n",
"cid_last_crawl = result['cid']\n",
"flash(\n 'There ar... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Return'"
] |
[
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = discord.Embed(VAR_2='NTR Streaming Guide', VAR_3=discord.Color.blue())\n",
"VAR_7.url = 'string'\n",
"VAR_7.description = 'How to use NTR CFW with Nitro Stream to Wirelessly Stream'\n",
"VAR_7.add_field(name='4 common fixes', value=\n \"\"... | [
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"embed = discord.Embed(title='NTR Streaming Guide', color=discord.Color.blue())\n",
"embed.url = (\n 'https://gbatemp.net/threads/tutorial-3ds-screen-recording-without-a-capture-card-ntr-cfw-method.423445/'\n )\n",
"embed.description = 'How to use... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_23(self):...\n",
"VAR_4 = 'hubba-bubba'\n",
"VAR_22 = 'csrf token'\n",
"VAR_32['_csrft_'] = VAR_22\n",
"VAR_32['user_eppn'] = VAR_4\n",
"VAR_32['eduPersonPrincipalName'] = VAR_4\n",
"VAR_31 = self.app.dispatch_request()\n",
"self.assertEqual(VAR_31.status, '200 OK')\n",
"self.assertIn(self... | [
"def test_logout_nologgedin(self):...\n",
"eppn = 'hubba-bubba'\n",
"csrft = 'csrf token'\n",
"session['_csrft_'] = csrft\n",
"session['user_eppn'] = eppn\n",
"session['eduPersonPrincipalName'] = eppn\n",
"response = self.app.dispatch_request()\n",
"self.assertEqual(response.status, '200 OK')\n",
"s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_0, VAR_1, VAR_2, VAR_3):...\n",
"if not hasattr(VAR_0, 'kbsite'):\n",
"return None\n",
"VAR_7 = VAR_0.kbsite\n",
"if VAR_7.is_active:\n",
"return None\n",
"if self._path_allowed(VAR_0.path):\n",
"return None\n",
"if VAR_0.user.is_staff or VAR_0.user.is_superuser:\n",
"return ... | [
"def process_view(self, request, view_func, view_args, view_kwargs):...\n",
"if not hasattr(request, 'kbsite'):\n",
"return None\n",
"kbsite = request.kbsite\n",
"if kbsite.is_active:\n",
"return None\n",
"if self._path_allowed(request.path):\n",
"return None\n",
"if request.user.is_staff or request... | [
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(VAR_8=' '):...\n",
"\"\"\"docstring\"\"\"\n",
"print('--list: ' + str(VAR_6.list))\n",
"if VAR_6.list == 'a' or VAR_6.list == 'all' or VAR_6.list == 'g' or VAR_6.list == 'groups':\n",
"VAR_13 = set()\n",
"if VAR_6.list == 'a' or VAR_6.list == 'all' or VAR_6.list == 'd' or VAR_6.list == 'des... | [
"def run_list_mode(indent=' '):...\n",
"\"\"\"docstring\"\"\"\n",
"print('--list: ' + str(args.list))\n",
"if args.list == 'a' or args.list == 'all' or args.list == 'g' or args.list == 'groups':\n",
"grp = set()\n",
"if args.list == 'a' or args.list == 'all' or args.list == 'd' or args.list == 'descrip... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Condition",
"Assign'",
"Condition",
"For",
"Assign'",
"Expr'",
"Expr'",
"For",
"For",
"Expr'",
"Expr'",
"Expr'",
"For",
"Expr'"
] |
[
"@property...\n",
"return self.exists and not os.access(self.file, os.W_OK)\n"
] | [
"@property...\n",
"return self.exists and not os.access(self.file, os.W_OK)\n"
] | [
0,
7
] | [
"Condition",
"Return'"
] |
[
"def FUNC_24(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = []\n",
"for VAR_7, VAR_12 in self.all_processes.items():\n",
"for VAR_16 in VAR_12:\n",
"return VAR_17\n",
"if VAR_16.process.poll() is not None:\n",
"VAR_17.append((VAR_7, VAR_16.process))\n"
] | [
"def dead_processes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"result = []\n",
"for process_type, process_infos in self.all_processes.items():\n",
"for process_info in process_infos:\n",
"return result\n",
"if process_info.process.poll() is not None:\n",
"result.append((process_type, process_info.proce... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_9(self, *VAR_15, **VAR_75):...\n",
""
] | [
"def newfn(self, *a, **env):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_19(self, VAR_14):...\n",
""
] | [
"def is_relation_many_to_many(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_14(self, VAR_10, VAR_11):...\n",
"VAR_24 = self.common._cli_run('createhost -add %s %s' % (VAR_10, ' '.join(\n VAR_11)), None)\n"
] | [
"def _modify_3par_fibrechan_host(self, hostname, wwn):...\n",
"out = self.common._cli_run('createhost -add %s %s' % (hostname, ' '.join(\n wwn)), None)\n"
] | [
0,
2
] | [
"FunctionDef'",
"Assign'"
] |
[
"from tkinter import *\n",
"import datetime\n",
"from isoweek import Week\n",
"from tkinter import ttk\n",
"import sqlite3\n",
"from PIL import Image, ImageTk\n",
"VAR_0 = 'Trebuchet MS', 24\n",
"VAR_1 = 'Trebuchet MS', 14\n",
"def __init__(self, VAR_2, VAR_3):...\n",
"Frame.__init__(self, VAR_2, ... | [
"from tkinter import *\n",
"import datetime\n",
"from isoweek import Week\n",
"from tkinter import ttk\n",
"import sqlite3\n",
"from PIL import Image, ImageTk\n",
"LARGE_FONT = 'Trebuchet MS', 24\n",
"MEDIUM_FONT = 'Trebuchet MS', 14\n",
"def __init__(self, parent, controller):...\n",
"Frame.__ini... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"ImportFrom'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"A... |
[
"def FUNC_5(self):...\n",
"VAR_13 = ''\n",
"VAR_13 += self.debugger.dut.serial.port + ' '\n",
"VAR_13 += str(self.result_data['id']) + ': ' + self.result_data[\n 'outcome_category'] + ' - ' + self.result_data['outcome']\n",
"if self.result_data['data_diff'] is not None and self.result_data['data_diff'\n"... | [
"def log_result(self):...\n",
"out = ''\n",
"out += self.debugger.dut.serial.port + ' '\n",
"out += str(self.result_data['id']) + ': ' + self.result_data['outcome_category'\n ] + ' - ' + self.result_data['outcome']\n",
"if self.result_data['data_diff'] is not None and self.result_data['data_diff'\n",
"... | [
0,
2,
2,
2,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"AugAssign'",
"AugAssign'",
"Condition",
"AugAssign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_42(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 1}, 'CONFIDENCE': {'HIGH': 1}}\n",
"self.check_example('yaml_load.py', VAR_2)\n"
] | [
"def test_yaml(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 1}, 'CONFIDENCE': {'HIGH': 1}}\n",
"self.check_example('yaml_load.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_4):...\n",
"VAR_3.execute(\"SELECT * FROM players WHERE Name = '%s' COLLATE NOCASE\" % VAR_4)\n",
"VAR_14 = dict(VAR_3.fetchone())\n",
"return VAR_14\n"
] | [
"def getPlayer(player):...\n",
"db.execute(\"SELECT * FROM players WHERE Name = '%s' COLLATE NOCASE\" % player)\n",
"playerstats = dict(db.fetchone())\n",
"return playerstats\n"
] | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"if not self.config:\n",
"self.logger.error(' Config not loaded yet!')\n",
"if not self.session:\n",
"self.logger.error(' Init aborted. No session was found!')\n",
"self.logger.debug(self.config)\n",
"VAR_9 = FUNC_6(self.session, self.window_name)\n",
"if VAR_9:\n",
"self.... | [
"def init(self):...\n",
"if not self.config:\n",
"self.logger.error(' Config not loaded yet!')\n",
"if not self.session:\n",
"self.logger.error(' Init aborted. No session was found!')\n",
"self.logger.debug(self.config)\n",
"window = find_window(self.session, self.window_name)\n",
"if window:\n",
"s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"from osv import fields, osv\n",
"from tools.translate import _\n",
"VAR_0 = 'product.product'\n",
"def FUNC_0(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"VAR_17 = self.pool.get('product.product').browse(VAR_1, VAR_2, VAR_3, VAR_4\n... | [
"from osv import fields, osv\n",
"from tools.translate import _\n",
"_inherit = 'product.product'\n",
"def get_product_accounts(self, cr, uid, product_id, context=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if context is None:\n",
"context = {}\n",
"product_obj = self.pool.get('product.product').browse(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self, VAR_13):...\n",
"VAR_35 = self.accept(VAR_13)\n",
"if VAR_35:\n",
"return VAR_35\n"
] | [
"def expect(self, ttype):...\n",
"result = self.accept(ttype)\n",
"if result:\n",
"return result\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"self.authn('/terminate', VAR_6=True)\n"
] | [
"def test_terminate_authn(self):...\n",
"self.authn('/terminate', force_authn=True)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_5(self, VAR_2, VAR_3='app.html', **VAR_4):...\n",
"if self.is_api:\n",
"self.write(VAR_2)\n",
"self.render(VAR_3, VAR_2=page_json, **kw)\n"
] | [
"def page_render(self, page_json, template='app.html', **kw):...\n",
"if self.is_api:\n",
"self.write(page_json)\n",
"self.render(template, page_json=page_json, **kw)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(*VAR_0, **VAR_1):...\n",
"VAR_2 = requests.Response()\n",
"VAR_2.status_code = 200\n",
"VAR_2._content_consumed = True\n",
"return VAR_2\n"
] | [
"def mock_import_repository_task(*args, **kwargs):...\n",
"resp = requests.Response()\n",
"resp.status_code = 200\n",
"resp._content_consumed = True\n",
"return resp\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"from __future__ import unicode_literals\n",
"import frappe, json\n",
"from frappe import _\n",
"from frappe.utils import cint, formatdate\n",
"@frappe.whitelist(allow_guest=True)...\n",
"from frappe.www.contact import send_message as website_send_message\n",
"VAR_4 = VAR_5 = None\n",
"website_send_me... | [
"from __future__ import unicode_literals\n",
"import frappe, json\n",
"from frappe import _\n",
"from frappe.utils import cint, formatdate\n",
"@frappe.whitelist(allow_guest=True)...\n",
"from frappe.www.contact import send_message as website_send_message\n",
"lead = customer = None\n",
"website_send_... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
... |
[
"from .api import get_query_manager\n",
"__all__ = 'get_query_manager',\n",
"\"\"\"string\"\"\"\n"
] | [
"from .api import get_query_manager\n",
"__all__ = 'get_query_manager',\n",
"\"\"\"\nopportunity_qm = models.Opportunity.get_query_manager()\n\nopportunities = opportunity_qm.run(\n {\n 'id': o.Id,\n 'accounts': [\n {'id': a.Id}\n for a in o.Accounts\n ]\n }\n ... | [
4,
4,
4
] | [
"ImportFrom'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(VAR_2):...\n",
"if VAR_2 % 10 == 1 and VAR_2 % 100 != 11:\n",
"return 'st'\n",
"if VAR_2 % 10 == 2 and VAR_2 % 100 != 12:\n",
"return 'nd'\n",
"if VAR_2 % 10 == 3 and VAR_2 % 100 != 13:\n",
"return 'rd'\n",
"return 'th'\n"
] | [
"def getPostFix(index):...\n",
"if index % 10 == 1 and index % 100 != 11:\n",
"return 'st'\n",
"if index % 10 == 2 and index % 100 != 12:\n",
"return 'nd'\n",
"if index % 10 == 3 and index % 100 != 13:\n",
"return 'rd'\n",
"return 'th'\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def __virtual__():...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return False\n",
"return 'disk'\n"
] | [
"def __virtual__():...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return False\n",
"return 'disk'\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_26(VAR_5, VAR_8):...\n",
"api.reset_local_state()\n",
"VAR_11[0] = VAR_5\n",
"VAR_15 = VAR_7.get('/request', extra_environ={'REMOTE_ADDR': ip},\n expect_errors=True)\n",
"return VAR_15.status_int\n"
] | [
"def call(ident, ip):...\n",
"api.reset_local_state()\n",
"mocked_ident[0] = ident\n",
"response = app.get('/request', extra_environ={'REMOTE_ADDR': ip},\n expect_errors=True)\n",
"return response.status_int\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __setstate__(self, VAR_0):...\n",
"return self.deserialize(VAR_0)\n"
] | [
"def __setstate__(self, data):...\n",
"return self.deserialize(data)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"VAR_17 = []\n",
"VAR_16 = datetime.now(timezone(timedelta(hours=+9), 'JST'))\n",
"VAR_16 = VAR_16.replace(hour=0, minute=0, second=0, microsecond=0)\n",
"for day in range(30)[::-1]:\n",
"VAR_20 = VAR_16 - timedelta(days=day)\n",
"return VAR_17\n",
"VAR_21 = VAR_20.strftime('... | [
"def thirty_day_labels(self):...\n",
"labels = []\n",
"today = datetime.now(timezone(timedelta(hours=+9), 'JST'))\n",
"today = today.replace(hour=0, minute=0, second=0, microsecond=0)\n",
"for day in range(30)[::-1]:\n",
"date = today - timedelta(days=day)\n",
"return labels\n",
"label = date.strftime... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Expr'"
] |
[
"@VAR_12.setter...\n",
"self._parse('parts', VAR_9)\n"
] | [
"@parts.setter...\n",
"self._parse('parts', value)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_44(self):...\n",
"from frappe.utils.file_manager import extract_images_from_doc\n",
"if self.doctype != 'DocType':\n",
"for VAR_25 in self.meta.get('fields', {'fieldtype': ('=', 'Text Editor')}):\n",
"extract_images_from_doc(self, VAR_25.fieldname)\n"
] | [
"def _extract_images_from_text_editor(self):...\n",
"from frappe.utils.file_manager import extract_images_from_doc\n",
"if self.doctype != 'DocType':\n",
"for df in self.meta.get('fields', {'fieldtype': ('=', 'Text Editor')}):\n",
"extract_images_from_doc(self, df.fieldname)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Condition",
"For",
"Expr'"
] |
[
"from django.test import TestCase\n",
"from dashboard.tests.loader import load_model_objects\n",
"from dashboard.models import QAGroup, ExtractedText\n",
"def FUNC_0(self):...\n",
"self.objects = load_model_objects()\n",
"self.client.login(username='Karyn', password='specialP@55word')\n",
"def FUNC_1(se... | [
"from django.test import TestCase\n",
"from dashboard.tests.loader import load_model_objects\n",
"from dashboard.models import QAGroup, ExtractedText\n",
"def setUp(self):...\n",
"self.objects = load_model_objects()\n",
"self.client.login(username='Karyn', password='specialP@55word')\n",
"def test_qa_gr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_16(self):...\n",
"VAR_31 = False\n",
"if self.name in ['backup', 'remove']:\n",
"VAR_31 = self.contains('ynh_abort_if_errors') or self.contains('set -eu')\n",
"VAR_31 = self.contains('ynh_abort_if_errors')\n",
"if self.name == 'remove':\n",
"if VAR_31:\n",
"if not VAR_31:\n",
"FUNC_4('stri... | [
"def check_set_usage(self):...\n",
"present = False\n",
"if self.name in ['backup', 'remove']:\n",
"present = self.contains('ynh_abort_if_errors') or self.contains('set -eu')\n",
"present = self.contains('ynh_abort_if_errors')\n",
"if self.name == 'remove':\n",
"if present:\n",
"if not present:\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_9(VAR_26, VAR_27, VAR_28=bconfig.CFG_MAIN_FIELD, VAR_29=bconfig....\n",
"\"\"\"docstring\"\"\"\n",
"VAR_53 = 'string'\n",
"VAR_52 = []\n",
"VAR_54, VAR_55, VAR_56 = FUNC_29(VAR_28)\n",
"for VAR_36 in (VAR_26['Single keywords'], VAR_26['Core keywords']):\n",
"for VAR_62 in VAR_36:\n",
"for VA... | [
"def _output_marc(output_complete, categories, kw_field=bconfig....\n",
"\"\"\"docstring\"\"\"\n",
"kw_template = \"\"\"<datafield tag=\"%s\" ind1=\"%s\" ind2=\"%s\">\n <subfield code=\"2\">%s</subfield>\n <subfield code=\"a\">%s</subfield>\n <subfield code=\"n\">%s</subfield>\n <subfield code=\"9\"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Expr'",
"Condition",
"Return'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = os.path.basename(VAR_0)\n",
"if os.path.exists(VAR_1):\n",
"return\n",
"VAR_15 = requests.get(VAR_0, stream=True)\n",
"VAR_15.raise_for_status()\n",
"for chunk in VAR_15.iter_content(4096):\n",
"fd.write(chunk)\n"
] | [
"def fetch_file(url):...\n",
"\"\"\"docstring\"\"\"\n",
"filename = os.path.basename(url)\n",
"if os.path.exists(filename):\n",
"return\n",
"r = requests.get(url, stream=True)\n",
"r.raise_for_status()\n",
"for chunk in r.iter_content(4096):\n",
"fd.write(chunk)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_3 = 'SELECT MAX(id) FROM jdk_entries;'\n",
"self.entry_id = str(FUNC_0(VAR_3, True)[0][0])\n",
"return None\n"
] | [
"def set_entry_id(self):...\n",
"sql = 'SELECT MAX(id) FROM jdk_entries;'\n",
"self.entry_id = str(db_execute(sql, True)[0][0])\n",
"return None\n"
] | [
0,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_9():...\n",
"populate_test_database()\n",
"FUNC_1('first playlist')\n",
"FUNC_1('second playlist')\n",
"FUNC_0(1, 'f title', 'f url', 1)\n",
"FUNC_0(1, 's title', 's url', 2)\n",
"FUNC_0(1, 't title', 't url', 3)\n",
"FUNC_0(2, 'f title', 'f url', 1)\n",
"FUNC_0(2, 'fh title', 'fh url', 2)... | [
"def test_should_return_all_the_videos():...\n",
"populate_test_database()\n",
"create_playlist('first playlist')\n",
"create_playlist('second playlist')\n",
"create_video(1, 'f title', 'f url', 1)\n",
"create_video(1, 's title', 's url', 2)\n",
"create_video(1, 't title', 't url', 3)\n",
"create_vide... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_4(self, VAR_8):...\n",
"VAR_4 = self.size or ''\n",
"return '%s[%s]' % (self.base_field.db_type(VAR_8), VAR_4)\n"
] | [
"def db_type(self, connection):...\n",
"size = self.size or ''\n",
"return '%s[%s]' % (self.base_field.db_type(connection), size)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_1=None, VAR_8=None, **VAR_7):...\n",
"if self.closed:\n",
"if VAR_8 is None:\n",
"VAR_8 = self._adapter\n",
"if self._adapter is not None:\n",
"if VAR_8 is None:\n",
"if self._session is not None:\n",
"if VAR_1 is None:\n",
"VAR_1 = VAR_8.address\n",
"self._attach(VAR_1, **kw... | [
"def attach_socket(self, addr=None, adapter=None, **kwargs):...\n",
"if self.closed:\n",
"if adapter is None:\n",
"adapter = self._adapter\n",
"if self._adapter is not None:\n",
"if adapter is None:\n",
"if self._session is not None:\n",
"if addr is None:\n",
"addr = adapter.address\n",
"self._att... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self, VAR_4):...\n",
"return SQLConnector.insert_into(self, VAR_4.to_database_query())\n"
] | [
"def insert_into(self, transaction):...\n",
"return SQLConnector.insert_into(self, transaction.to_database_query())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(VAR_27):...\n",
"VAR_36 = datetime.utcfromtimestamp(VAR_27.created_utc)\n",
"VAR_14 = str(VAR_27.author)\n",
"VAR_13.execute(\n \"SELECT address, private_key FROM accounts WHERE username='%s'\" % VAR_14)\n",
"VAR_34 = VAR_13.fetchall()\n",
"if len(VAR_34) > 0:\n",
"open_or_receive(VAR_34... | [
"def handle_receive(message):...\n",
"message_time = datetime.utcfromtimestamp(message.created_utc)\n",
"username = str(message.author)\n",
"mycursor.execute(\n \"SELECT address, private_key FROM accounts WHERE username='%s'\" % username)\n",
"result = mycursor.fetchall()\n",
"if len(result) > 0:\n",
... | [
0,
4,
0,
0,
0,
0,
4,
0,
4,
4,
4,
0,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.log = VAR_79, VAR_80\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.log = logs, kwlogs\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_0():...\n",
"return [webapp2.Route('/restricted/ereporter2/errors', CLASS_2), webapp2.\n Route('/restricted/ereporter2/errors/<error_id:\\\\d+>', CLASS_3),\n webapp2.Route('/restricted/ereporter2/report', CLASS_0), webapp2.Route(\n '/restricted/ereporter2/request/<request_id:[0-9a-fA-F]+>', CLA... | [
"def get_frontend_routes():...\n",
"return [webapp2.Route('/restricted/ereporter2/errors',\n RestrictedEreporter2ErrorsList), webapp2.Route(\n '/restricted/ereporter2/errors/<error_id:\\\\d+>',\n RestrictedEreporter2Error), webapp2.Route(\n '/restricted/ereporter2/report', RestrictedEreporter2Report),... | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12(VAR_35):...\n",
"return VAR_35.format(host=url.host, date=datetime.utcnow().isoformat(),\n VAR_30=seqnum)\n"
] | [
"def formatOutput(p):...\n",
"return p.format(host=url.host, date=datetime.utcnow().isoformat(), seqnum=\n seqnum)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(self, VAR_12):...\n",
"print('Test type: %s' % self.__class__.__name__, file=fd)\n",
"print('Execution start time: %s' % datetime.datetime.fromtimestamp(self.\n start_time).strftime('%d/%m/%Y %H:%M:%S.%f'), file=fd)\n",
"print('Execution stop time: %s' % datetime.datetime.fromtimestamp(self.\n ... | [
"def store_to_file(self, fd):...\n",
"print('Test type: %s' % self.__class__.__name__, file=fd)\n",
"print('Execution start time: %s' % datetime.datetime.fromtimestamp(self.\n start_time).strftime('%d/%m/%Y %H:%M:%S.%f'), file=fd)\n",
"print('Execution stop time: %s' % datetime.datetime.fromtimestamp(self.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_26():...\n",
"frappe.throw(_('Use of sub-query or function is restricted'), frappe.DataError)\n"
] | [
"def _raise_exception():...\n",
"frappe.throw(_('Use of sub-query or function is restricted'), frappe.DataError)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"return self.vars.copy()\n"
] | [
"def get_vars(self):...\n",
"return self.vars.copy()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from django.http import HttpResponse, HttpResponseRedirect\n",
"from django.shortcuts import get_object_or_404, render, redirect\n",
"from django.views.generic import ListView, DetailView\n",
"from django.views.generic.edit import CreateView, UpdateView\n",
"from pure_pagination.mixins import PaginationMix... | [
"from django.http import HttpResponse, HttpResponseRedirect\n",
"from django.shortcuts import get_object_or_404, render, redirect\n",
"from django.views.generic import ListView, DetailView\n",
"from django.views.generic.edit import CreateView, UpdateView\n",
"from pure_pagination.mixins import PaginationMix... | [
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"... |
[
"def FUNC_1(VAR_11):...\n",
"VAR_5.pack_forget()\n",
"VAR_12 = 'meal_planner.db'\n",
"VAR_6.pack(fill='both')\n",
"VAR_8 = Image.open('home.jpg')\n",
"VAR_9 = ImageTk.PhotoImage(VAR_8)\n",
"VAR_10 = Button(VAR_6, image=render, borderwidth=0, highlightthickness=0,\n highlightbackground='#e7e7e7', comm... | [
"def callback(recipeName):...\n",
"viewRecipeFrame.pack_forget()\n",
"database_file = 'meal_planner.db'\n",
"menuFrame.pack(fill='both')\n",
"load = Image.open('home.jpg')\n",
"render = ImageTk.PhotoImage(load)\n",
"img = Button(menuFrame, image=render, borderwidth=0, highlightthickness=0,\n highligh... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"For",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",... |
[
"@property...\n",
"if hasattr(self, 'curated_chemical') and self.curated_chemical is not None:\n",
"return self.curated_chemical.sid\n",
"return None\n"
] | [
"@property...\n",
"if hasattr(self, 'curated_chemical') and self.curated_chemical is not None:\n",
"return self.curated_chemical.sid\n",
"return None\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_3(self, VAR_0, VAR_1):...\n",
""
] | [
"def del_req_handler(self, interface, method):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0():...\n",
"VAR_13 = VAR_0.path.dirname(VAR_0.path.abspath(__file__))\n",
"return VAR_0.path.join(VAR_13, 'server/ycmd.py')\n"
] | [
"def _PathToServerScript():...\n",
"dir_of_current_script = os.path.dirname(os.path.abspath(__file__))\n",
"return os.path.join(dir_of_current_script, 'server/ycmd.py')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.BAD_USERNAME, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.BAD_USERNAME, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __repr__(self):...\n",
"return 'Node(%r, %r, %r)' % (self.cname, self.pname, self.ename)\n"
] | [
"def __repr__(self):...\n",
"return 'Node(%r, %r, %r)' % (self.cname, self.pname, self.ename)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_61():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"VAR_39 = set(['a'])\n",
"self.cursor.execute('insert into t1 (word) VALUES (?)', [VAR_39])\n"
] | [
"def f():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"words = set(['a'])\n",
"self.cursor.execute('insert into t1 (word) VALUES (?)', [words])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n",
"VAR_7 = []\n",
"VAR_8 = self.pool.get('ir.model.data')\n",
"VAR_9 = self.pool.get('account.bank.statement')\n",
"VAR_10 = self.pool.get('acc... | [
"def close_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\n",
"statement_obj = self.pool.get('account.bank.statement')\n",
"journa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"... |
[
"def FUNC_2(self):...\n",
"return {option.name: self.config(option.name) for option in VAR_4}\n"
] | [
"def config_dict(self):...\n",
"return {option.name: self.config(option.name) for option in CONFIG_OPTIONS}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_11, *VAR_12, **VAR_9):...\n",
"super().__init__(*VAR_12, **kwargs)\n",
"self.key_name = VAR_11\n"
] | [
"def __init__(self, key_name, *args, **kwargs):...\n",
"super().__init__(*args, **kwargs)\n",
"self.key_name = key_name\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"import re\n",
"from flask import request\n",
"\"\"\"\n Stack data structure will not insert\n equal sequential data\n \"\"\"\n",
"def __init__(self, VAR_1=None, VAR_2=5):...\n",
"self.size = VAR_2\n",
"self.data = VAR_1 or []\n",
"def FUNC_5(self, VAR_3):...\n",
"if self.data:\n",
... | [
"import re\n",
"from flask import request\n",
"\"\"\"\n Stack data structure will not insert\n equal sequential data\n \"\"\"\n",
"def __init__(self, list=None, size=5):...\n",
"self.size = size\n",
"self.data = list or []\n",
"def push(self, item):...\n",
"if self.data:\n",
"if ite... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_22(VAR_2, VAR_18, VAR_19):...\n",
"if VAR_18.provider.id == '8.9.10.11':\n"
] | [
"def _validate(cluster_api, endpoint, conn):...\n",
"if endpoint.provider.id == '8.9.10.11':\n"
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def __init__(self, VAR_2=None):...\n",
"self.total = 0\n",
"self.success = 0\n",
"self.failure = 0\n",
"self.error = 0\n",
"self.undecided = 0\n",
"self.total_time = 0.0\n",
"self.max_time = 0.0\n",
"self.log_dir = VAR_2\n",
"if self.log_dir is not None:\n",
"os.makedirs(self.log_dir)\n"
] | [
"def __init__(self, log_dir=None):...\n",
"self.total = 0\n",
"self.success = 0\n",
"self.failure = 0\n",
"self.error = 0\n",
"self.undecided = 0\n",
"self.total_time = 0.0\n",
"self.max_time = 0.0\n",
"self.log_dir = log_dir\n",
"if self.log_dir is not None:\n",
"os.makedirs(self.log_dir)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"import stack.commands\n",
"from stack.exception import ArgError, ParamValue\n",
"\"\"\"string\"\"\"\n",
"def FUNC_0(self, VAR_0, VAR_1):...\n",
"VAR_2 = None\n",
"VAR_3 = []\n",
"VAR_4 = []\n",
"VAR_5 = []\n",
"if len(VAR_1) == 0:\n",
"VAR_2 = 'global'\n",
"if len(VAR_1) == 1:\n",
"if not VAR... | [
"import stack.commands\n",
"from stack.exception import ArgError, ParamValue\n",
"\"\"\"\n\tList the storage controller configuration for one of the following:\n\tglobal, os, appliance or host.\n\n\t<arg optional='1' type='string' name='host'>\n\tThis argument can be nothing, a valid 'os' (e.g., 'redhat'), a va... | [
0,
0,
0,
0,
0,
0,
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,
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... | [
"Import'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
... |
[
"def FUNC_57(self):...\n",
"VAR_13 = self.cursor.execute('select ?', None).fetchone()[0]\n",
"self.assertEqual(VAR_13, None)\n"
] | [
"def test_untyped_none(self):...\n",
"value = self.cursor.execute('select ?', None).fetchone()[0]\n",
"self.assertEqual(value, None)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = [VAR_28 for VAR_28 in self.expanded_output if VAR_28.exists]\n",
"if VAR_21:\n",
"logger.info(\n \"\"\"Removing output files of failed job {} since they might be corrupted:\n{}\"\"\"\n .format(self, ', '.join(VAR_21)))\n",
"for VAR_28 i... | [
"def cleanup(self):...\n",
"\"\"\"docstring\"\"\"\n",
"to_remove = [f for f in self.expanded_output if f.exists]\n",
"if to_remove:\n",
"logger.info(\n \"\"\"Removing output files of failed job {} since they might be corrupted:\n{}\"\"\"\n .format(self, ', '.join(to_remove)))\n",
"for f in to_remove... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_0(VAR_2):...\n",
"VAR_8 = psycopg2.connect('dbname=fluffy_bot user=censored password=Laumau11p')\n",
"VAR_9 = VAR_8.cursor()\n",
"VAR_9.execute(VAR_2)\n",
"VAR_10 = VAR_9.fetchall()\n",
"VAR_9.close()\n",
"VAR_8.close()\n",
"return VAR_10\n"
] | [
"def fetch(query):...\n",
"conn = psycopg2.connect('dbname=fluffy_bot user=censored password=Laumau11p')\n",
"cur = conn.cursor()\n",
"cur.execute(query)\n",
"result = cur.fetchall()\n",
"cur.close()\n",
"conn.close()\n",
"return result\n"
] | [
0,
4,
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_3():...\n",
"print(*VAR_3, sep='/')\n"
] | [
"def pwd():...\n",
"print(*curr_path, sep='/')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@property...\n",
"VAR_4 = self.request.session.get('oidc_login_next', None)\n",
"return VAR_4 or import_from_settings('LOGIN_REDIRECT_URL', '/')\n"
] | [
"@property...\n",
"next_url = self.request.session.get('oidc_login_next', None)\n",
"return next_url or import_from_settings('LOGIN_REDIRECT_URL', '/')\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_11, VAR_10=[]):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = self.session.get(\n 'https://www.kijiji.ca/p-admarkt-post-ad.html?categoryId=773')\n",
"VAR_22 = \"initialXsrfToken: '\\\\S+'\"\n",
"VAR_23 = re.findall(VAR_22, VAR_14.text)[0].strip(\"initialXsrfToken: '\").strip(\n \"'... | [
"def post_ad_using_data(self, data, image_files=[]):...\n",
"\"\"\"docstring\"\"\"\n",
"resp = self.session.get(\n 'https://www.kijiji.ca/p-admarkt-post-ad.html?categoryId=773')\n",
"token_regex = \"initialXsrfToken: '\\\\S+'\"\n",
"image_upload_token = re.findall(token_regex, resp.text)[0].strip(\n \... | [
0,
0,
5,
5,
5,
5,
5,
0,
0,
0,
0,
0,
5,
5,
0,
5,
5,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"return 'submit user test %s for task %s (ID %d) %s' % (repr(self.filenames),\n self.task[1], self.task[0], self.url)\n"
] | [
"def describe(self):...\n",
"return 'submit user test %s for task %s (ID %d) %s' % (repr(self.filenames),\n self.task[1], self.task[0], self.url)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getint(self.section, 'num_threads')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getint(self.section, 'num_threads')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_4(VAR_0, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"db.engine.execute('ALTER TABLE \"{0}\" DROP COLUMN IF EXISTS \"{1}\"'.format(\n VAR_0, VAR_5))\n",
"print('FAILED TO DROP ATTRIBUTE {0} FROM {1}'.format(VAR_5, VAR_0))\n"
] | [
"def drop_attribute(table_name, attr):...\n",
"\"\"\"docstring\"\"\"\n",
"db.engine.execute('ALTER TABLE \"{0}\" DROP COLUMN IF EXISTS \"{1}\"'.format(\n table_name, attr))\n",
"print('FAILED TO DROP ATTRIBUTE {0} FROM {1}'.format(attr, table_name))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_36(self, VAR_14):...\n",
"return self.__class__(self.get_related_model(VAR_14), self.session)\n"
] | [
"def get_related_interface(self, col_name):...\n",
"return self.__class__(self.get_related_model(col_name), self.session)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(self, VAR_5):...\n",
"self.ids += 1\n",
"self.actors[self.ids] = VAR_5\n",
"self.actors[self.ids].bound(self.max_x, self.max_y)\n",
"return self.ids\n"
] | [
"def addActor(self, actor):...\n",
"self.ids += 1\n",
"self.actors[self.ids] = actor\n",
"self.actors[self.ids].bound(self.max_x, self.max_y)\n",
"return self.ids\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"AugAssign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"VAR_22 = self.add_argument_group('Mechanical Turk')\n",
"VAR_23 = VAR_20.path.join(self.parlai_home, 'logs', 'mturk')\n",
"VAR_22.add_argument('--mturk-log-path', default=default_log_path, help=\n 'path to MTurk logs, defaults to {parlai_dir}/logs/mturk')\n",
"VAR_22.add_argume... | [
"def add_mturk_args(self):...\n",
"mturk = self.add_argument_group('Mechanical Turk')\n",
"default_log_path = os.path.join(self.parlai_home, 'logs', 'mturk')\n",
"mturk.add_argument('--mturk-log-path', default=default_log_path, help=\n 'path to MTurk logs, defaults to {parlai_dir}/logs/mturk')\n",
"mturk... | [
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'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_13 = []\n",
"VAR_14 = datetime.now(timezone(timedelta(hours=+9), 'JST'))\n",
"VAR_14 = VAR_14.replace(hour=0, minute=0, second=0, microsecond=0)\n",
"for day in range(30)[::-1]:\n",
"VAR_23 = VAR_14 - timedelta(days=day)\n",
"return VAR_13\n",
"VAR_24 = VAR_14 - timedelt... | [
"def thirty_day_data(self):...\n",
"data = []\n",
"today = datetime.now(timezone(timedelta(hours=+9), 'JST'))\n",
"today = today.replace(hour=0, minute=0, second=0, microsecond=0)\n",
"for day in range(30)[::-1]:\n",
"from_date = today - timedelta(days=day)\n",
"return data\n",
"to_date = today - time... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@VAR_1.route('/run')...\n",
"return render_template('run.html')\n"
] | [
"@app.route('/run')...\n",
"return render_template('run.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(VAR_7):...\n",
"return urlparse.urljoin(CLASS_0.server_location, VAR_7)\n"
] | [
"def _BuildUri(handler):...\n",
"return urlparse.urljoin(BaseRequest.server_location, handler)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@detail_route(methods=['get'])...\n",
"\"\"\"docstring\"\"\"\n",
"get_and_check_project(VAR_9, VAR_11)\n",
"VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n",
"VAR_23 = max(0, int(VAR_9.query_params.get('line', 0)))\n",
"VAR_24 = VAR_28.console_output or ''\n",
"return Response('\\n'.join(VAR_... | [
"@detail_route(methods=['get'])...\n",
"\"\"\"docstring\"\"\"\n",
"get_and_check_project(request, project_pk)\n",
"task = self.queryset.get(pk=pk, project=project_pk)\n",
"line_num = max(0, int(request.query_params.get('line', 0)))\n",
"output = task.console_output or ''\n",
"return Response('\\n'.join(... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self, *VAR_9, **VAR_10):...\n",
"self.render('app.html', VAR_2={})\n"
] | [
"def get(self, *a, **kwargs):...\n",
"self.render('app.html', page_json={})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_13(self):...\n",
"self.conditions = []\n",
"self.grouped_or_conditions = []\n",
"self.build_filter_conditions(self.filters, self.conditions)\n",
"self.build_filter_conditions(self.or_filters, self.grouped_or_conditions)\n",
"if not self.flags.ignore_permissions:\n",
"VAR_59 = self.build_match_... | [
"def build_conditions(self):...\n",
"self.conditions = []\n",
"self.grouped_or_conditions = []\n",
"self.build_filter_conditions(self.filters, self.conditions)\n",
"self.build_filter_conditions(self.or_filters, self.grouped_or_conditions)\n",
"if not self.flags.ignore_permissions:\n",
"match_conditions ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Expr'"
] |
[
"@mock.patch('requests.post', FUNC_0)...\n",
"\"\"\"docstring\"\"\"\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",
"VAR_4 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\... | [
"@mock.patch('requests.post', mock_import_repository_task)...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"respon... | [
0,
0,
0,
5,
0,
0,
0,
5,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
5
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Ex... |
[
"__all__ = []\n",
"__version__ = '2019.7.7'\n",
"VAR_0 = 'common.apps.CommonConfig'\n"
] | [
"__all__ = []\n",
"__version__ = '2019.7.7'\n",
"default_app_config = 'common.apps.CommonConfig'\n"
] | [
0,
4,
0
] | [
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_15(self, VAR_6):...\n",
""
] | [
"def set_priority(self, priority):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = shlex.split('{0} --install'.format(self.binary))\n",
"VAR_7 = spawn(VAR_6, stdout=PIPE, stderr=PIPE, env=self.env)\n",
"VAR_10, VAR_9 = VAR_7.communicate()\n",
"if VAR_9 is not None and len(VAR_9) > 0:\n",
"if sys.version_info >= (3,):\n",
... | [
"def _install_linters(self):...\n",
"\"\"\"docstring\"\"\"\n",
"args = shlex.split('{0} --install'.format(self.binary))\n",
"gometalinter = spawn(args, stdout=PIPE, stderr=PIPE, env=self.env)\n",
"_, err = gometalinter.communicate()\n",
"if err is not None and len(err) > 0:\n",
"if sys.version_info >= (... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5=False):...\n",
"VAR_8 = \"SELECT * FROM analyzed WHERE base_url = '\" + str(VAR_2) + \"';\"\n",
"VAR_9 = self.db.exec(VAR_8)\n",
"if len(VAR_9) > 0:\n",
"VAR_0.info('tried to analyze {}, but has already been done.'.format(VAR_2))\n",
"if 'smash.gg' in VAR_2:\n"... | [
"def process(self, bracket, scene, display_name, new_bracket=False):...\n",
"sql = \"SELECT * FROM analyzed WHERE base_url = '\" + str(bracket) + \"';\"\n",
"result = self.db.exec(sql)\n",
"if len(result) > 0:\n",
"LOG.info('tried to analyze {}, but has already been done.'.format(bracket))\n",
"if 'smash.... | [
0,
4,
4,
0,
0,
0,
0,
4,
0,
0,
0,
4,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.