lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_13(self):...\n",
"VAR_4 = {'r': u'not ascii £ һ'}\n",
"VAR_1 = 'http://my.url.com'\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(VAR_1), mox.IgnoreArg(), timeout\n =mox.IgnoreArg()).AndReturn(StringIO.StringIO(VAR_2))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(ur... | [
"def testNonAcsiiData(self):...\n",
"data = {'r': u'not ascii £ һ'}\n",
"url = 'http://my.url.com'\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(url), mox.IgnoreArg(), timeout=\n mox.IgnoreArg()).AndReturn(StringIO.StringIO(response))\n",
"self._mox.ReplayAll()\n",
"self.asse... | [
0,
0,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_8, VAR_9):...\n",
"for line in VAR_8:\n",
"if line.startswith(VAR_9):\n",
"return\n",
"return line[len(VAR_9):]\n"
] | [
"def _get_prefixed_value(self, lines, prefix):...\n",
"for line in lines:\n",
"if line.startswith(prefix):\n",
"return\n",
"return line[len(prefix):]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_5(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = VAR_3.type\n",
"return VAR_3\n"
] | [
"def t_LPAR(self, tok):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = tok.type\n",
"return tok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_55 = self.fs_root\n",
"VAR_56 = 'system'\n",
"VAR_57 = ['']\n",
"while True:\n",
"VAR_67 = ''.join(i + '/' for i in VAR_57)\n",
"print('root@postgres %s$ ' % VAR_67, end='')\n",
"VAR_68 = input()\n",
"VAR_69 = VAR_68.split(' ')\n",
"VAR_... | [
"def shell(self):...\n",
"\"\"\"docstring\"\"\"\n",
"cwd = self.fs_root\n",
"cuser = 'system'\n",
"cwd_list = ['']\n",
"while True:\n",
"cwd_fl = ''.join(i + '/' for i in cwd_list)\n",
"print('root@postgres %s$ ' % cwd_fl, end='')\n",
"cmd_input = input()\n",
"cmd = cmd_input.split(' ')\n",
"op ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Condition",
"For",
"Assign'",
"Assign'",... |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"return reversed(VAR_0)\n"
] | [
"def get_posts():...\n",
"\"\"\"docstring\"\"\"\n",
"return reversed(POSTS)\n"
] | [
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_9(self, *VAR_15, **VAR_75):...\n",
""
] | [
"def newfn(self, *a, **env):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def __init__(self, VAR_1=None, VAR_2=None, VAR_3=None, VAR_4=None, VAR_5=...\n",
"self.verbosity = VAR_1\n",
"self.inventory = VAR_2\n",
"self.listhosts = VAR_3\n",
"self.subset = VAR_4\n",
"self.module_paths = VAR_5\n",
"self.extra_vars = VAR_6\n",
"self.forks = VAR_7\n",
"self.ask_vault_pass = VA... | [
"def __init__(self, verbosity=None, inventory=None, listhosts=None, subset=...\n",
"self.verbosity = verbosity\n",
"self.inventory = inventory\n",
"self.listhosts = listhosts\n",
"self.subset = subset\n",
"self.module_paths = module_paths\n",
"self.extra_vars = extra_vars\n",
"self.forks = forks\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"A... |
[
"def FUNC_4():...\n",
"logging.info('Scheduled history purge')\n",
"VAR_55 = CLASS_0()\n",
"VAR_55.auto_history_purge()\n",
"VAR_55.close()\n"
] | [
"def midnight_history_purge():...\n",
"logging.info('Scheduled history purge')\n",
"history_db = HistoryDB()\n",
"history_db.auto_history_purge()\n",
"history_db.close()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self, **VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"self._wait_until_mcpd_is_initialized()\n",
"return super(CLASS_0, self).mount_dvd(**kwargs)\n"
] | [
"def mount_dvd(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"self._wait_until_mcpd_is_initialized()\n",
"return super(BigIpOSUtil, self).mount_dvd(**kwargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Return'"
] |
[
"def FUNC_26(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_6 in self.client_list:\n",
"self.log_debug('Closing SSH connection to %s' % VAR_6.address)\n",
"VAR_6.close_ssh_session()\n"
] | [
"def close_all_connections(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for client in self.client_list:\n",
"self.log_debug('Closing SSH connection to %s' % client.address)\n",
"client.close_ssh_session()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_15(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",
"VAR_10 = self.driver.get_volu... | [
"def test_get_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",
"stats = self.dr... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_27(VAR_21):...\n",
"if VAR_21.type != 'response':\n",
"return False\n",
"VAR_33['msg'] = VAR_21\n",
"return VAR_21.request_seq == VAR_13\n"
] | [
"def match(msg):...\n",
"if msg.type != 'response':\n",
"return False\n",
"result['msg'] = msg\n",
"return msg.request_seq == seq\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
""
] | [
"def Start(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"import io\n",
"import os\n",
"import json\n",
"import zipfile\n",
"from django.template.defaultfilters import filesizeformat\n",
"from cuckoo.common.utils import json_default\n",
"from cuckoo.web.controllers.analysis.analysis import AnalysisController\n",
"from cuckoo.web.utils import get_directory_s... | [
"import io\n",
"import os\n",
"import json\n",
"import zipfile\n",
"from django.template.defaultfilters import filesizeformat\n",
"from cuckoo.common.utils import json_default\n",
"from cuckoo.web.controllers.analysis.analysis import AnalysisController\n",
"from cuckoo.web.utils import get_directory_s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Condition",
"Return'",
"A... |
[
"def FUNC_0():...\n",
"VAR_2 = 'http://codeforces.com/problemset/'\n",
"VAR_3 = requests.get(VAR_2)\n",
"VAR_4 = 0\n",
"VAR_5 = BeautifulSoup(VAR_3.text, 'lxml')\n",
"VAR_6 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\\\cf.db')\n",
"VAR_7 = VAR_6.cursor()\n",
"VAR_7.execute('creat... | [
"def create_cf_base():...\n",
"url = 'http://codeforces.com/problemset/'\n",
"r = requests.get(url)\n",
"max_page = 0\n",
"soup = BeautifulSoup(r.text, 'lxml')\n",
"base = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\\\cf.db')\n",
"conn = base.cursor()\n",
"conn.execute('create tabl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",... |
[
"def FUNC_7(self, VAR_11, VAR_10, VAR_12):...\n",
"self.current = Current(VAR_11=session, VAR_23=data)\n",
"self.current.headers = VAR_12\n",
"if VAR_10['view'] == 'ping':\n",
"return self._handle_ping_pong(VAR_10, VAR_11)\n",
"if not (self.current.is_auth or VAR_10['view'] in settings.ANONYMOUS_WORKFLOWS... | [
"def _handle_view(self, session, data, headers):...\n",
"self.current = Current(session=session, input=data)\n",
"self.current.headers = headers\n",
"if data['view'] == 'ping':\n",
"return self._handle_ping_pong(data, session)\n",
"if not (self.current.is_auth or data['view'] in settings.ANONYMOUS_WORKFLO... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self, VAR_2):...\n",
"VAR_6 = os.path.join(self.namespace, VAR_2)\n",
"self.etcd.write(VAR_6, None, dir=True, prevExist=False)\n",
"FUNC_0('Error storing key %s: [%r]' % (VAR_2, repr(err)))\n"
] | [
"def span(self, key):...\n",
"path = os.path.join(self.namespace, key)\n",
"self.etcd.write(path, None, dir=True, prevExist=False)\n",
"log_error('Error storing key %s: [%r]' % (key, repr(err)))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_1, VAR_2, VAR_3='', VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_4(VAR_1, VAR_2['oauth_token'], VAR_6=resp['oauth_token_secret'],\n VAR_4=extra_data, VAR_3=token_type)\n"
] | [
"def oauth1_token_setter(remote, resp, token_type='', extra_data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return token_setter(remote, resp['oauth_token'], secret=resp[\n 'oauth_token_secret'], extra_data=extra_data, token_type=token_type)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@property...\n",
"if os.path.exists(self.command):\n",
"return self.command\n",
"VAR_40 = os.environ['PATH'].split(':')\n",
"for di in VAR_40:\n",
"VAR_46 = os.path.join(di, self.command)\n",
"if os.path.exists(VAR_46):\n",
"return VAR_46\n"
] | [
"@property...\n",
"if os.path.exists(self.command):\n",
"return self.command\n",
"path = os.environ['PATH'].split(':')\n",
"for di in path:\n",
"cmd = os.path.join(di, self.command)\n",
"if os.path.exists(cmd):\n",
"return cmd\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Assign'",
"For",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_41(self, VAR_27, VAR_28):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_49 = []\n",
"for VAR_25 in VAR_28:\n",
"if VAR_25.permlevel not in VAR_27 and VAR_25.fieldtype not in display_fieldtypes:\n",
"if VAR_49:\n",
"VAR_49.append(VAR_25)\n",
"if self.is_new():\n",
"VAR_70 = VAR_54.new_doc(self.doc... | [
"def reset_values_if_no_permlevel_access(self, has_access_to,...\n",
"\"\"\"docstring\"\"\"\n",
"to_reset = []\n",
"for df in high_permlevel_fields:\n",
"if df.permlevel not in has_access_to and df.fieldtype not in display_fieldtypes:\n",
"if to_reset:\n",
"to_reset.append(df)\n",
"if self.is_new():\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Condition",
"For",
"Expr'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"@login_required...\n",
"if 'sort_by' in VAR_2.GET:\n",
"VAR_43 = Candidate.get_candidates_by_status(VAR_7, sort_param=request.GET[\n 'sort_by'])\n",
"VAR_43 = Candidate.get_candidates_by_status(VAR_7)\n",
"return render(VAR_2, 'etd_app/staff_view_candidates.html', {'candidates':\n VAR_43, 'status': V... | [
"@login_required...\n",
"if 'sort_by' in request.GET:\n",
"candidates = Candidate.get_candidates_by_status(status, sort_param=request.\n GET['sort_by'])\n",
"candidates = Candidate.get_candidates_by_status(status)\n",
"return render(request, 'etd_app/staff_view_candidates.html', {'candidates':\n candi... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"VAR_19 = list(filter(lambda VAR_28: VAR_28.protected, self.expanded_output))\n",
"if VAR_19:\n"
] | [
"def check_protected_output(self):...\n",
"protected = list(filter(lambda f: f.protected, self.expanded_output))\n",
"if protected:\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition"
] |
[
"def __init__(self, VAR_1, VAR_2, VAR_3):...\n",
"self.smart_list_item = VAR_1\n",
"self.column = VAR_2\n",
"self.object = VAR_3\n"
] | [
"def __init__(self, smart_list_item, column, object):...\n",
"self.smart_list_item = smart_list_item\n",
"self.column = column\n",
"self.object = object\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"import psycopg2\n",
"VAR_0 = 'user_objects'\n",
"VAR_1 = 'rank_privileges'\n",
"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",
"VA... | [
"import psycopg2\n",
"user_table = 'user_objects'\n",
"rank_permit_table = 'rank_privileges'\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",... | [
0,
4,
4,
0,
4,
0,
4,
0,
0,
0,
0
] | [
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return list(listfiles(VAR_12, VAR_13=restriction, VAR_14=omit_value))\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return list(listfiles(pattern, restriction=restriction, omit_value=omit_value))\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_9(self, VAR_2):...\n",
"VAR_22 = None\n",
"if 'next' in VAR_2.GET:\n",
"if re.search('^/[\\\\W/-]*', VAR_2.GET['next']):\n",
"return VAR_22\n",
"VAR_22 = VAR_2.GET['next']\n"
] | [
"def _passphrase_next_url(self, request):...\n",
"next_url = None\n",
"if 'next' in request.GET:\n",
"if re.search('^/[\\\\W/-]*', request.GET['next']):\n",
"return next_url\n",
"next_url = request.GET['next']\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = '/api/apps'\n",
"VAR_3 = self.client.post(VAR_2)\n",
"self.assertEqual(VAR_3.status_code, 201)\n",
"VAR_4 = VAR_3.data['id']\n",
"self.assertIn('id', VAR_3.data)\n",
"self.assertIn('url', VAR_3.data)\n",
"self.assertEqual(VAR_3.data['url'... | [
"def test_app(self):...\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",
"self.assertIn('id', response.data)\n",
"self.assertIn('url', response.data)\n",
"self.assertEqual(re... | [
0,
0,
0,
5,
0,
0,
0,
0,
0,
5,
0,
0,
0,
5,
0,
0,
5,
0,
5,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_18(self, VAR_2, VAR_3, VAR_7={}):...\n",
"if 'project_id' in VAR_7 and VAR_7['project_id']:\n",
"return VAR_7['project_id']\n",
"return False\n"
] | [
"def _default_project(self, cr, uid, context={}):...\n",
"if 'project_id' in context and context['project_id']:\n",
"return context['project_id']\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_67=(), *VAR_15, **VAR_16):...\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n",
"self.options = VAR_67\n"
] | [
"def __init__(self, param, options=(), *a, **kw):...\n",
"Validator.__init__(self, param, *a, **kw)\n",
"self.options = options\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def __init__(self, *VAR_19):...\n",
"super(CLASS_1, self).__init__()\n",
"if len(VAR_19) < 2:\n",
"self._possible_environments = VAR_19\n"
] | [
"def __init__(self, *possible_environments):...\n",
"super(_DistributionEnvironment, self).__init__()\n",
"if len(possible_environments) < 2:\n",
"self._possible_environments = possible_environments\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Assign'"
] |
[
"def FUNC_5(self, VAR_9):...\n",
"if self.closed:\n",
"def FUNC_26():...\n",
"return self.closed\n"
] | [
"def send(self, req):...\n",
"if self.closed:\n",
"def stop():...\n",
"return self.closed\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_11, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = {'facet': 'true', 'facet.field': 'source_id', 'facet.mincount': 3,\n 'q': '!source_id:error', 'rows': 0, 'wt': 'json'}\n",
"VAR_21 = FUNC_2(VAR_11, VAR_10)\n",
"VAR_22 = VAR_21['facet_counts']['facet_fields']['source_id']\n",
"VAR... | [
"def get_all_current_sources(k10plus, ai):...\n",
"\"\"\"docstring\"\"\"\n",
"params = {'facet': 'true', 'facet.field': 'source_id', 'facet.mincount': 3,\n 'q': '!source_id:error', 'rows': 0, 'wt': 'json'}\n",
"result = get_solr_result(k10plus, params)\n",
"k10plus_sources = result['facet_counts']['facet... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = sql.connect('./resources/users.db')\n",
"VAR_27 = False\n",
"VAR_38 = VAR_26.cursor()\n",
"print(''.join(traceback.format_exception(etype=type(e), value=e, tb=e.\n __traceback__)))\n",
"VAR_26.close()\n",
"return VAR_27\n",
"VAR_38.execut... | [
"def get_user_profiles():...\n",
"\"\"\"docstring\"\"\"\n",
"user_con = sql.connect('./resources/users.db')\n",
"response = False\n",
"user_cur = user_con.cursor()\n",
"print(''.join(traceback.format_exception(etype=type(e), value=e, tb=e.\n __traceback__)))\n",
"user_con.close()\n",
"return respon... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_16(self, VAR_66):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_99 = snakemake.io.load_configfile(VAR_66)\n",
"update_config(VAR_85, VAR_99)\n",
"update_config(VAR_85, self.overwrite_config)\n"
] | [
"def configfile(self, jsonpath):...\n",
"\"\"\"docstring\"\"\"\n",
"c = snakemake.io.load_configfile(jsonpath)\n",
"update_config(config, c)\n",
"update_config(config, self.overwrite_config)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'ANDERSON BEHAVIOR CONSULTING INC.', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='BEHAVIOUR INTERVENTION', VAR_10=[{'name':\n '----BEHAVIOUR INTERVENTION'}, {'name': '----BEHAVIOUR'}, {'name':\n 'ANDERSON BEHAVIOR CONSULTING INC.'}])\n"
... | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'ANDERSON BEHAVIOR CONSULTING INC.', id='1')\n",
"verify_results(client, jwt, query='BEHAVIOUR INTERVENTION', expected=[{\n 'name': '----BEHAVIOUR INTERVENTION'}, {'name': '----BEHAVIOUR'}, {\n 'name': 'ANDERSON BEHAVIO... | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_29(self, VAR_15):...\n",
""
] | [
"def delete(self, item):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(self):...\n",
"self.handled_resp = None\n",
"self.handled_remote = None\n",
"self.handled_args = None\n",
"self.handled_kwargs = None\n",
"from invenio.modules.oauthclient.models import RemoteToken, RemoteAccount\n",
"RemoteToken.query.delete()\n",
"RemoteAccount.query.delete()\n",
"db.s... | [
"def tearDown(self):...\n",
"self.handled_resp = None\n",
"self.handled_remote = None\n",
"self.handled_args = None\n",
"self.handled_kwargs = None\n",
"from invenio.modules.oauthclient.models import RemoteToken, RemoteAccount\n",
"RemoteToken.query.delete()\n",
"RemoteAccount.query.delete()\n",
"db... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@login_required...\n",
"\"\"\"docstring\"\"\"\n",
"return render_to_response('student_account/account_settings.html', FUNC_12(\n VAR_3))\n"
] | [
"@login_required...\n",
"\"\"\"docstring\"\"\"\n",
"return render_to_response('student_account/account_settings.html',\n account_settings_context(request))\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_7(VAR_20, VAR_21, VAR_2, VAR_22=None, VAR_23=None, VAR_24='text',...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = {}\n",
"VAR_48 = FUNC_25(VAR_20)\n",
"VAR_49 = FUNC_25(VAR_21)\n",
"for VAR_77 in VAR_48:\n",
"VAR_27[VAR_77[0].concept] = VAR_77[0].type\n",
"for VAR_77 in VAR_48:\n",
"VAR_27[VAR... | [
"def get_keywords_output(single_keywords, composite_keywords, taxonomy_name,...\n",
"\"\"\"docstring\"\"\"\n",
"categories = {}\n",
"single_keywords_p = _sort_kw_matches(single_keywords)\n",
"composite_keywords_p = _sort_kw_matches(composite_keywords)\n",
"for w in single_keywords_p:\n",
"categories[w[0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"@VAR_7.route('/availability', methods=['GET', 'POST'])...\n",
"VAR_10 = FUNC_0()\n",
"if not VAR_10:\n",
"return 'Unauthorized'\n",
"VAR_8, VAR_3 = FUNC_1()\n",
"if request.method == 'POST':\n",
"VAR_17 = request.form['calendarId']\n",
"VAR_17 = request.args.get('calendarId')\n",
"VAR_16 = calendar... | [
"@app.route('/availability', methods=['GET', 'POST'])...\n",
"isAuthorized = isUserAuthorized()\n",
"if not isAuthorized:\n",
"return 'Unauthorized'\n",
"username, password = getUsernameAndPassword()\n",
"if request.method == 'POST':\n",
"calendarId = request.form['calendarId']\n",
"calendarId = reque... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_24(VAR_25, VAR_23, *VAR_24):...\n",
"if VAR_23 == 'on_after_task':\n",
"VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n",
"self.assertEqual(False, VAR_50)\n",
"self.assertEqual(True, VAR_51)\n",
"self.assertEqual({'pool': 'default'}, VAR_5)\n",
"self.assertEqual({}, VAR_52)\n"
] | [
"def call_hook(_botobj, name, *args):...\n",
"if name == 'on_after_task':\n",
"failure, internal_failure, dimensions, summary = args\n",
"self.assertEqual(False, failure)\n",
"self.assertEqual(True, internal_failure)\n",
"self.assertEqual({'pool': 'default'}, dimensions)\n",
"self.assertEqual({}, summar... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"if not self.campaign_data['use_simics']:\n",
"self.debugger.close()\n"
] | [
"def close(self):...\n",
"if not self.campaign_data['use_simics']:\n",
"self.debugger.close()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def FUNC_19():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_45 = None\n",
"VAR_46 = '/sys/fs/cgroup/memory/memory.limit_in_bytes'\n",
"if VAR_40.path.exists(VAR_46):\n",
"VAR_45 = int(VAR_8.read())\n",
"VAR_47 = None\n",
"import psutil\n",
"if VAR_47 is not None:\n",
"VAR_47 = psutil.virtual_memory().t... | [
"def get_system_memory():...\n",
"\"\"\"docstring\"\"\"\n",
"docker_limit = None\n",
"memory_limit_filename = '/sys/fs/cgroup/memory/memory.limit_in_bytes'\n",
"if os.path.exists(memory_limit_filename):\n",
"docker_limit = int(f.read())\n",
"psutil_memory_in_bytes = None\n",
"import psutil\n",
"if p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Import'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Return'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"VAR_3 = VAR_3.lower()\n",
"VAR_8 = sqlite3.connect('data/ed.db').cursor()\n",
"VAR_9 = VAR_8.execute(f\"select * from populated where lower(name) = '{VAR_3}'\")\n",
"VAR_10 = VAR_9.fetchone()\n",
"if not VAR_10:\n",
"VAR_9 = VAR_8.execute(f\"select * from systems where ... | [
"def system_search(self, search):...\n",
"search = search.lower()\n",
"conn = sqlite3.connect('data/ed.db').cursor()\n",
"table = conn.execute(f\"select * from populated where lower(name) = '{search}'\")\n",
"results = table.fetchone()\n",
"if not results:\n",
"table = conn.execute(f\"select * from syst... | [
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if self._parsed_status_test_usernames:\n",
"return self._parsed_status_test_usernames\n",
"VAR_6 = self.config.get(self.section, 'status_test_usernames')\n",
"VAR_5 = [x.strip() for x in VAR_6.split(',')]\n",
"self._parsed_status_test_usernames = VAR_5\n",
... | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"if self._parsed_status_test_usernames:\n",
"return self._parsed_status_test_usernames\n",
"value = self.config.get(self.section, 'status_test_usernames')\n",
"res = [x.strip() for x in value.split(',')]\n",
"self._parsed_status_test_usernames = res\n",
"re... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"if self.get('__islocal') or not self.name:\n",
"self.db_insert()\n",
"VAR_6 = self.get_valid_dict(VAR_13=True)\n",
"return\n",
"VAR_34 = VAR_6['name']\n",
"VAR_33 = list(VAR_6)\n",
"VAR_54.db.sql(\"\"\"update `tab{doctype}`\n\t\t\t\tset {values} where name=%s\"\"\".\n fo... | [
"def db_update(self):...\n",
"if self.get('__islocal') or not self.name:\n",
"self.db_insert()\n",
"d = self.get_valid_dict(convert_dates_to_str=True)\n",
"return\n",
"name = d['name']\n",
"columns = list(d)\n",
"frappe.db.sql(\"\"\"update `tab{doctype}`\n\t\t\t\tset {values} where name=%s\"\"\".\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"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}/config'.format(**locals())\n",
"VAR_7 = {'values': json.dumps({... | [
"@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}/config'.format(**locals())\n",
"body =... | [
0,
0,
0,
5,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
5,
5,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"... |
[
"def FUNC_21(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self._json_body is None:\n",
"if self.CONTENT_TYPE_BASE and self.request.content_type != self.CONTENT_TYPE_BASE:\n",
"return self._json_body.copy()\n",
"VAR_54 = \"Expecting JSON body with content type '%s'\" % self.CONTENT_TYPE_BASE\n",
"self._j... | [
"def parse_body(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self._json_body is None:\n",
"if self.CONTENT_TYPE_BASE and self.request.content_type != self.CONTENT_TYPE_BASE:\n",
"return self._json_body.copy()\n",
"msg = \"Expecting JSON body with content type '%s'\" % self.CONTENT_TYPE_BASE\n",
"self._j... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = DataDocument.objects.get(pk=354784)\n",
"self.assertFalse(VAR_1.extracted, 'This document is matched but not extracted')\n",
"VAR_6 = {'hhe_report_number': ['47']}\n",
"VAR_2 = self.client.post('/extractedtext/edit/354784/', VAR_6=data, follow=... | [
"def test_add_extracted(self):...\n",
"\"\"\"docstring\"\"\"\n",
"doc = DataDocument.objects.get(pk=354784)\n",
"self.assertFalse(doc.extracted, 'This document is matched but not extracted')\n",
"data = {'hhe_report_number': ['47']}\n",
"response = self.client.post('/extractedtext/edit/354784/', data=data... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_6):...\n",
"if not VAR_6 == constants.Settings.ownerDiscordId:\n",
"VAR_16 = sqlite3.connect(VAR_5)\n",
"return 'MASTER'\n",
"VAR_17 = VAR_16.cursor()\n",
"VAR_17.execute('SELECT rank FROM users WHERE discordId = ' + str(VAR_6))\n",
"VAR_9 = VAR_17.fetchall()[0][0]\n",
"VAR_9 = 'USER'\... | [
"def return_user_rank(discordId):...\n",
"if not discordId == constants.Settings.ownerDiscordId:\n",
"conn = sqlite3.connect(databasePath)\n",
"return 'MASTER'\n",
"cursor = conn.cursor()\n",
"cursor.execute('SELECT rank FROM users WHERE discordId = ' + str(discordId))\n",
"rank = cursor.fetchall()[0][0... | [
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_22(self, VAR_14):...\n",
"if self.is_relation_many_to_one(VAR_14):\n",
"VAR_34 = self.get_relation_fk(VAR_14)\n",
"return self.list_columns[VAR_14].nullable\n",
"return False\n",
"return VAR_34.nullable\n"
] | [
"def is_nullable(self, col_name):...\n",
"if self.is_relation_many_to_one(col_name):\n",
"col = self.get_relation_fk(col_name)\n",
"return self.list_columns[col_name].nullable\n",
"return False\n",
"return col.nullable\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_6(self, VAR_20: bool):...\n",
"\"\"\"docstring\"\"\"\n",
"self.is_email_verified = VAR_20\n",
"db.session.commit()\n"
] | [
"def set_email_verified_status(self, is_verified: bool):...\n",
"\"\"\"docstring\"\"\"\n",
"self.is_email_verified = is_verified\n",
"db.session.commit()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_13(self, *VAR_16, **VAR_10):...\n",
"if not self.is_group_user(VAR_8):\n",
"return VAR_7(self, *VAR_16, **kwargs)\n"
] | [
"def wrapper(self, *args, **kwargs):...\n",
"if not self.is_group_user(group):\n",
"return method(self, *args, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"return self.extracted_text.data_document.get_absolute_url()\n"
] | [
"def get_datadocument_url(self):...\n",
"return self.extracted_text.data_document.get_absolute_url()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"VAR_6 = request.get_json(force=True)\n",
"VAR_7 = Table.filter_by(VAR_6.get('email'))\n",
"if not VAR_7:\n",
"VAR_8 = {'status': 'fail', 'message': 'User already exists. Please Log in.'}\n",
"VAR_7 = Table.save(data=post_data)\n",
"print(e)\n",
"return make_response(jsonify(... | [
"def post(self):...\n",
"post_data = request.get_json(force=True)\n",
"user = Table.filter_by(post_data.get('email'))\n",
"if not user:\n",
"response_object = {'status': 'fail', 'message':\n 'User already exists. Please Log in.'}\n",
"user = Table.save(data=post_data)\n",
"print(e)\n",
"return make... | [
0,
4,
4,
0,
4,
4,
4,
0,
0,
4,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_7(self, VAR_15, VAR_16=(), VAR_17=False):...\n",
"\"\"\"docstring\"\"\"\n",
"for tries in xrange(5, 0, -1):\n",
"if VAR_16 and isinstance(VAR_16, tuple):\n",
"VAR_88 = str(sys.exc_value)\n",
"return False\n",
"self.c.execute(VAR_15, VAR_16)\n",
"self.c.execute(VAR_15)\n",
"if tries >= 0 an... | [
"def execute(self, command, args=(), save=False):...\n",
"\"\"\"docstring\"\"\"\n",
"for tries in xrange(5, 0, -1):\n",
"if args and isinstance(args, tuple):\n",
"error = str(sys.exc_value)\n",
"return False\n",
"self.c.execute(command, args)\n",
"self.c.execute(command)\n",
"if tries >= 0 and 'is l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"For",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
... |
[
"@app.route('/api/filter_wheels', methods=['GET'])...\n",
"return [x.to_map() for x in controller.indi_server.filter_wheels()]\n"
] | [
"@app.route('/api/filter_wheels', methods=['GET'])...\n",
"return [x.to_map() for x in controller.indi_server.filter_wheels()]\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_1():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = 'testing inband sql injection on parameter '\n",
"VAR_3 += \"'%s'\" % kb.injParameter\n",
"logger.info(VAR_3)\n",
"VAR_4 = ''\n",
"VAR_0 = agent.prefixQuery(' UNION ALL SELECT NULL')\n",
"for VAR_1 in (queries[kb.dbms].comment, ''):\n",
"VAR_... | [
"def unionTest():...\n",
"\"\"\"docstring\"\"\"\n",
"logMsg = 'testing inband sql injection on parameter '\n",
"logMsg += \"'%s'\" % kb.injParameter\n",
"logger.info(logMsg)\n",
"value = ''\n",
"query = agent.prefixQuery(' UNION ALL SELECT NULL')\n",
"for comment in (queries[kb.dbms].comment, ''):\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"AugAssign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"AugAssign'",
"AugAssign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_49(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 2}, 'CONFIDENCE': {'MEDIUM': 2}}\n",
"self.check_example('paramiko_injection.py', VAR_2)\n"
] | [
"def test_paramiko_injection(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 2}, 'CONFIDENCE': {'MEDIUM': 2}}\n",
"self.check_example('paramiko_injection.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"return FUNC_1(CLASS_0.PostDataToHandlerAsync(VAR_9, VAR_7, VAR_10))\n"
] | [
"@staticmethod...\n",
"return JsonFromFuture(BaseRequest.PostDataToHandlerAsync(data, handler,\n timeout))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"import geopandas as gpd\n",
"VAR_48 = gpd.read_file(self.subdomains_fn)\n",
"self.names_dict = dict(zip(VAR_48[self.id_field], VAR_48[self.name_field]))\n"
] | [
"def _get_subdomains_dict(self):...\n",
"import geopandas as gpd\n",
"gdf = gpd.read_file(self.subdomains_fn)\n",
"self.names_dict = dict(zip(gdf[self.id_field], gdf[self.name_field]))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(self):...\n",
"VAR_1 = self.current_user\n",
"VAR_12 = {'user': None, 'email': None}\n",
"if VAR_1:\n",
"VAR_12 = {'user': VAR_1.name, 'email': VAR_1.email}\n",
"self.finish(VAR_12)\n"
] | [
"def get(self):...\n",
"user = self.current_user\n",
"ret = {'user': None, 'email': None}\n",
"if user:\n",
"ret = {'user': user.name, 'email': user.email}\n",
"self.finish(ret)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = discord.Embed(VAR_2='GodMode9 dump/build Guide', VAR_3=discord.\n Color(6750207))\n",
"VAR_7.set_author(name='ih8ih8sn0w', url='https://pastebin.com/sx8HYULr')\n",
"VAR_7.set_thumbnail(url='http://i.imgur.com/QEUfyrp.png')\n",
"VAR_7.url =... | [
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"embed = discord.Embed(title='GodMode9 dump/build Guide', color=discord.\n Color(6750207))\n",
"embed.set_author(name='ih8ih8sn0w', url='https://pastebin.com/sx8HYULr')\n",
"embed.set_thumbnail(url='http://i.imgur.com/QEUfyrp.png')\n",
"embed.url =... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"import random\n",
"from eventlet import greenthread\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\n",
"from cinder.openstack.common import log as logging\n",
"from cinder import utils\n",
"from cinder.vol... | [
"\"\"\"\nDefault Driver for san-stored volumes.\n\nThe unique thing about a SAN is that we don't expect that we can run the volume\ncontroller on the SAN hardware. We expect to access it over SSH or some API.\n\"\"\"\n",
"import random\n",
"from eventlet import greenthread\n",
"from oslo.config import cfg\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
... |
[
"from .app import Static\n",
"from ..app.templating import TemplateRoute\n",
"from ..gallery.pager import Pager\n",
"\"\"\"\n Main page\n \"\"\"\n",
"VAR_0 = '/'\n",
"VAR_1 = 'main.mako'\n",
"@property...\n",
"return int(self.request.query['page'])\n",
"return 1\n",
"def FUNC_1(self):...\n",... | [
"from .app import Static\n",
"from ..app.templating import TemplateRoute\n",
"from ..gallery.pager import Pager\n",
"\"\"\"\n Main page\n \"\"\"\n",
"path = '/'\n",
"template_name = 'main.mako'\n",
"@property...\n",
"return int(self.request.query['page'])\n",
"return 1\n",
"def get(self):...... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4():...\n",
"VAR_22 = self.request.body\n",
"VAR_23 = json.loads(VAR_22.decode('utf-8', 'ignore'))\n",
"VAR_24 = VAR_23['action']\n",
"VAR_25 = VAR_23['source']\n",
"if type(VAR_25) == list:\n",
"for VAR_31 in range(0, len(VAR_25)):\n",
"VAR_25 = FUNC_1(VAR_25)\n",
"VAR_25[VAR_31] = FUNC_1... | [
"def get_final_html_async():...\n",
"operation_content_raw = self.request.body\n",
"operation_content = json.loads(operation_content_raw.decode('utf-8', 'ignore'))\n",
"action = operation_content['action']\n",
"sources = operation_content['source']\n",
"if type(sources) == list:\n",
"for i in range(0, l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"For",
"Condition",
"Expr'",
"For",
"Conditio... |
[
"def FUNC_2(self):...\n",
"return self.schema.get_int_columns()\n"
] | [
"def get_int_columns(self):...\n",
"return self.schema.get_int_columns()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __exit__(self, VAR_27, VAR_28, VAR_29):...\n",
"if self.stack:\n",
"self.stack.close()\n",
"self.stack = None\n"
] | [
"def __exit__(self, type, value, traceback):...\n",
"if self.stack:\n",
"self.stack.close()\n",
"self.stack = None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_3(VAR_0, VAR_2, VAR_4, VAR_5, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_2(VAR_0, VAR_0, VAR_2, VAR_4, VAR_5, VAR_3)\n"
] | [
"def log_unexpected_keys(expected_keys, actual_keys, request, source, name):...\n",
"\"\"\"docstring\"\"\"\n",
"return log_unexpected_subset_keys(expected_keys, expected_keys, actual_keys,\n request, source, name)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@method_decorator(xframe_options_exempt)...\n",
"return super().dispatch(VAR_4, *VAR_5, **kwargs)\n"
] | [
"@method_decorator(xframe_options_exempt)...\n",
"return super().dispatch(request, *args, **kwargs)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'LEAK', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='LEEK', VAR_10=[{'name': 'LEAK'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'LEAK', id='1')\n",
"verify_results(client, jwt, query='LEEK', expected=[{'name': 'LEAK'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"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'"
] |
[
"@require_http_methods(['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = get_next_url_for_login_page(VAR_3)\n",
"if VAR_3.user.is_authenticated():\n",
"return redirect(VAR_7)\n",
"VAR_13 = FUNC_6(VAR_3)\n",
"VAR_14 = None\n",
"if '?' in VAR_7:\n",
"if is_request_in_themed_site() and not configurat... | [
"@require_http_methods(['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"redirect_to = get_next_url_for_login_page(request)\n",
"if request.user.is_authenticated():\n",
"return redirect(redirect_to)\n",
"form_descriptions = _get_form_descriptions(request)\n",
"third_party_auth_hint = None\n",
"if '?' in red... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",... |
[
"def FUNC_2(VAR_1=False, VAR_2=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = 'git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD'\n",
"VAR_5 = FUNC_1(VAR_4)\n",
"VAR_6 = 0\n",
"for filename in VAR_5:\n",
"if filename.endswith('.py'):\n",
"return VAR_6 if VAR_1 else 0\n",
"VAR_7 = '... | [
"def git_hook(strict=False, modify=False):...\n",
"\"\"\"docstring\"\"\"\n",
"diff_cmd = 'git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD'\n",
"files_modified = get_lines(diff_cmd)\n",
"errors = 0\n",
"for filename in files_modified:\n",
"if filename.endswith('.py'):\n",
"return errors... | [
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
2,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"Expr'"
] |
[
"@property...\n",
"return (file for VAR_13 in self.rules for file in chain(VAR_13.input,\n VAR_13.output) if not callable(file) and not file.contains_wildcard())\n"
] | [
"@property...\n",
"return (file for rule in self.rules for file in chain(rule.input, rule.\n output) if not callable(file) and not file.contains_wildcard())\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __eq__(self, VAR_17):...\n",
"return self.name == VAR_17.name\n"
] | [
"def __eq__(self, other):...\n",
"return self.name == other.name\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import cgi\n",
"import mysql.connector\n",
"from html import beghtml, endhtml\n",
"VAR_0 = cgi.FieldStorage()\n",
"VAR_1 = VAR_0.getvalue('insert_table')\n",
"VAR_2 = VAR_0.getvalue('values')\n",
"if VAR_2:\n",
"VAR_2 = VAR_2.split(', ')\n",
"VAR_3 = ''\n",
"if VAR_2:\n",
"for value in VAR_2:\n... | [
"import cgi\n",
"import mysql.connector\n",
"from html import beghtml, endhtml\n",
"form = cgi.FieldStorage()\n",
"insert_table = form.getvalue('insert_table')\n",
"values = form.getvalue('values')\n",
"if values:\n",
"values = values.split(', ')\n",
"svalues = ''\n",
"if values:\n",
"for value ... | [
0,
0,
0,
0,
0,
0,
4,
0,
4,
0,
0,
0,
4,
4,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
0,
4,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"AugAssign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Conditi... |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if not request.json:\n",
"abort(400)\n",
"VAR_7 = request.json.get('Note', '')\n",
"VAR_8 = request.json.get('Attributter', {})\n",
"VAR_9 = request.json.get('Tilstande', {})\n",
"VAR_10 = request.json.get('Relationer', {})\n",
"VAR_5 = db.create_or_i... | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if not request.json:\n",
"abort(400)\n",
"note = request.json.get('Note', '')\n",
"attributes = request.json.get('Attributter', {})\n",
"states = request.json.get('Tilstande', {})\n",
"relations = request.json.get('Relationer', {})\n",
"uuid = db.crea... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_13, VAR_14=1):...\n",
"utils.check_ssh_injection(VAR_13)\n",
"VAR_11 = ' '.join(VAR_13)\n",
"if not self.sshpool:\n",
"VAR_39 = self.configuration.san_password\n",
"VAR_43 = VAR_14\n",
"VAR_0.error(_('Error running SSH command: %s') % VAR_11)\n",
"VAR_40 = self.configuration.san_... | [
"def _run_ssh(self, cmd_list, attempts=1):...\n",
"utils.check_ssh_injection(cmd_list)\n",
"command = ' '.join(cmd_list)\n",
"if not self.sshpool:\n",
"password = self.configuration.san_password\n",
"total_attempts = attempts\n",
"LOG.error(_('Error running SSH command: %s') % command)\n",
"privatekey... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_5(self, VAR_3):...\n",
"if self.data:\n",
"if VAR_3 != self.data[len(self.data) - 1]:\n",
"self.data.append(VAR_3)\n",
"self.data.append(VAR_3)\n",
"if len(self.data) > self.size:\n",
"self.data.pop(0)\n"
] | [
"def push(self, item):...\n",
"if self.data:\n",
"if item != self.data[len(self.data) - 1]:\n",
"self.data.append(item)\n",
"self.data.append(item)\n",
"if len(self.data) > self.size:\n",
"self.data.pop(0)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_16(self, **VAR_23):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25, VAR_23 = self._prepare_env(VAR_23)\n",
"return subprocess.check_output(self.cmd, VAR_25=env, **kwargs)\n"
] | [
"def check_output(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"env, kwargs = self._prepare_env(kwargs)\n",
"return subprocess.check_output(self.cmd, env=env, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"VAR_15 = self.runner.stats\n",
"return len([VAR_33 for VAR_33 in VAR_15.failures() if VAR_33.failed_stage ==\n VAR_3])\n"
] | [
"def _num_failures_stage(self, stage):...\n",
"stats = self.runner.stats\n",
"return len([t for t in stats.failures() if t.failed_stage == stage])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@app.route('/achievements/<achievement_id>/setStepsAtLeast', methods=['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = int(request.form.get('player_id'))\n",
"VAR_3 = int(request.form.get('steps', 1))\n",
"return flask.jsonify(FUNC_9(VAR_1, VAR_2, VAR_3))\n"
] | [
"@app.route('/achievements/<achievement_id>/setStepsAtLeast', methods=['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"player_id = int(request.form.get('player_id'))\n",
"steps = int(request.form.get('steps', 1))\n",
"return flask.jsonify(set_steps_at_least(achievement_id, player_id, steps))\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"from typing import Iterator, TypeVar\n",
"from .construct import construct_select_statement\n",
"from .interface import IRow\n",
"from .spy import Spy\n",
"VAR_0 = TypeVar('T')\n",
"def __init__(self, VAR_1: str, VAR_2):...\n",
"self.from_object = VAR_1\n",
"self.client = VAR_2\n",
"def FUNC_0(self... | [
"from typing import Iterator, TypeVar\n",
"from .construct import construct_select_statement\n",
"from .interface import IRow\n",
"from .spy import Spy\n",
"T = TypeVar('T')\n",
"def __init__(self, from_object: str, client):...\n",
"self.from_object = from_object\n",
"self.client = client\n",
"def r... | [
4,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1=None, **VAR_2):...\n",
"if not VAR_1:\n",
"VAR_1 = {}\n",
"VAR_1.setdefault('version', api_settings.DEFAULT_VERSION)\n",
"return reverse('api:' + VAR_0, VAR_1=kwargs, **extra)\n"
] | [
"def api_reverse(name, kwargs=None, **extra):...\n",
"if not kwargs:\n",
"kwargs = {}\n",
"kwargs.setdefault('version', api_settings.DEFAULT_VERSION)\n",
"return reverse('api:' + name, kwargs=kwargs, **extra)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"@staticmethod...\n",
"return ['i\\\\d', \"i''d\", '/u??/bin/id', 'a=i;b=d;$a$b']\n"
] | [
"@staticmethod...\n",
"return ['i\\\\d', \"i''d\", '/u??/bin/id', 'a=i;b=d;$a$b']\n"
] | [
2,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_8(self, VAR_9, VAR_7=False, VAR_10=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = self.output if VAR_7 else self.input\n",
"if isinstance(VAR_9, str):\n",
"if isinstance(VAR_9, _IOFile):\n",
"if callable(VAR_9):\n",
"self.dependencies[VAR_9] = VAR_9.rule\n",
"VAR_44 = IOFile(VAR_9, VAR_1... | [
"def _set_inoutput_item(self, item, output=False, name=None):...\n",
"\"\"\"docstring\"\"\"\n",
"inoutput = self.output if output else self.input\n",
"if isinstance(item, str):\n",
"if isinstance(item, _IOFile):\n",
"if callable(item):\n",
"self.dependencies[item] = item.rule\n",
"_item = IOFile(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,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"For",
"Condition",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"E... |
[
"def FUNC_28(VAR_21):...\n",
"if not VAR_25(VAR_21):\n",
"return VAR_21, False\n",
"VAR_19.set()\n",
"return VAR_21, True\n"
] | [
"def handler(msg):...\n",
"if not match(msg):\n",
"return msg, False\n",
"event.set()\n",
"return msg, True\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_10(self, *VAR_18, **VAR_4):...\n",
"super(CLASS_0, self).save(*VAR_18, **kwargs)\n"
] | [
"def save(self, *args, **kwargs):...\n",
"super(DataGroup, self).save(*args, **kwargs)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_35(self, VAR_14):...\n",
"VAR_20 = self.get_related_model(VAR_14)\n",
"return self.session.query(VAR_20).all()\n"
] | [
"def query_model_relation(self, col_name):...\n",
"model = self.get_related_model(col_name)\n",
"return self.session.query(model).all()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self, VAR_1, VAR_2=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.get_userentry(VAR_1):\n",
"logger.info('User {0} already exists, skip useradd', VAR_1)\n",
"VAR_15 = (\n '/usr/bin/tmsh create auth user %s partition-access add { all-partitions { role admin } } shell bash'\n % VAR_1)\n... | [
"def useradd(self, username, expiration=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.get_userentry(username):\n",
"logger.info('User {0} already exists, skip useradd', username)\n",
"cmd = (\n '/usr/bin/tmsh create auth user %s partition-access add { all-partitions { role admin } } shell bash'\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"@VAR_0.route('/level-2')...\n",
"if int(current_user.progress) >= 2:\n",
"return render_template('ui.html', VAR_6='2', VAR_7='index', level_progress=\n current_user.level2_progress, max_level_progress=4)\n",
"return redirect(VAR_4)\n"
] | [
"@app.route('/level-2')...\n",
"if int(current_user.progress) >= 2:\n",
"return render_template('ui.html', level='2', page='index', level_progress=\n current_user.level2_progress, max_level_progress=4)\n",
"return redirect(url_prefix)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_9 = \"Can't execute your command. Check logs\"\n",
"VAR_10 = 'There is some statistics for you: \\n'\n",
"VAR_11 = datetime.today().replace(hour=0, minute=0, second=0, microsecond=0\n ).strftime('%Y-%m-%d %H:%M:%S')\n",
"if VAR_0 == 'last active users':\n",
"if VAR_0 == ... | [
"def get_admin_stat(command):...\n",
"error_answer = \"Can't execute your command. Check logs\"\n",
"answer = 'There is some statistics for you: \\n'\n",
"today = datetime.today().replace(hour=0, minute=0, second=0, microsecond=0\n ).strftime('%Y-%m-%d %H:%M:%S')\n",
"if command == 'last active users':\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Condition",
"For",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"AugAssign'",
"Assign'",
"Expr'",
"Condition",
"AugAssig... |
[
"def FUNC_8(self):...\n",
"user_should_have_perm(self.tester, self.permission)\n"
] | [
"def setUp(self):...\n",
"user_should_have_perm(self.tester, self.permission)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_20(self, VAR_25, VAR_23, VAR_24, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"if type(VAR_25) == str:\n",
"VAR_25 = self.locate(VAR_25)\n",
"VAR_30 = VAR_3.new_unique_file(VAR_12)\n",
"if not VAR_25:\n",
"VAR_53 = self.fsNode(False, VAR_23, VAR_24, VAR_39=n_uuid, VAR_29=self)\n",
"return Fals... | [
"def mkfile(self, path_parent, file_name, owner, content):...\n",
"\"\"\"docstring\"\"\"\n",
"if type(path_parent) == str:\n",
"path_parent = self.locate(path_parent)\n",
"n_uuid = FileStorage.new_unique_file(content)\n",
"if not path_parent:\n",
"n_fl = self.fsNode(False, file_name, owner, f_uuid=n_uui... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_5, VAR_6=None):...\n",
"VAR_7 = VAR_5.userprofile if VAR_5 and VAR_5.is_authenticated() else None\n",
"return {'courses': self._generate_courses(VAR_7), 'groups': self.\n _generate_groups(VAR_7)}\n"
] | [
"def _generate_data(self, user, data=None):...\n",
"profile = user.userprofile if user and user.is_authenticated() else None\n",
"return {'courses': self._generate_courses(profile), 'groups': self.\n _generate_groups(profile)}\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_9, VAR_10):...\n",
"if self._IsServerAlive():\n",
"return FUNC_9(VAR_9, VAR_10)\n"
] | [
"def SendCommandRequest(self, arguments, completer):...\n",
"if self._IsServerAlive():\n",
"return SendCommandRequest(arguments, completer)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_6(self, VAR_22):...\n",
"if VAR_22:\n",
"VAR_107 = int(VAR_22, 36)\n",
"if self.redirect:\n",
"return Meetup._byID(VAR_107, True)\n",
"abort(404, 'page not found')\n",
"return None\n"
] | [
"def run(self, meetup_id36):...\n",
"if meetup_id36:\n",
"meetup_id = int(meetup_id36, 36)\n",
"if self.redirect:\n",
"return Meetup._byID(meetup_id, True)\n",
"abort(404, 'page not found')\n",
"return None\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2):...\n",
""
] | [
"def rename_attribute(table_name, column, new_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_29(self, VAR_15):...\n",
""
] | [
"def delete(self, item):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.