lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_12(self):...\n",
"VAR_21 = []\n",
"VAR_18 = threading.Event()\n",
"self.mock(VAR_18, 'wait', self.fail)\n",
"self.mock(bot_main, 'run_manifest', self.fail)\n",
"self.mock(bot_main, 'update_bot', self.fail)\n",
"self.mock(self.bot, 'restart', lambda *VAR_24: VAR_21.append(VAR_24))\n",
"self.e... | [
"def test_poll_server_restart(self):...\n",
"restart = []\n",
"bit = threading.Event()\n",
"self.mock(bit, 'wait', self.fail)\n",
"self.mock(bot_main, 'run_manifest', self.fail)\n",
"self.mock(bot_main, 'update_bot', self.fail)\n",
"self.mock(self.bot, 'restart', lambda *args: restart.append(args))\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"self.driver._eql_execute('pool', 'select', self.configuration.eqlx_pool, 'show'\n ).AndReturn(['TotalCapacity: 111GB', 'FreeSpace: 11GB'])\n",
"self.mox.ReplayAll()\n",
"self.driver._update_volume_st... | [
"def test_update_volume_stats(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"self.driver._eql_execute('pool', 'select', self.configuration.eqlx_pool, 'show'\n ).AndReturn(['TotalCapacity: 111GB', 'FreeSpace: 11GB'])\n",
"self.mox.ReplayAll()\n",
"self.driver.... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"VAR_30 = {comment for comment in VAR_3.comments()}\n",
"VAR_31 = {VAR_27 for VAR_27 in VAR_2.inbox.unread()}\n",
"print('received first stream')\n",
"while True:\n",
"sleep(6)\n",
"VAR_9 = time.time()\n",
"VAR_47 = {comment for comment in VAR_3.comments()}\n",
"VAR_48 = VAR_47... | [
"def stream_comments_messages():...\n",
"previous_comments = {comment for comment in subreddit.comments()}\n",
"previous_messages = {message for message in reddit.inbox.unread()}\n",
"print('received first stream')\n",
"while True:\n",
"sleep(6)\n",
"last_action = time.time()\n",
"updated_comments = {... | [
0,
4,
4,
4,
4,
4,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Expr'",
"For",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_4(VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = list(FUNC_6(VAR_5).keys())\n",
"VAR_13 = False\n",
"for VAR_47 in VAR_12:\n",
"if VAR_47[-3:] == '.py':\n",
"return VAR_13\n",
"VAR_13 = True\n"
] | [
"def check_pythonic_pr(data):...\n",
"\"\"\"docstring\"\"\"\n",
"files = list(get_files_involved_in_pr(data).keys())\n",
"pythonic = False\n",
"for file in files:\n",
"if file[-3:] == '.py':\n",
"return pythonic\n",
"pythonic = True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"@app.route('/')...\n",
"return render_template('index.html', title='GenSET')\n"
] | [
"@app.route('/')...\n",
"return render_template('index.html', title='GenSET')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_16(self, VAR_11):...\n",
"if not self._IsServerAlive():\n",
"return\n",
"SendEventNotificationAsync('BufferUnload', {'unloaded_buffer': VAR_11})\n"
] | [
"def OnBufferUnload(self, deleted_buffer_file):...\n",
"if not self._IsServerAlive():\n",
"return\n",
"SendEventNotificationAsync('BufferUnload', {'unloaded_buffer':\n deleted_buffer_file})\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_10(VAR_6, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = sql.connect('messages.db')\n",
"VAR_36 = sql.connect('comments.db')\n",
"VAR_31 = VAR_28.cursor()\n",
"VAR_37 = VAR_36.cursor()\n",
"if VAR_17 is None:\n",
"VAR_20 = (\"\"\"DELETE FROM messages\n WHERE id = {0};\n... | [
"def delete_from_messages(message, comment):...\n",
"\"\"\"docstring\"\"\"\n",
"message_con = sql.connect('messages.db')\n",
"comments_con = sql.connect('comments.db')\n",
"message_cur = message_con.cursor()\n",
"comments_cur = comments_con.cursor()\n",
"if comments is None:\n",
"cmd = (\"\"\"DELETE F... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",... |
[
"from jupyter_core.paths import jupyter_data_dir\n",
"import subprocess\n",
"import os\n",
"VAR_0 = os.path.join(jupyter_data_dir(), 'notebook.pem')\n",
"VAR_1 = get_config()\n",
"VAR_1.NotebookApp.ip = os.getenv('INTERFACE', '') or '*'\n",
"VAR_1.NotebookApp.port = int(os.getenv('PORT', '') or 8888)\n"... | [
"from jupyter_core.paths import jupyter_data_dir\n",
"import subprocess\n",
"import os\n",
"PEM_FILE = os.path.join(jupyter_data_dir(), 'notebook.pem')\n",
"c = get_config()\n",
"c.NotebookApp.ip = os.getenv('INTERFACE', '') or '*'\n",
"c.NotebookApp.port = int(os.getenv('PORT', '') or 8888)\n",
"c.No... | [
5,
5,
0,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5
] | [
"ImportFrom'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Assign'",
"ImportFrom'",
"Assign'"
] |
[
"def FUNC_1(VAR_5):...\n",
"if not VAR_6:\n",
"return\n",
"VAR_20 = UltiSnips_Manager._snips('', 1)\n",
"return\n",
"VAR_5['ultisnips_snippets'] = [{'trigger': x.trigger, 'description': x.\n description} for x in VAR_20]\n"
] | [
"def _AddUltiSnipsDataIfNeeded(extra_data):...\n",
"if not USE_ULTISNIPS_DATA:\n",
"return\n",
"rawsnips = UltiSnips_Manager._snips('', 1)\n",
"return\n",
"extra_data['ultisnips_snippets'] = [{'trigger': x.trigger, 'description': x\n .description} for x in rawsnips]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_3(self):...\n",
"VAR_12 = set()\n",
"VAR_13 = []\n",
"VAR_14 = 0\n",
"print('\\nStart')\n",
"VAR_15 = self.build_url(self.start_wiki, True)\n",
"VAR_16 = requests.Session()\n",
"while VAR_14 < self.MAX_PATH_LENGTH:\n",
"VAR_18 = VAR_16.get(VAR_15)\n",
"return False\n",
"VAR_19 = Beauti... | [
"def crawler(self):...\n",
"cycle_check = set()\n",
"path = []\n",
"path_length = 0\n",
"print('\\nStart')\n",
"url = self.build_url(self.start_wiki, True)\n",
"session = requests.Session()\n",
"while path_length < self.MAX_PATH_LENGTH:\n",
"html = session.get(url)\n",
"return False\n",
"soup = ... | [
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
1,
1,
1,
0,
1,
0,
1,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Expr'",
"Return'",
"Assign'",
... |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.WRONG_PASSWORD, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.WRONG_PASSWORD, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_47(self, VAR_14):...\n",
"return list(self.list_properties[VAR_14].local_columns)[0]\n"
] | [
"def get_relation_fk(self, col_name):...\n",
"return list(self.list_properties[col_name].local_columns)[0]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2=None, VAR_3=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = posixpath.normpath(VAR_1)\n",
"VAR_1 = VAR_1.lstrip('/')\n",
"VAR_10 = ''\n",
"for VAR_18 in VAR_1.split('/'):\n",
"if not VAR_18:\n",
"if VAR_10 and VAR_1 != VAR_10:\n",
"VAR_17, VAR_18 = os.path.splitdri... | [
"def serve(request, path, document_root=None, show_indexes=False):...\n",
"\"\"\"docstring\"\"\"\n",
"path = posixpath.normpath(path)\n",
"path = path.lstrip('/')\n",
"newpath = ''\n",
"for part in path.split('/'):\n",
"if not part:\n",
"if newpath and path != newpath:\n",
"drive, part = os.path.spl... | [
0,
0,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
0,
6,
0,
0,
6,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
... |
[
"def FUNC_4(self, VAR_1, VAR_2, VAR_5, VAR_10=None, VAR_11=False, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_10:\n",
"VAR_10 = []\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"VAR_29 = {}\n",
"for VAR_48 in VAR_5:\n",
"VAR_29[VAR_48] = {}.fromkeys(VAR_10, 0.0)\n",
"for VAR_55 in VAR_... | [
"def _product_available(self, cr, uid, ids, field_names=None, arg=False,...\n",
"\"\"\"docstring\"\"\"\n",
"if not field_names:\n",
"field_names = []\n",
"if context is None:\n",
"context = {}\n",
"res = {}\n",
"for id in ids:\n",
"res[id] = {}.fromkeys(field_names, 0.0)\n",
"for f in field_names:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"For",
"Assign'"
] |
[
"@rest_utils.ajax(data_required=True)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_23 = VAR_1.DATA.get('operation', 'none')\n",
"VAR_24 = {'stop': api.nova.server_stop, 'start': api.nova.server_start,\n 'pause': api.nova.server_pause, 'unpause': api.nova.server_unpause,\n 'suspend': api.nova.server_suspend, '... | [
"@rest_utils.ajax(data_required=True)...\n",
"\"\"\"docstring\"\"\"\n",
"operation = request.DATA.get('operation', 'none')\n",
"operations = {'stop': api.nova.server_stop, 'start': api.nova.server_start,\n 'pause': api.nova.server_pause, 'unpause': api.nova.server_unpause,\n 'suspend': api.nova.server_s... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_15 = super(CLASS_0, self).get_template_namespace()\n",
"VAR_15['css_urls'] = self.assets['css_all'].urls()\n",
"VAR_15['js_urls'] = self.assets['js_all'].urls()\n",
"VAR_15['system_name'] = options.system_name\n",
"VAR_15['SERVER_DEBUG'] = options.server_debug\n",
"VAR_15[... | [
"def get_template_namespace(self):...\n",
"_ = super(BaseHandler, self).get_template_namespace()\n",
"_['css_urls'] = self.assets['css_all'].urls()\n",
"_['js_urls'] = self.assets['js_all'].urls()\n",
"_['system_name'] = options.system_name\n",
"_['SERVER_DEBUG'] = options.server_debug\n",
"_['ip'] = se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self, VAR_19, VAR_17, VAR_16):...\n",
"VAR_25 = self.media_types.get_type(VAR_17)\n",
"if VAR_25.startswith('text/') or VAR_25 == 'application/javascript':\n",
"VAR_33 = {'charset': str(self.charset)}\n",
"VAR_33 = {}\n",
"VAR_19.add_header('Content-Type', str(VAR_25), **params)\n"
] | [
"def add_mime_headers(self, headers, path, url):...\n",
"media_type = self.media_types.get_type(path)\n",
"if media_type.startswith('text/') or media_type == 'application/javascript':\n",
"params = {'charset': str(self.charset)}\n",
"params = {}\n",
"headers.add_header('Content-Type', str(media_type), **p... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_2: str):...\n",
"\"\"\"docstring\"\"\"\n",
"return CLASS_0.query.filter_by(VAR_2=username).one_or_none()\n"
] | [
"def get_by_username(self, username: str):...\n",
"\"\"\"docstring\"\"\"\n",
"return User.query.filter_by(username=username).one_or_none()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"if self.first_start_grid != NotImplemented:\n",
"self.first_start_grid.destroy()\n",
"self.container = Gtk.Notebook()\n",
"self.container.set_border_width(0)\n",
"self.container.set_scrollable(True)\n",
"self.container.set_show_border(False)\n",
"self.container.connect('swit... | [
"def create_container(self):...\n",
"if self.first_start_grid != NotImplemented:\n",
"self.first_start_grid.destroy()\n",
"self.container = Gtk.Notebook()\n",
"self.container.set_border_width(0)\n",
"self.container.set_scrollable(True)\n",
"self.container.set_show_border(False)\n",
"self.container.con... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1():...\n",
"return frappe.db.sql('string', as_dict=1)\n"
] | [
"def get_children():...\n",
"return frappe.db.sql(\n \"\"\"select route as name,\n\t\ttitle from `tabBlog Category`\n\t\twhere published = 1\n\t\tand exists (select name from `tabBlog Post`\n\t\t\twhere `tabBlog Post`.blog_category=`tabBlog Category`.name and published=1)\n\t\torder by title asc\"\"\"\n , a... | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = 0\n",
"VAR_21 = []\n",
"VAR_22 = _co.defaultdict(lambda : None)\n",
"VAR_23 = _co.defaultdict(lambda : None)\n",
"VAR_24 = _co.defaultdict(lambda : False)\n",
"def FUNC_18(VAR_25):...\n",
"VAR_22[VAR_25] = VAR_20\n",
"VAR_23[VAR_25] =... | [
"def reduceToGCC(self):...\n",
"\"\"\"docstring\"\"\"\n",
"index = 0\n",
"S = []\n",
"indices = _co.defaultdict(lambda : None)\n",
"lowlink = _co.defaultdict(lambda : None)\n",
"onstack = _co.defaultdict(lambda : False)\n",
"def strong_connect(v):...\n",
"indices[v] = index\n",
"lowlink[v] = index... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"AugAssign'",
"Expr'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"A... |
[
"def FUNC_6(self, VAR_33):...\n",
"if not VAR_33:\n",
"return\n",
"VAR_33 = int(VAR_33)\n",
"VAR_101.errors.add(errors.BAD_NUMBER)\n",
"if self.min is not None and VAR_33 < self.min:\n",
"VAR_33 = self.min\n",
"if self.max is not None and VAR_33 > self.max:\n",
"return VAR_33\n",
"VAR_33 = self.ma... | [
"def run(self, val):...\n",
"if not val:\n",
"return\n",
"val = int(val)\n",
"c.errors.add(errors.BAD_NUMBER)\n",
"if self.min is not None and val < self.min:\n",
"val = self.min\n",
"if self.max is not None and val > self.max:\n",
"return val\n",
"val = self.max\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"\"\"\"string\"\"\"\n",
"__docformat__ = 'reStructuredText en'\n",
"__all__ = ['TraversalPath', 'TraversalPathNode']\n",
"\"\"\"\n Value object representing a node in a traversal path.\n \"\"\"\n",
"def __init__(self, VAR_0, VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.proxy = VAR_0\n",
... | [
"\"\"\"\nThis file is part of the everest project.\nSee LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.\n\nCreated on Oct 16, 2013.\n\"\"\"\n",
"__docformat__ = 'reStructuredText en'\n",
"__all__ = ['TraversalPath', 'TraversalPathNode']\n",
"\"\"\"\n Value object representing a nod... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
0
] | [
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Expr'",
"FunctionDef'",
"Return... |
[
"def FUNC_40(self, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = getattr(self, 'parent_doc', self)\n",
"if hasattr(VAR_11, 'format_data_map'):\n",
"return VAR_16 in VAR_11.format_data_map\n",
"return True\n"
] | [
"def in_format_data(self, fieldname):...\n",
"\"\"\"docstring\"\"\"\n",
"doc = getattr(self, 'parent_doc', self)\n",
"if hasattr(doc, 'format_data_map'):\n",
"return fieldname in doc.format_data_map\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_18 = 'URL: %s\\n' % unicode(self.url)\n",
"if self.response is not None:\n",
"VAR_18 += \"\"\"\nREQUEST HEADERS\n\"\"\"\n",
"VAR_18 += \"\"\"\nNO REQUEST INFORMATION AVAILABLE\n\"\"\"\n",
"for key, value in self.response.request.headers.iteritems():\n",
"if self.res_data i... | [
"def specific_info(self):...\n",
"res = 'URL: %s\\n' % unicode(self.url)\n",
"if self.response is not None:\n",
"res += \"\"\"\nREQUEST HEADERS\n\"\"\"\n",
"res += \"\"\"\nNO REQUEST INFORMATION AVAILABLE\n\"\"\"\n",
"for key, value in self.response.request.headers.iteritems():\n",
"if self.res_data is ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"AugAssign'",
"AugAssign'",
"For",
"Condition",
"AugAssign'",
"AugAssign'",
"Assign'",
"AugAssign'",
"AugAssign'",
"Return'",
"AugAssign'"
] |
[
"def FUNC_2(self, VAR_0=''):...\n",
"self.check()\n",
"VAR_4 = {'error_info': VAR_0, 'name': self.email, 'xsrf_token': self.\n xsrf_from_html()}\n",
"VAR_5 = self.wrap_html('templates/pwdchange.html', VAR_4)\n",
"return self.write(VAR_5)\n"
] | [
"def get(self, error=''):...\n",
"self.check()\n",
"params = {'error_info': error, 'name': self.email, 'xsrf_token': self.\n xsrf_from_html()}\n",
"body = self.wrap_html('templates/pwdchange.html', params)\n",
"return self.write(body)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15, VAR_16 = FUNC_2(VAR_0)\n",
"VAR_11 = paramiko.client.SSHClient()\n",
"VAR_11.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n",
"VAR_11.connect(VAR_15=username, VAR_23=SERVER_PASSWORD, VAR_16=hostname)\n",
"return VAR_11\n"
] | [
"def open_ssh_client():...\n",
"\"\"\"docstring\"\"\"\n",
"username, hostname = get_connection_tuple(CONNECTION_STRING)\n",
"client = paramiko.client.SSHClient()\n",
"client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n",
"client.connect(username=username, password=SERVER_PASSWORD, hostname=host... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for et in ExtractedText.objects.all():\n",
"VAR_13 = et.data_document\n",
"VAR_14, VAR_15 = create_detail_formset(VAR_13, EXTRA)\n",
"VAR_16 = VAR_14(instance=et)\n",
"VAR_17 = VAR_15(instance=et)\n",
"VAR_18 = get_extracted_models(VAR_13.data_grou... | [
"def test_every_extractedtext(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for et in ExtractedText.objects.all():\n",
"dd = et.data_document\n",
"ParentForm, ChildForm = create_detail_formset(dd, EXTRA)\n",
"extracted_text_form = ParentForm(instance=et)\n",
"child_formset = ChildForm(instance=et)\n",
"dd... | [
0,
0,
0,
0,
0,
6,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = StringIO.StringIO()\n",
"VAR_10 = hashlib.sha1()\n",
"for name, content in FUNC_2(VAR_2, VAR_3, VAR_4, VAR_5):\n",
"zip_file.writestr(name, content)\n",
"VAR_11 = VAR_9.getvalue()\n",
"VAR_10.update(str(len(name)))\n",... | [
"def get_swarming_bot_zip(root_dir, host, host_version, additionals):...\n",
"\"\"\"docstring\"\"\"\n",
"zip_memory_file = StringIO.StringIO()\n",
"h = hashlib.sha1()\n",
"for name, content in yield_swarming_bot_files(root_dir, host, host_version,\n",
"zip_file.writestr(name, content)\n",
"data = zip_me... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Expr'"
] |
[
"def FUNC_10(self):...\n",
"VAR_2 = 'response'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 500, 'error message',\n None, None))\n",
"time.sleep(mox.IgnoreArg())\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.Igno... | [
"def testUrlOpenHTTPErrorWithRetry(self):...\n",
"response = 'response'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 500, 'error message',\n None, None))\n",
"time.sleep(mox.IgnoreArg())\n",
"url_helper.urllib2.urlopen(... | [
0,
0,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@atomic...\n",
"VAR_12, VAR_6 = self.common()\n",
"if not VAR_2.replace('_', '').isalnum():\n",
"if not self.quiet:\n",
"if VAR_2 in ['head', 'workspace', 'stage']:\n",
"print('Branch name has to be alpha numeric with underscores', file=sys.stderr)\n",
"self.ipfs.files_stat(self.get_mfs_path(self.fs_cw... | [
"@atomic...\n",
"_, branch = self.common()\n",
"if not name.replace('_', '').isalnum():\n",
"if not self.quiet:\n",
"if name in ['head', 'workspace', 'stage']:\n",
"print('Branch name has to be alpha numeric with underscores', file=sys.stderr)\n",
"self.ipfs.files_stat(self.get_mfs_path(self.fs_cwd, nam... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Condition",
"Expr'",
"For",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",... |
[
"def FUNC_21(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 4}, 'CONFIDENCE': {'HIGH': 4}}\n",
"self.check_example('mktemp.py', VAR_2)\n"
] | [
"def test_mktemp(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 4}, 'CONFIDENCE': {'HIGH': 4}}\n",
"self.check_example('mktemp.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"VAR_21 = shellutil.run_get_output('pgrep -n dhclient', VAR_10=False)\n",
"return VAR_21[1] if VAR_21[0] == 0 else None\n"
] | [
"def get_dhcp_pid(self):...\n",
"ret = shellutil.run_get_output('pgrep -n dhclient', chk_err=False)\n",
"return ret[1] if ret[0] == 0 else None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@functools.wraps(VAR_58)...\n",
"return VAR_58(*VAR_61, **kwargs)\n"
] | [
"@functools.wraps(orig_attr)...\n",
"return orig_attr(*args, **kwargs)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_69, VAR_63 = self.get('/mails', {'q': [VAR_41], 'w': [str(VAR_40)], 'p':\n [str(VAR_39)]})\n",
"VAR_69 = yield VAR_69\n",
"defer.returnValue([ResponseMail(m) for m in VAR_69['mails']])\n"
] | [
"@defer.inlineCallbacks...\n",
"res, _ = self.get('/mails', {'q': [query], 'w': [str(window)], 'p': [str(\n page)]})\n",
"res = yield res\n",
"defer.returnValue([ResponseMail(m) for m in res['mails']])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_13(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"return block.path_to_kname(VAR_1).startswith('bcache')\n"
] | [
"def identify_bcache(device):...\n",
"\"\"\"docstring\"\"\"\n",
"return block.path_to_kname(device).startswith('bcache')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@app.route('/manage/posts', methods=['GET', 'POST'])...\n",
"if current_user.is_authenticated:\n",
"VAR_8 = PostCreateForm()\n",
"return redirect('/index')\n",
"if VAR_8.validate_on_submit():\n",
"VAR_12 = Post(VAR_11=createform.title.data, VAR_9=createform.body.data,\n imageurl=createform.imageurl.da... | [
"@app.route('/manage/posts', methods=['GET', 'POST'])...\n",
"if current_user.is_authenticated:\n",
"createform = PostCreateForm()\n",
"return redirect('/index')\n",
"if createform.validate_on_submit():\n",
"post = Post(title=createform.title.data, body=createform.body.data,\n imageurl=createform.image... | [
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Return'"
] |
[
"from __future__ import unicode_literals\n",
"import frappe\n",
"from frappe.utils import getdate, add_days, today, cint\n",
"from frappe import _\n",
"def FUNC_0(VAR_0=None):...\n",
"VAR_1 = FUNC_1()\n",
"VAR_2 = FUNC_2(VAR_0)\n",
"return VAR_1, VAR_2\n"
] | [
"from __future__ import unicode_literals\n",
"import frappe\n",
"from frappe.utils import getdate, add_days, today, cint\n",
"from frappe import _\n",
"def execute(filters=None):...\n",
"columns = get_columns()\n",
"data = get_data(filters)\n",
"return columns, data\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(VAR_2, VAR_3):...\n",
"VAR_7 = Tag.query.filter_by(name=tagname).first()\n",
"if VAR_7:\n",
"return VAR_7, False\n",
"VAR_14 = datetime.utcnow()\n",
"VAR_7 = Tag(name=tagname, VAR_14=created)\n",
"VAR_2.add(VAR_7)\n",
"return VAR_7, True\n"
] | [
"def get_or_create_tag(session, tagname):...\n",
"instance = Tag.query.filter_by(name=tagname).first()\n",
"if instance:\n",
"return instance, False\n",
"created = datetime.utcnow()\n",
"instance = Tag(name=tagname, created=created)\n",
"session.add(instance)\n",
"return instance, True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = (\n '--with-xunit --xunit-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --verbosity=2'\n .format(repo_dir=REPO_DIR, shard_str='/shard_' + self.shard if self.\n shard else ''))\n",
"VAR_7 = BokChoyTestSuite('', num_processes=1)\n"... | [
"def test_verbosity_settings_1_process(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expected_verbosity_string = (\n '--with-xunit --xunit-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --verbosity=2'\n .format(repo_dir=REPO_DIR, shard_str='/shard_' + self.shard if self.\n shard else ''))\n",
"sui... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_22(self, VAR_9=True, VAR_8=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_13.PROCESS_TYPE_RAYLET in self.all_processes:\n",
"self._kill_process_type(VAR_13.PROCESS_TYPE_RAYLET, VAR_9=check_alive,\n VAR_8=allow_graceful)\n",
"for VAR_7 in list(self.all_processes.keys()):\n",
"self._kill_pro... | [
"def kill_all_processes(self, check_alive=True, allow_graceful=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if ray_constants.PROCESS_TYPE_RAYLET in self.all_processes:\n",
"self._kill_process_type(ray_constants.PROCESS_TYPE_RAYLET, check_alive=\n check_alive, allow_graceful=allow_graceful)\n",
"for process... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"For",
"Expr'"
] |
[
"def __init__(self, VAR_7, *VAR_15, **VAR_16):...\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n"
] | [
"def __init__(self, param, *a, **kw):...\n",
"Validator.__init__(self, param, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"__revision__ = '$Rev$'\n",
"__date__ = '$Date$'\n",
"__author__ = '$Author$'\n",
"from django.db import connection, models, transaction\n",
"def FUNC_0(self, **VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = ['UPDATE', connection.ops.quote_name(self._meta.db_table), 'SET']\... | [
"\"\"\"\nUpdate only selected fields of a model.\n\nThe problem with model.save() is that it also overwrites all other\nfields with possibly stale data.\n\"\"\"\n",
"__revision__ = '$Rev$'\n",
"__date__ = '$Date$'\n",
"__author__ = '$Author$'\n",
"from django.db import connection, models, transaction\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
4,
4,
4,
0,
4,
4,
4,
0,
4,
4
] | [
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assi... |
[
"def __getattr__(self, VAR_8):...\n",
"if self._r_item_ is VAR_0:\n",
"if not self._r_via_alternate_lookup_:\n",
"VAR_28 = CLASS_3(self)\n",
"self._r_path_.log_getattr(VAR_8, self)\n",
"return self\n",
"if self._r_is_multi_item_:\n",
"VAR_33 = []\n",
"VAR_28._r_item_ = getattr(VAR_28._r_item_, VAR_8... | [
"def __getattr__(self, attr_name):...\n",
"if self._r_item_ is MISSING:\n",
"if not self._r_via_alternate_lookup_:\n",
"copy = Roamer(self)\n",
"self._r_path_.log_getattr(attr_name, self)\n",
"return self\n",
"if self._r_is_multi_item_:\n",
"multi_items = []\n",
"copy._r_item_ = getattr(copy._r_item... | [
0,
0,
0,
0,
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'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Condition... |
[
"def FUNC_6(self, VAR_17, VAR_16):...\n",
"if self.is_compressed_variant(VAR_17):\n",
"if self.index_file:\n",
"return self.find_file_at_path_with_indexes(VAR_17, VAR_16)\n",
"return self.get_static_file(VAR_17, VAR_16)\n"
] | [
"def find_file_at_path(self, path, url):...\n",
"if self.is_compressed_variant(path):\n",
"if self.index_file:\n",
"return self.find_file_at_path_with_indexes(path, url)\n",
"return self.get_static_file(path, url)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"@classmethod...\n",
"super(CLASS_0, VAR_6).prepare(VAR_9, VAR_10)\n"
] | [
"@classmethod...\n",
"super(JavacCompile, cls).prepare(options, round_manager)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_2(VAR_7=None, VAR_8=0, VAR_9=0):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_7 is None:\n",
"return True\n",
"return False\n",
"VAR_21 = re.match('^([^;]+)(; length=([0-9]+))?$', VAR_7, re.IGNORECASE)\n",
"VAR_22 = parse_http_date(VAR_21.group(1))\n",
"VAR_23 = VAR_21.group(3)\n",
"if VAR_23... | [
"def was_modified_since(header=None, mtime=0, size=0):...\n",
"\"\"\"docstring\"\"\"\n",
"if header is None:\n",
"return True\n",
"return False\n",
"matches = re.match('^([^;]+)(; length=([0-9]+))?$', header, re.IGNORECASE)\n",
"header_mtime = parse_http_date(matches.group(1))\n",
"header_len = matche... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition"
] |
[
"def FUNC_7(self, VAR_2, VAR_1=None):...\n",
"self.filter_string = '{0} = {1}'.format(self.name, VAR_2)\n",
"return self.filter_string\n"
] | [
"def filter(self, value, op=None):...\n",
"self.filter_string = '{0} = {1}'.format(self.name, value)\n",
"return self.filter_string\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self, VAR_1, VAR_2=None):...\n",
""
] | [
"def query_db(self, query, data=None):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@auth.route('/confirm/<token>')...\n",
"if current_user.confirmed:\n",
"return redirect(url_for('main.index'))\n",
"if current_user.confirm(VAR_0):\n",
"flash('Your account is confirmed. Thank you!')\n",
"flash('The confirmation link is invalid or has expired.')\n",
"return redirect(url_for('main.index... | [
"@auth.route('/confirm/<token>')...\n",
"if current_user.confirmed:\n",
"return redirect(url_for('main.index'))\n",
"if current_user.confirm(token):\n",
"flash('Your account is confirmed. Thank you!')\n",
"flash('The confirmation link is invalid or has expired.')\n",
"return redirect(url_for('main.index... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_40(self, VAR_35):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_40, (i, j) in VAR_35:\n",
"self.set_name(VAR_40, i, VAR_42=j)\n"
] | [
"def take_names(self, names):...\n",
"\"\"\"docstring\"\"\"\n",
"for name, (i, j) in names:\n",
"self.set_name(name, i, end=j)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'"
] |
[
"def FUNC_3(VAR_17):...\n",
"VAR_17 = VAR_17.split('_')[1]\n",
"VAR_13.execute(\"SELECT username FROM accounts WHERE address='%s'\" % ('xrb_' +\n VAR_17))\n",
"VAR_34 = VAR_13.fetchall()\n",
"if len(VAR_34) > 0:\n",
"return VAR_34[0][0]\n",
"VAR_13.execute(\"SELECT username FROM accounts WHERE addres... | [
"def check_registered_by_address(address):...\n",
"address = address.split('_')[1]\n",
"mycursor.execute(\"SELECT username FROM accounts WHERE address='%s'\" % (\n 'xrb_' + address))\n",
"result = mycursor.fetchall()\n",
"if len(result) > 0:\n",
"return result[0][0]\n",
"mycursor.execute(\"SELECT use... | [
0,
4,
4,
4,
4,
4,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"self.run_test_case(self.scenario.upsert_google_server_group_tags())\n"
] | [
"def Xtest_a_upsert_server_group_tags(self):...\n",
"self.run_test_case(self.scenario.upsert_google_server_group_tags())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'KWIK', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='QUICK', VAR_10=[{'name': '----QUICK'}, {'name':\n 'KWIK'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'KWIK', id='1')\n",
"verify_results(client, jwt, query='QUICK', expected=[{'name': '----QUICK'},\n {'name': 'KWIK'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_19=None, VAR_20=None, VAR_21=None, VAR_22=True):...\n",
"\"\"\"docstring\"\"\"\n",
"assert not (VAR_20 is None and VAR_21 is not None\n ), 'Cannot call metadata() with table= specified but not database='\n",
"VAR_36 = self._metadata.get('databases') or {}\n",
"VAR_37 = []\n",
"if ... | [
"def metadata(self, key=None, database=None, table=None, fallback=True):...\n",
"\"\"\"docstring\"\"\"\n",
"assert not (database is None and table is not None\n ), 'Cannot call metadata() with table= specified but not database='\n",
"databases = self._metadata.get('databases') or {}\n",
"search_list = []... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assert'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"For",
"Assign'",
"Condition",
"Return'",
"For",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_45(VAR_25):...\n",
"if VAR_25.fieldtype == 'Table':\n",
"return '{}: {}: {}'.format(_('Error'), _('Data missing in table'), _(VAR_25\n .label))\n",
"if self.parentfield:\n",
"return '{}: {} {} #{}: {}: {}'.format(_('Error'), VAR_54.bold(_(self.\n doctype)), _('Row'), self.idx, _('Value missi... | [
"def get_msg(df):...\n",
"if df.fieldtype == 'Table':\n",
"return '{}: {}: {}'.format(_('Error'), _('Data missing in table'), _(df.label))\n",
"if self.parentfield:\n",
"return '{}: {} {} #{}: {}: {}'.format(_('Error'), frappe.bold(_(self.\n doctype)), _('Row'), self.idx, _('Value missing for'), _(df.lab... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_9 = 0\n",
"for user, forum in self.forums:\n",
"VAR_1 = []\n",
"return VAR_9\n",
"self.log.debug('Scanning first page of the forum %s:%s', user, forum)\n",
"VAR_10 = self.site.get_page('1', forum, user)\n",
"VAR_11 = re.compile(regexp.f_sub_id.format(user, self.site.doma... | [
"def get_targets(self):...\n",
"found_count = 0\n",
"for user, forum in self.forums:\n",
"targets = []\n",
"return found_count\n",
"self.log.debug('Scanning first page of the forum %s:%s', user, forum)\n",
"page = self.site.get_page('1', forum, user)\n",
"rxp = re.compile(regexp.f_sub_id.format(user, ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"AugAssign'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"from __future__ import absolute_import, division, print_function\n",
"__metaclass__ = type\n",
"from ansible.inventory.group import Group\n",
"from ansible.utils.vars import combine_vars, get_unique_id\n",
"__all__ = ['Host']\n",
"\"\"\" a single ansible host \"\"\"\n",
"def __getstate__(self):...\n",
... | [
"from __future__ import absolute_import, division, print_function\n",
"__metaclass__ = type\n",
"from ansible.inventory.group import Group\n",
"from ansible.utils.vars import combine_vars, get_unique_id\n",
"__all__ = ['Host']\n",
"\"\"\" a single ansible host \"\"\"\n",
"def __getstate__(self):...\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Assign'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"return self.type == 'HP'\n"
] | [
"@property...\n",
"return self.type == 'HP'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_3(self, VAR_3=10):...\n",
"VAR_13 = self.db\n",
"self.schema.limit = VAR_3\n",
"VAR_14 = self.schema.flows()\n",
"VAR_15 = VAR_13.cursor()\n",
"VAR_15.execute('USE testgoflow')\n",
"VAR_15.execute(VAR_14)\n",
"VAR_16 = VAR_15.fetchall()\n",
"VAR_17 = Table()\n",
"VAR_17 = VAR_17.table_fr... | [
"def flow_table(self, limit=10):...\n",
"db = self.db\n",
"self.schema.limit = limit\n",
"FLOWS = self.schema.flows()\n",
"cursor = db.cursor()\n",
"cursor.execute('USE testgoflow')\n",
"cursor.execute(FLOWS)\n",
"r = cursor.fetchall()\n",
"t = Table()\n",
"t = t.table_from_rows(r, self.schema.col... | [
0,
0,
0,
0,
4,
4,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_20=True, *VAR_15, **VAR_16):...\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n",
"self.redirect = VAR_20\n"
] | [
"def __init__(self, param, redirect=True, *a, **kw):...\n",
"Validator.__init__(self, param, *a, **kw)\n",
"self.redirect = redirect\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_18(self, VAR_9=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(VAR_13.PROCESS_TYPE_RAYLET, VAR_9=check_alive)\n"
] | [
"def kill_raylet(self, check_alive=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(ray_constants.PROCESS_TYPE_RAYLET, check_alive=\n check_alive)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_1(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_0['REQUEST_METHOD'] == 'POST':\n",
"if VAR_0['REQUEST_METHOD'] == 'DELETE':\n",
"VAR_4 = FUNC_0(VAR_0)\n",
"VAR_1('500 ERROR', [('Content-Type', 'text/json')])\n",
"if VAR_0['REQUEST_METHOD'] == 'PUT':\n",
"VAR_6 = FUNC_0(VAR_0)\n",
... | [
"def api(environ, start_response):...\n",
"\"\"\"docstring\"\"\"\n",
"if environ['REQUEST_METHOD'] == 'POST':\n",
"if environ['REQUEST_METHOD'] == 'DELETE':\n",
"post = getFields(environ)\n",
"start_response('500 ERROR', [('Content-Type', 'text/json')])\n",
"if environ['REQUEST_METHOD'] == 'PUT':\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
4,
0,
4,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Expr'",
"Assign'",
"Re... |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return set(VAR_28 for VAR_28 in self.input if not VAR_28.exists and not \n VAR_28 in self.subworkflow_input)\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return set(f for f in self.input if not f.exists and not f in self.\n subworkflow_input)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_2(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"self.app.dispatch_request()\n",
"VAR_23 = OutstandingQueriesCache(VAR_32)\n",
"VAR_23.set(VAR_32.token, VAR_3)\n",
"VAR_32.persist()\n",
"return VAR_32.token\n"
] | [
"def add_outstanding_query(self, came_from):...\n",
"\"\"\"docstring\"\"\"\n",
"self.app.dispatch_request()\n",
"oq_cache = OutstandingQueriesCache(session)\n",
"oq_cache.set(session.token, came_from)\n",
"session.persist()\n",
"return session.token\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_10 in self._rules\n"
] | [
"def is_rule(self, name):...\n",
"\"\"\"docstring\"\"\"\n",
"return name in self._rules\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_27(VAR_40, VAR_41):...\n",
"VAR_71 = os.path.dirname(VAR_40)\n",
"if not os.path.isdir(VAR_71):\n",
"os.mkdir(VAR_71)\n",
"VAR_72 = open(VAR_40, 'w')\n",
"VAR_72.write(VAR_41)\n",
"VAR_72.close()\n"
] | [
"def save_keywords(filename, xml):...\n",
"tmp_dir = os.path.dirname(filename)\n",
"if not os.path.isdir(tmp_dir):\n",
"os.mkdir(tmp_dir)\n",
"file_desc = open(filename, 'w')\n",
"file_desc.write(xml)\n",
"file_desc.close()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_15(VAR_17):...\n",
"for VAR_55 in constants.TAGS_TO_COALESCE:\n",
"if VAR_17 in VAR_55:\n",
"return [VAR_17]\n",
"return VAR_55\n"
] | [
"def get_coalesce_tags(player):...\n",
"for tags in constants.TAGS_TO_COALESCE:\n",
"if player in tags:\n",
"return [player]\n",
"return tags\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self, VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._create_command('npm', VAR_13)\n"
] | [
"def npm_command(self, args):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._create_command('npm', args)\n"
] | [
0,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 1}, 'CONFIDENCE': {'MEDIUM': 1}}\n",
"self.check_example('binding.py', VAR_2)\n"
] | [
"def test_binding(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 1}, 'CONFIDENCE': {'MEDIUM': 1}}\n",
"self.check_example('binding.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(VAR_0, VAR_12, VAR_3, VAR_4):...\n",
"if VAR_12[0] or VAR_12[1] < 0:\n",
"VAR_33 = FUNC_9(VAR_0, VAR_12[:2], VAR_3)\n",
"VAR_34 = VAR_13[VAR_0](VAR_12[:1])\n",
"VAR_34 = VAR_3[VAR_33]\n",
"if VAR_12[2] < 0:\n",
"VAR_35 = VAR_3[VAR_12[2]]\n",
"VAR_35 = VAR_12[2]\n",
"VAR_7 = SymbolicInpu... | [
"def mod3Arith(op, params, symbols, symId):...\n",
"if params[0] or params[1] < 0:\n",
"sid = param2Simple(op, params[:2], symbols)\n",
"p1p2 = arithMap[op](params[:1])\n",
"p1p2 = symbols[sid]\n",
"if params[2] < 0:\n",
"p3 = symbols[params[2]]\n",
"p3 = params[2]\n",
"x = SymbolicInput(symId[0], '... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n",
"time.sleep(mox.IgnoreArg())\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRe... | [
"def testUrlOpenSuccessAfterFailure(self):...\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n",
"time.sleep(mox.IgnoreArg())\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=m... | [
0,
5,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"VAR_25 = self._create_host(VAR_7, VAR_10)\n",
"VAR_26 = self.common.create_vlun(VAR_7, VAR_25)\n",
"self.common.client_logout()\n",
"VAR_27 = self._get_iscsi_ip(VAR_25['name'])\n",
"VAR_28 = ... | [
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"host = self._create_host(volume, connector)\n",
"vlun = self.common.create_vlun(volume, host)\n",
"self.common.client_logout()\n",
"iscsi_ip = self._get_iscsi_ip(host['name'])\n",
"iscsi_ip_p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"return \"\"\"Username: %s\nPassword: %s\n\"\"\" % (self.username, self.password\n ) + CLASS_1.specific_info(self)\n"
] | [
"def specific_info(self):...\n",
"return \"\"\"Username: %s\nPassword: %s\n\"\"\" % (self.username, self.password\n ) + GenericRequest.specific_info(self)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self):...\n",
"self.content = VAR_2\n"
] | [
"def __init__(self):...\n",
"self.content = content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"super(CLASS_0, self).validate()\n",
"if not self.blog_intro:\n",
"self.blog_intro = self.content[:140]\n",
"if self.blog_intro:\n",
"self.blog_intro = strip_html_tags(self.blog_intro)\n",
"self.blog_intro = self.blog_intro[:140]\n",
"if self.published and not self.published_... | [
"def validate(self):...\n",
"super(BlogPost, self).validate()\n",
"if not self.blog_intro:\n",
"self.blog_intro = self.content[:140]\n",
"if self.blog_intro:\n",
"self.blog_intro = strip_html_tags(self.blog_intro)\n",
"self.blog_intro = self.blog_intro[:140]\n",
"if self.published and not self.publish... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_15):...\n",
"VAR_27 = CLASS_1()\n",
"yield VAR_27.write(u'\\ufeff')\n",
"VAR_38 = next(VAR_15)\n",
"VAR_30 = csv.DictWriter(VAR_27, VAR_38.keys())\n",
"VAR_32 = dict(zip(VAR_38.keys(), VAR_38.keys()))\n",
"yield VAR_30.writerow(VAR_32)\n",
"yield VAR_30.writerow(VAR_38)\n",
"f... | [
"def _make_flat_wins_csv_stream(self, win_data_generator):...\n",
"stringio = Echo()\n",
"yield stringio.write(u'\\ufeff')\n",
"first = next(win_data_generator)\n",
"csv_writer = csv.DictWriter(stringio, first.keys())\n",
"header = dict(zip(first.keys(), first.keys()))\n",
"yield csv_writer.writerow(hea... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_7(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = collections.OrderedDict()\n",
"for field_name in self.win_fields:\n",
"if field_name in self.IGNORE_FIELDS:\n",
"VAR_22['contributing advisors/team'] = ', '.join(map(str, self.table_maps[\n 'advisors'][VAR_5['id']]))\n",
"VAR_46 = ... | [
"def _get_win_data(self, win):...\n",
"\"\"\"docstring\"\"\"\n",
"win_data = collections.OrderedDict()\n",
"for field_name in self.win_fields:\n",
"if field_name in self.IGNORE_FIELDS:\n",
"win_data['contributing advisors/team'] = ', '.join(map(str, self.table_maps\n ['advisors'][win['id']]))\n",
"mo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
... |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"VAR_24 = self.common.create_cloned_volume(VAR_7, VAR_8)\n",
"self.common.client_logout()\n",
"return {'metadata': VAR_24}\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\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,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import sys\n",
"from hp3parclient import exceptions as hpexceptions\n",
"from cinder import exception\n",
"from cinder.openstack.common import log as logging\n",
"from cinder import utils\n",
"import cinder.volume.driver\n",
"from cinder.volume.drivers.san.hp import hp_3par_co... | [
"\"\"\"\nVolume driver for HP 3PAR Storage array.\nThis driver requires 3.1.2 MU2 firmware on the 3PAR array.\n\nYou will need to install the python hp3parclient.\nsudo pip install hp3parclient\n\nSet the following in the cinder.conf file to enable the\n3PAR iSCSI Driver along with the required flags:\n\nvolume_dri... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.shellcmd = VAR_81\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.shellcmd = cmd\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_2 = CLASS_1.construct_testscript_command('test_input_program.py')\n",
"VAR_3, VAR_4 = run_shell_command(VAR_2, '1 4 10 22')\n",
"self.assertEqual(VAR_3, '37\\n')\n",
"self.assertEqual(VAR_4, '')\n",
"VAR_3, VAR_4 = run_shell_command(VAR_2, '1 p 5')\n",
"self.assertEqual... | [
"def test_run_shell_command_with_stdin(self):...\n",
"command = RunShellCommandTest.construct_testscript_command(\n 'test_input_program.py')\n",
"stdout, stderr = run_shell_command(command, '1 4 10 22')\n",
"self.assertEqual(stdout, '37\\n')\n",
"self.assertEqual(stderr, '')\n",
"stdout, stderr = ru... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertEqual(tournament.check_version((2, 4)), 1)\n"
] | [
"def test_older_python_version(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertEqual(tournament.check_version((2, 4)), 1)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"@app.route(...\n",
"app.logger.debug('moving sequence item {}: direction: {}'.format(VAR_9,\n VAR_3['direction']))\n",
"VAR_31 = [VAR_31 for VAR_31, item in enumerate(VAR_19.sequence_items) if \n item.id == VAR_9]\n",
"if not VAR_31:\n",
"VAR_31 = VAR_31[0]\n",
"VAR_32 = VAR_31 - 1 if VAR_3['direct... | [
"@app.route(...\n",
"app.logger.debug('moving sequence item {}: direction: {}'.format(\n sequence_item_id, json['direction']))\n",
"index = [index for index, item in enumerate(sequence.sequence_items) if \n item.id == sequence_item_id]\n",
"if not index:\n",
"index = index[0]\n",
"new_index = index ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"@VAR_0.route('/level-2/index')...\n",
"VAR_21 = psycopg2.connect('dbname=unlock user=ubuntu')\n",
"VAR_22 = VAR_21.cursor()\n",
"VAR_22.execute('SELECT * FROM nile_items;')\n",
"VAR_23 = VAR_22.fetchall()\n",
"VAR_22.close()\n",
"VAR_21.close()\n",
"VAR_25 = [dict() for x in range(len(VAR_23))]\n",
... | [
"@app.route('/level-2/index')...\n",
"conn = psycopg2.connect('dbname=unlock user=ubuntu')\n",
"cur = conn.cursor()\n",
"cur.execute('SELECT * FROM nile_items;')\n",
"res = cur.fetchall()\n",
"cur.close()\n",
"conn.close()\n",
"items = [dict() for x in range(len(res))]\n",
"for i in range(len(res) -... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Assign'"
] |
[
"@property...\n",
"return self.extracted_text.data_document\n"
] | [
"@property...\n",
"return self.extracted_text.data_document\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = CLASS_1.get_user_by_id(VAR_3)\n",
"if UserRole(VAR_22.role) in [UserRole.VALIDATOR, UserRole.ADMIN, UserRole.\n",
"return True\n",
"return False\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"user = UserService.get_user_by_id(user_id)\n",
"if UserRole(user.role) in [UserRole.VALIDATOR, UserRole.ADMIN, UserRole.\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'LIBERTI', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='LIBERTY', VAR_10=[{'name': '----LIBERTY'}, {\n 'name': 'LIBERTI'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'LIBERTI', id='1')\n",
"verify_results(client, jwt, query='LIBERTY', expected=[{'name':\n '----LIBERTY'}, {'name': 'LIBERTI'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"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_14 = {'username': 'autotest', 'app': VAR_6}\n",
"VAR_4 = '/api/hooks/builds'.format(**l... | [
"@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",
"build = {'username': 'autotest', 'app': app_id}\n",
"url = '/api... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_7, **VAR_8):...\n",
"VAR_8['backend'] = 'ClassicalSimulator'\n",
"super().__init__(VAR_7, **kwargs)\n"
] | [
"def __init__(self, wires, **kwargs):...\n",
"kwargs['backend'] = 'ClassicalSimulator'\n",
"super().__init__(wires, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4():...\n",
"if request.params.get('_csrftoken', None) in VAR_6['modtokens']:\n",
"VAR_4 = VAR_6['modtokens']\n",
"return False\n",
"VAR_4.remove(request.params.get('_csrftoken'))\n",
"VAR_6['modtokens'] = VAR_4\n",
"VAR_6.save()\n",
"return True\n"
] | [
"def has_token():...\n",
"if request.params.get('_csrftoken', None) in session['modtokens']:\n",
"tokens = session['modtokens']\n",
"return False\n",
"tokens.remove(request.params.get('_csrftoken'))\n",
"session['modtokens'] = tokens\n",
"session.save()\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_14(VAR_7):...\n",
"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 decorator(method):...\n",
"def wrapper(self, *args, **kwargs):...\n",
"if not self.is_group_user(group):\n",
"return method(self, *args, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"VAR_12 = self.filename.split('.')[-1]\n",
"return f'document_{self.pk}.{VAR_12}'\n"
] | [
"def get_abstract_filename(self):...\n",
"ext = self.filename.split('.')[-1]\n",
"return f'document_{self.pk}.{ext}'\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@app.route('/getlocation')...\n",
"return render_template('getlocation.html')\n"
] | [
"@app.route('/getlocation')...\n",
"return render_template('getlocation.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self):...\n",
"self.db = Database('/Users/alexander/code/bots/CashboxBot/data.db')\n",
"self.csv_generator = CSVGenerator()\n"
] | [
"def __init__(self):...\n",
"self.db = Database('/Users/alexander/code/bots/CashboxBot/data.db')\n",
"self.csv_generator = CSVGenerator()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(VAR_5, VAR_4):...\n",
"VAR_8 = VAR_4.connect()\n",
"VAR_9 = VAR_8.cursor()\n",
"VAR_14 = 'string'.format(VAR_5)\n",
"VAR_9.execute(VAR_14)\n",
"VAR_15 = VAR_9.fetchall()\n",
"return VAR_15\n"
] | [
"def getAvailabilityForCalendar(calendarId, sqlInstance):...\n",
"conn = sqlInstance.connect()\n",
"cursor = conn.cursor()\n",
"queryString = (\n \"SELECT Users.userEmail, TimeSlots.one, TimeSlots.two, TimeSlots.three, TimeSlots.four, TimeSlots.five, TimeSlots.six, TimeSlots.seven, TimeSlots.eight, TimeSl... | [
0,
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"super(CLASS_0, self).setUp()\n",
"self.mock(logging, 'error', lambda *_: None)\n",
"self.mock(logging, 'exception', lambda *_: None)\n",
"self.mock(logging, 'info', lambda *_: None)\n",
"self.mock(logging, 'warning', lambda *_: None)\n",
"self.mock(time, 'sleep', lambda _: Non... | [
"def setUp(self):...\n",
"super(UrlHelperTest, self).setUp()\n",
"self.mock(logging, 'error', lambda *_: None)\n",
"self.mock(logging, 'exception', lambda *_: None)\n",
"self.mock(logging, 'info', lambda *_: None)\n",
"self.mock(logging, 'warning', lambda *_: None)\n",
"self.mock(time, 'sleep', lambda _... | [
0,
5,
5,
5,
5,
5,
5
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"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_13(VAR_16, VAR_17, VAR_18):...\n",
"VAR_53 = \"SELECT * FROM matches WHERE (player1='{}' or player2='{}')\".format(\n VAR_17, VAR_17, VAR_18)\n",
"if len(VAR_18) > 0:\n",
"VAR_53 = VAR_53 + \" and (url='{}'\".format(VAR_18[0])\n",
"VAR_54 = VAR_16.exec(VAR_53)\n",
"for VAR_7 in VAR_18[1:]:\n"... | [
"def player_in_url(db, player, urls):...\n",
"sql = \"SELECT * FROM matches WHERE (player1='{}' or player2='{}')\".format(\n player, player, urls)\n",
"if len(urls) > 0:\n",
"sql = sql + \" and (url='{}'\".format(urls[0])\n",
"res = db.exec(sql)\n",
"for url in urls[1:]:\n",
"if len(res) > 0:\n",
"... | [
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.