lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_5(self):...\n", "" ]
[ "def Start(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_12(self, VAR_22):...\n", "logging.warning(\"\"\"Authentication error.\n%s\"\"\", VAR_22)\n", "self.abort_with_error(401, text=str(error))\n" ]
[ "def authentication_error(self, error):...\n", "logging.warning(\"\"\"Authentication error.\n%s\"\"\", error)\n", "self.abort_with_error(401, text=str(error))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_0(VAR_0):...\n", "return os.stat(VAR_0, follow_symlinks=os.stat not in os.\n supports_follow_symlinks)\n" ]
[ "def lstat(f):...\n", "return os.stat(f, follow_symlinks=os.stat not in os.supports_follow_symlinks)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(VAR_9):...\n", "return VAR_5.search(VAR_9) is not None\n" ]
[ "def contains_wildcard(path):...\n", "return _wildcard_regex.search(path) is not None\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_3(self, VAR_1):...\n", "if self.is_sys_user(VAR_1):\n", "logger.error('{0} is a system user. Will not delete it.', VAR_1)\n", "shellutil.run('> /var/run/utx.active')\n", "shellutil.run('rmuser -y ' + VAR_1)\n", "self.conf_sudoer(VAR_1, remove=True)\n" ]
[ "def del_account(self, username):...\n", "if self.is_sys_user(username):\n", "logger.error('{0} is a system user. Will not delete it.', username)\n", "shellutil.run('> /var/run/utx.active')\n", "shellutil.run('rmuser -y ' + username)\n", "self.conf_sudoer(username, remove=True)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_2.route('/player')...\n", "if VAR_0 == None:\n", "FUNC_16()\n", "VAR_5 = request.args.get('tag', default='christmasmike').capitalize()\n", "VAR_8 = \"SELECT count(*) FROM matches WHERE winner='{}'\".format(VAR_5)\n", "VAR_9 = VAR_0.exec(VAR_8)[0][0]\n", "VAR_8 = (\n \"SELECT count(*) FROM match...
[ "@endpoints.route('/player')...\n", "if db == None:\n", "init()\n", "tag = request.args.get('tag', default='christmasmike').capitalize()\n", "sql = \"SELECT count(*) FROM matches WHERE winner='{}'\".format(tag)\n", "wins = db.exec(sql)[0][0]\n", "sql = (\n \"SELECT count(*) FROM matches WHERE (player...
[ 0, 0, 0, 0, 4, 4, 4, 4, 0, 4, 4, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Retur...
[ "def FUNC_4(self, VAR_8):...\n", "VAR_16 = \"SELECT Votes FROM report WHERE Report_ID = '\" + VAR_8 + \"'\"\n", "self.cursor.execute(VAR_16)\n", "VAR_15 = self.cursor.fetchone()\n", "VAR_17 = ' '.join(map(str, VAR_15))\n", "VAR_18 = int(VAR_17)\n", "VAR_18 = VAR_18 + 1\n", "VAR_19 = \"UPDATE `testdb`....
[ "def increment_vote(self, reportID):...\n", "query1 = \"SELECT Votes FROM report WHERE Report_ID = '\" + reportID + \"'\"\n", "self.cursor.execute(query1)\n", "fetch = self.cursor.fetchone()\n", "curVote = ' '.join(map(str, fetch))\n", "intVote = int(curVote)\n", "intVote = intVote + 1\n", "query2 = \...
[ 0, 4, 4, 0, 0, 0, 0, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "if self.mode != ray.WORKER_MODE:\n", "if VAR_2.startswith(b'FunctionsToRun'):\n", "if VAR_2.startswith(b'RemoteFunction'):\n", "self.fetch_and_execute_function_to_run(VAR_2)\n", "return\n", "self.worker.function_actor_manager.fetch_and_regis...
[ "def _process_key(self, key):...\n", "\"\"\"docstring\"\"\"\n", "if self.mode != ray.WORKER_MODE:\n", "if key.startswith(b'FunctionsToRun'):\n", "if key.startswith(b'RemoteFunction'):\n", "self.fetch_and_execute_function_to_run(key)\n", "return\n", "self.worker.function_actor_manager.fetch_and_registe...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Condition", "Expr'", "Return'", "Expr'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_3(self):...\n", "if self.telnet:\n", "self.telnet.close()\n", "self.dut.close()\n", "db.log_event('Information', 'Debugger', 'Closed telnet')\n", "if self.db.campaign['aux']:\n", "self.aux.close()\n" ]
[ "def close(self):...\n", "if self.telnet:\n", "self.telnet.close()\n", "self.dut.close()\n", "db.log_event('Information', 'Debugger', 'Closed telnet')\n", "if self.db.campaign['aux']:\n", "self.aux.close()\n" ]
[ 0, 0, 0, 0, 2, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "from peewee import Database, SqliteDatabase\n", "def FUNC_0():...\n", "return False\n" ]
[ "from peewee import Database, SqliteDatabase\n", "def can_import_apsw():...\n", "return False\n" ]
[ 0, 0, 6 ]
[ "ImportFrom'", "FunctionDef'", "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_0(self):...\n", "VAR_6 = request.get_json(force=True)\n", "VAR_7 = Table.filter_by(email=post_data.get('email'))\n", "print(e)\n", "if len(VAR_7) >= 1 and VAR_6.get('password'):\n", "VAR_8 = {'status': 'fail', 'message': 'Try again'}\n", "if str(VAR_7[0][3]) == str(VAR_6.get('password')):\n", ...
[ "def post(self):...\n", "post_data = request.get_json(force=True)\n", "user = Table.filter_by(email=post_data.get('email'))\n", "print(e)\n", "if len(user) >= 1 and post_data.get('password'):\n", "response_object = {'status': 'fail', 'message': 'Try again'}\n", "if str(user[0][3]) == str(post_data.get('...
[ 0, 0, 4, 0, 4, 4, 4, 4, 0, 4, 4, 0, 0, 0, 0, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Return'", "Condition", "Expr'", "Return'", "Assign'", "Return'", "Return'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "return sum(map(len, VAR_3.values()))\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "return sum(map(len, wildcards.values()))\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_16(self):...\n", "if self.doctype not in VAR_54.local.valid_columns:\n", "if self.doctype in ('DocField', 'DocPerm') and self.parent in ('DocType',\n", "return VAR_54.local.valid_columns[self.doctype]\n", "from frappe.model.meta import get_table_columns\n", "VAR_65 = self.meta.get_valid_columns(...
[ "def get_valid_columns(self):...\n", "if self.doctype not in frappe.local.valid_columns:\n", "if self.doctype in ('DocField', 'DocPerm') and self.parent in ('DocType',\n", "return frappe.local.valid_columns[self.doctype]\n", "from frappe.model.meta import get_table_columns\n", "valid = self.meta.get_valid...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "ImportFrom'", "Assign'", "Assign'", "Assign'" ]
[ "def __init__(self, VAR_11, VAR_4, VAR_5=None):...\n", "\"\"\"docstring\"\"\"\n", "self.profiler = VAR_11\n", "self.event_type = VAR_4\n", "self.extra_data = VAR_5 if VAR_5 is not None else {}\n" ]
[ "def __init__(self, profiler, event_type, extra_data=None):...\n", "\"\"\"docstring\"\"\"\n", "self.profiler = profiler\n", "self.event_type = event_type\n", "self.extra_data = extra_data if extra_data is not None else {}\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(VAR_9):...\n", "if VAR_0:\n", "VAR_29 = VAR_9.get_secure_cookie('user')\n", "return 'authentication_disabled'\n", "if VAR_29 in VAR_1:\n", "return VAR_29\n", "print('Bad/expired cookie received')\n", "return None\n" ]
[ "def login_get_current_user(handler):...\n", "if enable_authentication:\n", "cookie = handler.get_secure_cookie('user')\n", "return 'authentication_disabled'\n", "if cookie in authenticated_users:\n", "return cookie\n", "print('Bad/expired cookie received')\n", "return None\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_9(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 400, 'error message',\n None, None))\n", "self._mox.ReplayAll()\n", "self.assertIsNone(url_helper.UrlOpen('url', max_tries=10))\n", "self._mox.VerifyAll...
[ "def testUrlOpenHTTPErrorNoRetry(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 400, 'error message',\n None, None))\n", "self._mox.ReplayAll()\n", "self.assertIsNone(url_helper.UrlOpen('url', max_tries=10))\n", ...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_15(self, VAR_65):...\n", "if self.overwrite_workdir is None:\n", "if not os.path.exists(VAR_65):\n", "os.makedirs(VAR_65)\n", "self._workdir = VAR_65\n", "os.chdir(VAR_65)\n" ]
[ "def workdir(self, workdir):...\n", "if self.overwrite_workdir is None:\n", "if not os.path.exists(workdir):\n", "os.makedirs(workdir)\n", "self._workdir = workdir\n", "os.chdir(workdir)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_40(VAR_63=None):...\n", "VAR_81 = VAR_20.getWrittenData()\n", "if VAR_81:\n", "return FUNC_39(VAR_81)\n" ]
[ "def get_request_written_data(_=None):...\n", "written_data = request.getWrittenData()\n", "if written_data:\n", "return get_str(written_data)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_5(VAR_1, VAR_5=''):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = VAR_17(VAR_1.name)\n", "if VAR_18 not in VAR_16 and current_user.is_authenticated():\n", "VAR_26 = RemoteToken.get(current_user.get_id(), VAR_1.consumer_key, VAR_3=token\n )\n", "return VAR_16.get(VAR_18, None)\n", "if VAR_26 i...
[ "def token_getter(remote, token=''):...\n", "\"\"\"docstring\"\"\"\n", "session_key = token_session_key(remote.name)\n", "if session_key not in session and current_user.is_authenticated():\n", "remote_token = RemoteToken.get(current_user.get_id(), remote.consumer_key,\n token_type=token)\n", "return se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Return'", "Assign'" ]
[ "def FUNC_20(self):...\n", "VAR_16 = self.mox.CreateMock(paramiko.SSHClient)\n", "VAR_12 = self.mox.CreateMock(paramiko.Channel)\n", "VAR_17 = self.mox.CreateMock(paramiko.Transport)\n", "self.mox.StubOutWithMock(self.driver, '_get_output')\n", "self.mox.StubOutWithMock(VAR_16, 'get_transport')\n", "sel...
[ "def test_ssh_execute_error(self):...\n", "ssh = self.mox.CreateMock(paramiko.SSHClient)\n", "chan = self.mox.CreateMock(paramiko.Channel)\n", "transport = self.mox.CreateMock(paramiko.Transport)\n", "self.mox.StubOutWithMock(self.driver, '_get_output')\n", "self.mox.StubOutWithMock(ssh, 'get_transport')\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_32(self, **VAR_50):...\n", "VAR_69, VAR_73 = self.get('/tags', VAR_50)\n", "return VAR_69\n" ]
[ "def get_tags(self, **kwargs):...\n", "res, req = self.get('/tags', kwargs)\n", "return res\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@api.public...\n", "VAR_6.assertEqual(model.Anonymous, api.get_current_identity())\n", "self.response.write('OK')\n" ]
[ "@api.public...\n", "test.assertEqual(model.Anonymous, api.get_current_identity())\n", "self.response.write('OK')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'" ]
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import re\n", "import os\n", "import sys\n", "import signal\n", "import json\n", "import urllib\n", "from collections import OrderedDi...
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import re\n", "import os\n", "import sys\n", "import signal\n", "import json\n", "import urllib\n", "from collections import OrderedDi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 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 ]
[ "Assign'", "Assign'", "Assign'", "Assign'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", ...
[ "@property...\n", "return dict(self)\n" ]
[ "@property...\n", "return dict(self)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n", "self.state = ray.experimental.state.GlobalState()\n", "self.state._initialize_global_state(VAR_1, VAR_2, VAR_4=redis_password)\n", "self.redis = VAR_42.StrictRedis(host=redis_address, port=redis_port, db=0,\n password=redis_password)\n", "self...
[ "def __init__(self, redis_address, redis_port, autoscaling_config,...\n", "self.state = ray.experimental.state.GlobalState()\n", "self.state._initialize_global_state(redis_address, redis_port,\n redis_password=redis_password)\n", "self.redis = redis.StrictRedis(host=redis_address, port=redis_port, db=0,\n ...
[ 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_6(self, VAR_23):...\n", "if VAR_23:\n", "VAR_94 = _force_ascii(VAR_23)\n", "if VAR_94 == VAR_23:\n", "abort(404, 'page not found')\n", "return Tag._by_name(VAR_94)\n" ]
[ "def run(self, name):...\n", "if name:\n", "cleaned = _force_ascii(name)\n", "if cleaned == name:\n", "abort(404, 'page not found')\n", "return Tag._by_name(cleaned)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_2(self):...\n", "VAR_0.info('Closing the MySQL connection pool (id {})'.format(id(self)))\n", "while not self._pool.empty():\n", "VAR_11 = self._pool.get()\n", "VAR_0.info('Closed all connections in the MySQL connection pool (id {})'.\n format(id(self)))\n", "if not isinstance(VAR_11, MySQLdb...
[ "def clear_pool(self):...\n", "logger.info('Closing the MySQL connection pool (id {})'.format(id(self)))\n", "while not self._pool.empty():\n", "db = self._pool.get()\n", "logger.info('Closed all connections in the MySQL connection pool (id {})'.\n format(id(self)))\n", "if not isinstance(db, MySQLdb.c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Assign'", "Expr'", "Condition", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_6(self, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = self.bindings['TEST_APP_COMPONENT_NAME']\n", "if not VAR_5:\n", "VAR_7 += '-pub'\n", "VAR_12 = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider': 'aws', 'credentials': self.\n bindings['...
[ "def delete_load_balancer(self, use_vpc):...\n", "\"\"\"docstring\"\"\"\n", "load_balancer_name = self.bindings['TEST_APP_COMPONENT_NAME']\n", "if not use_vpc:\n", "load_balancer_name += '-pub'\n", "payload = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "@VAR_0.route('/logout', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = VAR_3.get('user_eppn')\n", "if VAR_13 is None:\n", "current_app.logger.info('Session cookie has expired, no logout action needed')\n", "VAR_12 = current_app.central_userdb.get_user_by_eppn(VAR_13)\n", "VAR_27 = curren...
[ "@authn_views.route('/logout', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "eppn = session.get('user_eppn')\n", "if eppn is None:\n", "current_app.logger.info('Session cookie has expired, no logout action needed')\n", "user = current_app.central_userdb.get_user_by_eppn(eppn)\n", "location = curr...
[ 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, 6, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Return'", "Condition", "Assign'", "Expr'", "E...
[ "def FUNC_8(VAR_8, VAR_4, VAR_2):...\n", "VAR_10 = sqlite3.connect(VAR_1)\n", "VAR_11 = VAR_10.cursor()\n", "VAR_11.execute('string', [VAR_8])\n", "VAR_17 = VAR_11.fetchone()\n", "VAR_10.close()\n", "return VAR_17[0] == VAR_4 and VAR_17[1] == VAR_2\n" ]
[ "def confirm_owner_of_file(file_id, session_id, username):...\n", "connection = sqlite3.connect(DATABASE_PATH)\n", "cursor = connection.cursor()\n", "cursor.execute(\n \"\"\"SELECT session_id, username FROM UserData WHERE user_id = \n (SELECT user_id FROM Notes WHERE uuid_fil...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_5(self):...\n", "VAR_23 = shellutil.run('pw usermod root -h -')\n", "if VAR_23:\n" ]
[ "def del_root_password(self):...\n", "err = shellutil.run('pw usermod root -h -')\n", "if err:\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition" ]
[ "def FUNC_20(self, VAR_17, VAR_16):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def create_export(self, context, volume):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_24(self):...\n", "self.log.info('Initializing interprocess backward socket %s', self.pr_ba)\n", "self.pr_back_sock = self.p.ctx.socket(zmq.ROUTER)\n", "self.pr_back_sock.bind(self.pr_ba)\n" ]
[ "def init_pr_back_sock(self):...\n", "self.log.info('Initializing interprocess backward socket %s', self.pr_ba)\n", "self.pr_back_sock = self.p.ctx.socket(zmq.ROUTER)\n", "self.pr_back_sock.bind(self.pr_ba)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'" ]
[ "from django.conf.urls import url, include\n", "from .projects import ProjectViewSet\n", "from .tasks import TaskViewSet, TaskTiles, TaskTilesJson, TaskAssets\n", "from .processingnodes import ProcessingNodeViewSet\n", "from rest_framework_nested import routers\n", "VAR_0 = routers.DefaultRouter()\n", "...
[ "from django.conf.urls import url, include\n", "from .projects import ProjectViewSet\n", "from .tasks import TaskViewSet, TaskTiles, TaskTilesJson, TaskAssets\n", "from .processingnodes import ProcessingNodeViewSet\n", "from rest_framework_nested import routers\n", "router = routers.DefaultRouter()\n", ...
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_10(VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_26 = VAR_10.unrestrictedTraverse\n", "VAR_27 = '/'.join(VAR_10.getPhysicalPath())\n", "if isinstance(VAR_27, six.text_type):\n", "VAR_27 = VAR_27.encode('utf-8')\n", "VAR_28 = len(VAR_27) + 1\n", "VAR_29 = [VAR_27]\n", "for idx, VAR_21 in ...
[ "def findObjects(origin):...\n", "\"\"\"docstring\"\"\"\n", "traverse = origin.unrestrictedTraverse\n", "base = '/'.join(origin.getPhysicalPath())\n", "if isinstance(base, six.text_type):\n", "base = base.encode('utf-8')\n", "cut = len(base) + 1\n", "paths = [base]\n", "for idx, path in enumerate(pa...
[ 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Expr'", "Condition", "For", "Condition", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_10, VAR_11=None, VAR_12=None):...\n", "BaseResource.__init__(self, VAR_10)\n", "self._static_folder = FUNC_1()\n", "self._startup_folder = FUNC_0()\n", "self._portal = VAR_11\n", "self._disclaimer_banner = VAR_12\n", "self.putChild('startup-assets', File(self._startup_folder))\n"...
[ "def __init__(self, services_factory, portal=None, disclaimer_banner=None):...\n", "BaseResource.__init__(self, services_factory)\n", "self._static_folder = _get_static_folder()\n", "self._startup_folder = _get_startup_folder()\n", "self._portal = portal\n", "self._disclaimer_banner = disclaimer_banner\n"...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(self):...\n", "VAR_14 = utils.GetUnusedLocalhostPort()\n", "self._temp_options_filename = options_file.name\n", "json.dump(dict(self._user_options), options_file)\n", "options_file.flush()\n", "VAR_21 = [utils.PathToPythonInterpreter(), FUNC_0(), '--port={0}'.format(\n VAR_14), '--options_f...
[ "def _SetupServer(self):...\n", "server_port = utils.GetUnusedLocalhostPort()\n", "self._temp_options_filename = options_file.name\n", "json.dump(dict(self._user_options), options_file)\n", "options_file.flush()\n", "args = [utils.PathToPythonInterpreter(), _PathToServerScript(),\n '--port={0}'.format(...
[ 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_2(VAR_3):...\n", "print(CLASS_0.OKGREEN + '✔', VAR_3, CLASS_0.END)\n" ]
[ "def print_right(str):...\n", "print(c.OKGREEN + '✔', str, c.END)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "from cmd import Cmd\n", "import wrapper\n", "from objects import Project\n", "from color import prnt, prnt_str, VIOLET, PURPLE, ORANGE, TURQ, BLUE\n", "from cli_helpers import arglen, inject, state, emptystate, restrict, command\n", "from cli_helpers import CmdError\n", "import cli_helpers as cli\n", ...
[ "from cmd import Cmd\n", "import wrapper\n", "from objects import Project\n", "from color import prnt, prnt_str, VIOLET, PURPLE, ORANGE, TURQ, BLUE\n", "from cli_helpers import arglen, inject, state, emptystate, restrict, command\n", "from cli_helpers import CmdError\n", "import cli_helpers as cli\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "FunctionDef'", "Expr'", "Assign'", "Assign'", "Condition", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = CLASS_1.query.filter(CLASS_1.to_user_id == VAR_21).all()\n", "if len(VAR_25) == 0:\n", "VAR_26 = MessagesDTO()\n", "for VAR_6 in VAR_25:\n", "VAR_26.user_messages.append(VAR_6.as_dto())\n", "return VAR_26\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "user_messages = Message.query.filter(Message.to_user_id == user_id).all()\n", "if len(user_messages) == 0:\n", "messages_dto = MessagesDTO()\n", "for message in user_messages:\n", "messages_dto.user_messages.append(message.as_dto())\n", "return message...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_9(self, VAR_5, VAR_7):...\n", "VAR_14 = 'delete from friends where userid=%d and friendid=%d;' % (VAR_5, VAR_7\n )\n", "VAR_11 = sql.deleteDB(self.conn, VAR_14)\n", "return VAR_11\n" ]
[ "def cancelFollow(self, userid, friendid):...\n", "sqlText = 'delete from friends where userid=%d and friendid=%d;' % (userid,\n friendid)\n", "result = sql.deleteDB(self.conn, sqlText)\n", "return result\n" ]
[ 0, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_29(self):...\n", "return self.spawn_nworkers(0, WipeThread, self.c.tcount, (self.pc, self.\n spawnqueue))\n" ]
[ "def spawn_wipethreads(self):...\n", "return self.spawn_nworkers(0, WipeThread, self.c.tcount, (self.pc, self.\n spawnqueue))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(self, VAR_4, VAR_5, VAR_6=True):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = []\n", "for VAR_43, v in VAR_5.items():\n", "VAR_14.append(' %s=%s' % (VAR_43, v))\n", "VAR_15 = VAR_4 + ''.join(VAR_14)\n", "return self._run_ssh(VAR_15, VAR_6)\n" ]
[ "def _cliq_run(self, verb, cliq_args, check_exit_code=True):...\n", "\"\"\"docstring\"\"\"\n", "cliq_arg_strings = []\n", "for k, v in cliq_args.items():\n", "cliq_arg_strings.append(' %s=%s' % (k, v))\n", "cmd = verb + ''.join(cliq_arg_strings)\n", "return self._run_ssh(cmd, check_exit_code)\n" ]
[ 0, 0, 2, 0, 2, 2, 2 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_3(self, VAR_3, VAR_5=None):...\n", "VAR_17 = quotas.tenant_quota_usages(VAR_3)\n", "VAR_2 = len(self.table.data)\n", "if VAR_17.get('key_pairs') and VAR_17['key_pairs']['quota'] <= VAR_2:\n", "if 'disabled' not in self.classes:\n", "VAR_9 = [c for c in self.classes if c != 'disabled']\n", "sel...
[ "def allowed(self, request, datum=None):...\n", "usages = quotas.tenant_quota_usages(request)\n", "count = len(self.table.data)\n", "if usages.get('key_pairs') and usages['key_pairs']['quota'] <= count:\n", "if 'disabled' not in self.classes:\n", "classes = [c for c in self.classes if c != 'disabled']\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_26(VAR_22, **VAR_20):...\n", "" ]
[ "def tpl2(template, **ka):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_3(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = self.events\n", "self.events = []\n", "if self.worker.mode == ray.WORKER_MODE:\n", "VAR_15 = 'worker'\n", "VAR_15 = 'driver'\n", "self.worker.raylet_client.push_profile_events(VAR_15, ray.UniqueID(self.\n worker.worker_id), self.worker....
[ "def flush_profile_data(self):...\n", "\"\"\"docstring\"\"\"\n", "events = self.events\n", "self.events = []\n", "if self.worker.mode == ray.WORKER_MODE:\n", "component_type = 'worker'\n", "component_type = 'driver'\n", "self.worker.raylet_client.push_profile_events(component_type, ray.UniqueID(\n ...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_0):...\n", "self.shape = VAR_0\n" ]
[ "def __init__(self, shape):...\n", "self.shape = shape\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_11(VAR_3=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = FUNC_12(VAR_3).message\n", "for file in os.listdir(VAR_2):\n", "if file.endswith('.txt'):\n", "return\n", "if FUNC_3(file)['id'] > 0:\n", "if FUNC_3(file)['verified'] == 0:\n", "FUNC_6(file)\n", "if FUNC_0(file) > FUNC_3(file)['s...
[ "def main(arguments=None):...\n", "\"\"\"docstring\"\"\"\n", "path = parse_arguments(arguments).message\n", "for file in os.listdir(path):\n", "if file.endswith('.txt'):\n", "return\n", "if db_get_file_details(file)['id'] > 0:\n", "if db_get_file_details(file)['verified'] == 0:\n", "db_insert_new_fi...
[ 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Return'", "Condition", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_3(VAR_1, VAR_2, VAR_4=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_16 = f'SELECT COUNT(*) as count FROM {VAR_2};'\n", "if VAR_4:\n", "print(VAR_16)\n", "VAR_17 = VAR_1.cursor()\n", "VAR_19 = VAR_17.execute(VAR_16).fetchone()[0]\n", "VAR_17.close()\n", "return VAR_19\n" ]
[ "def db_count(conn, table, debug=False):...\n", "\"\"\"docstring\"\"\"\n", "sql = f'SELECT COUNT(*) as count FROM {table};'\n", "if debug:\n", "print(sql)\n", "cursor = conn.cursor()\n", "num_rows = cursor.execute(sql).fetchone()[0]\n", "cursor.close()\n", "return num_rows\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "@defer.inlineCallbacks...\n", "if self._mode.is_single_user:\n", "VAR_61 = CLASS_0(VAR_19, self._tmp_dir.name)\n", "yield VAR_61.start()\n", "self.accounts[VAR_19] = VAR_61\n" ]
[ "@defer.inlineCallbacks...\n", "if self._mode.is_single_user:\n", "account = AppTestAccount(account_name, self._tmp_dir.name)\n", "yield account.start()\n", "self.accounts[account_name] = account\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Expr'", "Assign'" ]
[ "async def FUNC_1(self, VAR_1: int, VAR_2: str, VAR_3):...\n", "VAR_5 = f\"\"\"INSERT INTO user_info (member_id, {VAR_2}) \n VALUES ({VAR_1}, {VAR_3})\n ON CONFLICT (member_id)\n DO UPDATE SET {VAR_2} = {VAR_3};\"\"\"\n", "await self.db_conn.execute(V...
[ "async def insert_user_info(self, member_id: int, column: str, col_value):...\n", "execute = f\"\"\"INSERT INTO user_info (member_id, {column}) \n VALUES ({member_id}, {col_value})\n ON CONFLICT (member_id)\n DO UPDATE SET {column} = {col_value};\"\"\"\...
[ 0, 4, 4 ]
[ "AsyncFunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_60(self):...\n", "VAR_2 = {'SEVERITY': {'HIGH': 1}, 'CONFIDENCE': {'HIGH': 1}}\n", "self.check_example('input.py', VAR_2)\n" ]
[ "def test_blacklist_input(self):...\n", "expect = {'SEVERITY': {'HIGH': 1}, 'CONFIDENCE': {'HIGH': 1}}\n", "self.check_example('input.py', expect)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_11(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = {'CO': ExtractedChemical, 'FU': ExtractedFunctionalUse, 'HP':\n ExtractedHabitsAndPractices, 'CP': ExtractedListPresence, 'HH':\n ExtractedHHRec}\n", "for code, model in VAR_10.items():\n", "if DataDocument.objects.filter(document_type__g...
[ "def test_num_forms(self):...\n", "\"\"\"docstring\"\"\"\n", "group_models = {'CO': ExtractedChemical, 'FU': ExtractedFunctionalUse, 'HP':\n ExtractedHabitsAndPractices, 'CP': ExtractedListPresence, 'HH':\n ExtractedHHRec}\n", "for code, model in group_models.items():\n", "if DataDocument.objects.filt...
[ 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "from osv import osv\n", "from tools.translate import _\n", "import time\n", "VAR_0 = 'pos.open.statement'\n", "VAR_1 = 'Open Statements'\n", "def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = []\n", "VAR_7 = self.pool.get('ir.model.data')\n", "VAR_8 = self.p...
[ "from osv import osv\n", "from tools.translate import _\n", "import time\n", "_name = 'pos.open.statement'\n", "_description = 'Open Statements'\n", "def open_statement(self, cr, uid, ids, context):...\n", "\"\"\"docstring\"\"\"\n", "list_statement = []\n", "mod_obj = self.pool.get('ir.model.data')\...
[ 0, 0, 0, 0, 0, 0, 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, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Import'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'...
[ "import pymysql\n", "import dbconfig\n", "def FUNC_0(self, VAR_0='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n" ]
[ "import pymysql\n", "import dbconfig\n", "def connect(self, database='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n" ]
[ 0, 0, 0, 0 ]
[ "Import'", "Import'", "FunctionDef'", "Return'" ]
[ "@staticmethod...\n", "for VAR_16 in VAR_13:\n", "if VAR_16 in VAR_12 and isinstance(VAR_13[VAR_16], dict) and isinstance(VAR_12\n", "CLASS_0.recursiveUpdate(VAR_12[VAR_16], VAR_13[VAR_16])\n", "if VAR_16 in VAR_12 and isinstance(VAR_13[VAR_16], list) and isinstance(VAR_12\n", "VAR_12[VAR_16] += VAR_13[VA...
[ "@staticmethod...\n", "for k in content:\n", "if k in target and isinstance(content[k], dict) and isinstance(target[k], dict\n", "Config.recursiveUpdate(target[k], content[k])\n", "if k in target and isinstance(content[k], list) and isinstance(target[k], list\n", "target[k] += content[k]\n", "target[k] ...
[ 2, 2, 2, 2, 2, 2, 2 ]
[ "Condition", "For", "Condition", "Expr'", "Condition", "AugAssign'", "Assign'" ]
[ "def FUNC_30():...\n", "if VAR_3 == 'text':\n", "print('Input file: %s' % VAR_75)\n", "VAR_52 = FUNC_2(VAR_15, VAR_2, VAR_3=output_mode, VAR_4=output_limit, VAR_5\n =spires, VAR_6=match_mode, VAR_7=no_cache, VAR_8=with_author_keywords,\n VAR_9=rebuild_cache, VAR_10=only_core_tags, VAR_11=extract_acronym...
[ "def process_lines():...\n", "if output_mode == 'text':\n", "print('Input file: %s' % source)\n", "output = get_keywords_from_text(text_lines, taxonomy_name, output_mode=\n output_mode, output_limit=output_limit, spires=spires, match_mode=\n match_mode, no_cache=no_cache, with_author_keywords=\n with...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Condition", "Return'", "Condition", "For", "Expr'" ]
[ "def FUNC_4(self, VAR_8):...\n", "return json.dumps(self.value_from_object(VAR_8))\n" ]
[ "def value_to_string(self, obj):...\n", "return json.dumps(self.value_from_object(obj))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_5(VAR_8):...\n", "return set(VAR_29.group('name') for VAR_29 in VAR_5.finditer(VAR_8))\n" ]
[ "def get_wildcard_names(pattern):...\n", "return set(match.group('name') for match in _wildcard_regex.finditer(pattern))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0():...\n", "if VAR_8 is None:\n", "VAR_8 = Browser()\n", "return VAR_8\n", "VAR_53 = AWSLoginRequest(VAR_8, VAR_5['username'], VAR_5['password'],\n base_url=AWS_BASE_URL)\n", "VAR_8.login(VAR_53)\n" ]
[ "def get_aws_browser():...\n", "if aws_browser is None:\n", "aws_browser = Browser()\n", "return aws_browser\n", "lr = AWSLoginRequest(aws_browser, admin_info['username'], admin_info[\n 'password'], base_url=AWS_BASE_URL)\n", "aws_browser.login(lr)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Assign'", "Expr'" ]
[ "def FUNC_8(VAR_2, *VAR_3, **VAR_4):...\n", "self = VAR_11(**initkwargs)\n", "if hasattr(self, 'get') and not hasattr(self, 'head'):\n", "self.head = self.get\n", "self.request = VAR_2\n", "self.args = VAR_3\n", "self.kwargs = VAR_4\n", "self.setup(VAR_2, *VAR_3, **kwargs)\n", "return self.dispatch(...
[ "def view(request, *args, **kwargs):...\n", "self = cls(**initkwargs)\n", "if hasattr(self, 'get') and not hasattr(self, 'head'):\n", "self.head = self.get\n", "self.request = request\n", "self.args = args\n", "self.kwargs = kwargs\n", "self.setup(request, *args, **kwargs)\n", "return self.dispatch(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = {}\n", "VAR_8 = []\n", "VAR_26 = Contest.get_from_id(VAR_0, session)\n", "for participation in VAR_26.participations:\n", "VAR_31 = participation.user\n", "for VAR_30 in VAR_26.tasks:\n", "VAR_12[VAR_31.username] = {'password': VAR_31.p...
[ "def harvest_contest_data(contest_id):...\n", "\"\"\"docstring\"\"\"\n", "users = {}\n", "tasks = []\n", "contest = Contest.get_from_id(contest_id, session)\n", "for participation in contest.participations:\n", "user = participation.user\n", "for task in contest.tasks:\n", "users[user.username] = {'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Assign'", "For", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_7(self, *VAR_16, **VAR_17):...\n", "" ]
[ "def recv(self, *args, **kwargs):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_14(VAR_10, VAR_8):...\n", "if not VAR_8 in VAR_10 or VAR_10[VAR_8] is None:\n", "return '-'\n", "return VAR_10[VAR_8]\n" ]
[ "def get_html_val(src, name):...\n", "if not name in src or src[name] is None:\n", "return '-'\n", "return src[name]\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_0(self):...\n", "self.builder = Gtk.Builder()\n", "self.builder.add_from_resource('/run/terminal/KeepassGtk/unlock_database.ui')\n", "self.set_headerbar()\n", "self.assemble_stack()\n", "self.connect_events()\n" ]
[ "def unlock_database(self):...\n", "self.builder = Gtk.Builder()\n", "self.builder.add_from_resource('/run/terminal/KeepassGtk/unlock_database.ui')\n", "self.set_headerbar()\n", "self.assemble_stack()\n", "self.connect_events()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "from pyramid.httpexceptions import HTTPFound, HTTPNoContent\n", "from pyramid.request import Request\n", "from pyramid.security import Allow\n", "from pyramid.view import view_config\n", "from . import db\n", "from .app import RootContextFactory\n", "from .embed import embeddable\n", "def __getitem__...
[ "from pyramid.httpexceptions import HTTPFound, HTTPNoContent\n", "from pyramid.request import Request\n", "from pyramid.security import Allow\n", "from pyramid.view import view_config\n", "from . import db\n", "from .app import RootContextFactory\n", "from .embed import embeddable\n", "def __getitem__...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Condition", "Return'", "FunctionDef'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_3(VAR_4, VAR_5, VAR_6):...\n", "VAR_14 = ''\n", "VAR_15 = ()\n", "if VAR_4:\n", "VAR_14 = 'where c.author_id=' + str(int(VAR_4))\n", "if VAR_5:\n", "if VAR_6:\n", "VAR_14 = 'where b.series_id=' + str(int(VAR_5))\n", "VAR_20 = '%' + VAR_6 + '%'\n", "VAR_9 = 'string'.format(VAR_14)\n", "...
[ "def get_filtered_books_count(author_id, series_id, search_arg):...\n", "wh = ''\n", "parameters = ()\n", "if author_id:\n", "wh = 'where c.author_id=' + str(int(author_id))\n", "if series_id:\n", "if search_arg:\n", "wh = 'where b.series_id=' + str(int(series_id))\n", "s = '%' + search_arg + '%'\n"...
[ 0, 0, 4, 0, 4, 0, 0, 4, 0, 0, 4, 0, 4, 4, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "AugAssign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6(self, *VAR_4, **VAR_5):...\n", "return self._run_ssh(VAR_4, VAR_14=self.configuration.eqlx_cli_max_retries)\n" ]
[ "def _eql_execute(self, *args, **kwargs):...\n", "return self._run_ssh(args, attempts=self.configuration.eqlx_cli_max_retries)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "import pymysql\n", "import dbconfig\n", "def FUNC_0(self, VAR_0='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n" ]
[ "import pymysql\n", "import dbconfig\n", "def connect(self, database='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n" ]
[ 0, 0, 0, 0 ]
[ "Import'", "Import'", "FunctionDef'", "Return'" ]
[ "def FUNC_6(VAR_9, VAR_10, VAR_11, VAR_12, VAR_13, VAR_14, VAR_15, VAR_16):...\n", "VAR_17 = generate_matched_table_name(VAR_11, 'hmis_service_stays')\n", "VAR_18 = generate_matched_table_name(VAR_11, 'jail_bookings')\n", "VAR_33 = table_exists(VAR_17, db.engine)\n", "VAR_34 = table_exists(VAR_18, db.engine...
[ "def get_records_by_time(start_time, end_time, jurisdiction, limit, offset,...\n", "matched_hmis_table = generate_matched_table_name(jurisdiction,\n 'hmis_service_stays')\n", "matched_bookings_table = generate_matched_table_name(jurisdiction,\n 'jail_bookings')\n", "hmis_exists = table_exists(matched_hm...
[ 0, 0, 0, 0, 0, 0, 0, 4, 4, 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", "Condition", "Assign'", "For", "Assign'", "Expr'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "As...
[ "from flask import Flask, render_template, url_for, flash, redirect, request\n", "from flask_sqlalchemy import SQLAlchemy\n", "VAR_0 = Flask(__name__, static_folder='static', static_url_path='')\n", "VAR_0.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.sqlite3'\n", "VAR_0.config['SECRET_KEY'] = 'random...
[ "from flask import Flask, render_template, url_for, flash, redirect, request\n", "from flask_sqlalchemy import SQLAlchemy\n", "app = Flask(__name__, static_folder='static', static_url_path='')\n", "app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.sqlite3'\n", "app.config['SECRET_KEY'] = 'random strin...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_1(self):...\n", "return 'check the main page'\n" ]
[ "def describe(self):...\n", "return 'check the main page'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_15(self, VAR_14):...\n", "" ]
[ "def is_date(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_3(VAR_1):...\n", "return frappe.db.get_value('Blog Category', {'name': VAR_1}, 'title') or VAR_1\n" ]
[ "def get_blog_category(route):...\n", "return frappe.db.get_value('Blog Category', {'name': route}, 'title') or route\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_30(self):...\n", "VAR_25 = -430000000\n", "self.cursor.execute('create table t1(d bigint)')\n", "self.cursor.execute('insert into t1 values (?)', VAR_25)\n", "VAR_20 = self.cursor.execute('select d from t1').fetchone()[0]\n", "self.assertEqual(VAR_20, VAR_25)\n" ]
[ "def test_negative_bigint(self):...\n", "input = -430000000\n", "self.cursor.execute('create table t1(d bigint)')\n", "self.cursor.execute('insert into t1 values (?)', input)\n", "result = self.cursor.execute('select d from t1').fetchone()[0]\n", "self.assertEqual(result, input)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_0(VAR_0):...\n", "return os.stat(VAR_0, follow_symlinks=os.stat not in os.\n supports_follow_symlinks)\n" ]
[ "def lstat(f):...\n", "return os.stat(f, follow_symlinks=os.stat not in os.supports_follow_symlinks)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@property...\n", "return super(CLASS_0, self).content_security_policy + '; sandbox allow-scripts'\n" ]
[ "@property...\n", "return super(FilesHandler, self\n ).content_security_policy + '; sandbox allow-scripts'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_6(self, VAR_11):...\n", "return utils.sanitize_url(VAR_11)\n" ]
[ "def run(self, url):...\n", "return utils.sanitize_url(url)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0, VAR_1):...\n", "return chain(*map(attrgetter(VAR_1), VAR_0))\n" ]
[ "def jobfiles(jobs, type):...\n", "return chain(*map(attrgetter(type), jobs))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_7, VAR_54=None, VAR_55=None, VAR_14=errors....\n", "self.min = VAR_54\n", "self.max = VAR_55\n", "self.error = VAR_14\n", "CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n" ]
[ "def __init__(self, param, min=None, max=None, error=errors.BAD_NUMBER, *a, **kw...\n", "self.min = min\n", "self.max = max\n", "self.error = error\n", "Validator.__init__(self, param, *a, **kw)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n" ]
[ "def test_filters_2(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_5(self):...\n", "self._check_duplicate_key(VAR_0)\n" ]
[ "def test_rsa_duplicate_key(self):...\n", "self._check_duplicate_key(RSA_PUBKEY)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "from __future__ import unicode_literals\n", "import frappe\n", "from frappe import _\n", "from erpnext.hr.doctype.leave_application.leave_application import get_leave_allocation_records, get_leave_balance_on, get_approved_leaves_for_period\n", "def FUNC_0(VAR_0=None):...\n", "VAR_1 = frappe.db.sql_list('...
[ "from __future__ import unicode_literals\n", "import frappe\n", "from frappe import _\n", "from erpnext.hr.doctype.leave_application.leave_application import get_leave_allocation_records, get_leave_balance_on, get_approved_leaves_for_period\n", "def execute(filters=None):...\n", "leave_types = frappe.db.s...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "import sqlalchemy\n", "VAR_0 = \"SELECT * FROM foo WHERE id = '%s'\" % identifier\n", "VAR_0 = \"INSERT INTO foo VALUES ('a', 'b', '%s')\" % value\n", "VAR_0 = \"DELETE FROM foo WHERE id = '%s'\" % identifier\n", "VAR_0 = \"UPDATE foo SET value = 'b' WHERE id = '%s'\" % identifier\n", "VAR_0 = (\n \"\...
[ "import sqlalchemy\n", "query = \"SELECT * FROM foo WHERE id = '%s'\" % identifier\n", "query = \"INSERT INTO foo VALUES ('a', 'b', '%s')\" % value\n", "query = \"DELETE FROM foo WHERE id = '%s'\" % identifier\n", "query = \"UPDATE foo SET value = 'b' WHERE id = '%s'\" % identifier\n", "query = (\n \"\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0 ]
[ "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "FunctionDef'", "FunctionDef'", "Return'" ]
[ "def FUNC_14(self):...\n", "self.run_test_case(self.scenario.delete_app(), retry_interval_secs=8,\n max_retries=8)\n" ]
[ "def test_z_delete_app(self):...\n", "self.run_test_case(self.scenario.delete_app(), retry_interval_secs=8,\n max_retries=8)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_28(self, VAR_5):...\n", "if not self._user_options['seed_identifiers_with_syntax']:\n", "return\n", "VAR_18 = vimsupport.CurrentFiletypes()[0]\n", "if VAR_18 in self._filetypes_with_keywords_loaded:\n", "return\n", "self._filetypes_with_keywords_loaded.add(VAR_18)\n", "VAR_5['syntax_keywords...
[ "def _AddSyntaxDataIfNeeded(self, extra_data):...\n", "if not self._user_options['seed_identifiers_with_syntax']:\n", "return\n", "filetype = vimsupport.CurrentFiletypes()[0]\n", "if filetype in self._filetypes_with_keywords_loaded:\n", "return\n", "self._filetypes_with_keywords_loaded.add(filetype)\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Expr'", "Assign'" ]
[ "def FUNC_4(VAR_5, VAR_6, VAR_7='stable'):...\n", "VAR_0 = 'https://static.rust-lang.org/dist/channel-rust-' + VAR_7 + '.toml'\n", "VAR_21 = requests.get(VAR_0)\n", "VAR_21.raise_for_status()\n", "VAR_3 = toml.loads(VAR_21.content)\n", "if VAR_3['manifest-version'] != '2':\n", "print('ERROR: unrecognize...
[ "def repack(host, targets, channel='stable'):...\n", "url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml'\n", "req = requests.get(url)\n", "req.raise_for_status()\n", "manifest = toml.loads(req.content)\n", "if manifest['manifest-version'] != '2':\n", "print('ERROR: unrecognized ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Return'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Condition", "Expr'", "Assign'", "Expr'", "For", "Assign'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'", ...
[ "def FUNC_6(self, VAR_12):...\n", "VAR_14 = (\n \"\"\"DELETE FROM events\n WHERE event_id = {0}\n \"\"\"\n .format(VAR_12))\n", "VAR_15 = self.cur.execute(VAR_14)\n", "self.conn.commit()\n", "return VAR_15\n" ]
[ "def delete_event(self, event_id):...\n", "sql = (\n \"\"\"DELETE FROM events\n WHERE event_id = {0}\n \"\"\"\n .format(event_id))\n", "affected_count = self.cur.execute(sql)\n", "self.conn.commit()\n", "return affected_count\n" ]
[ 0, 4, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_0(self):...\n", "self.client.login(username='Karyn', password='specialP@55word')\n" ]
[ "def setUp(self):...\n", "self.client.login(username='Karyn', password='specialP@55word')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_7(VAR_2, VAR_16):...\n", "return FUNC_9(VAR_2, 'submission.id = %s' % VAR_16)[0]\n" ]
[ "def get_full_by_id(db, id):...\n", "return get_full_sql(db, 'submission.id = %s' % id)[0]\n" ]
[ 0, 4 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_19(self, VAR_9=True):...\n", "\"\"\"docstring\"\"\"\n", "self._kill_process_type(VAR_13.PROCESS_TYPE_LOG_MONITOR, VAR_9=check_alive)\n" ]
[ "def kill_log_monitor(self, check_alive=True):...\n", "\"\"\"docstring\"\"\"\n", "self._kill_process_type(ray_constants.PROCESS_TYPE_LOG_MONITOR, check_alive\n =check_alive)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_6(self, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_9 = \"SELECT rowid FROM tags WHERE tag = '\" + VAR_6 + \"'\"\n", "self.query(VAR_9)\n", "return self.c.fetchone()[0]\n" ]
[ "def tag_to_tag_num(self, tag):...\n", "\"\"\"docstring\"\"\"\n", "q = \"SELECT rowid FROM tags WHERE tag = '\" + tag + \"'\"\n", "self.query(q)\n", "return self.c.fetchone()[0]\n" ]
[ 0, 0, 4, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_2(VAR_0, VAR_1, VAR_2, VAR_4, VAR_5, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = FUNC_0(VAR_0, VAR_1, VAR_2, VAR_3)\n", "if VAR_8:\n", "ereporter2.log_request(VAR_4, VAR_5=source, VAR_8=message)\n", "return VAR_8\n" ]
[ "def log_unexpected_subset_keys(expected_keys, minimum_keys, actual_keys,...\n", "\"\"\"docstring\"\"\"\n", "message = has_unexpected_subset_keys(expected_keys, minimum_keys,\n actual_keys, name)\n", "if message:\n", "ereporter2.log_request(request, source=source, message=message)\n", "return message\n...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_10(self, VAR_9, VAR_10=None, VAR_11=None, VAR_15=False):...\n", "get_and_check_project(VAR_9, VAR_11, ('change_project',))\n", "VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n", "VAR_26 = CLASS_1(VAR_28, data=request.data, VAR_15=partial)\n", "VAR_26.is_valid(raise_exception=True)\n", ...
[ "def update(self, request, pk=None, project_pk=None, partial=False):...\n", "get_and_check_project(request, project_pk, ('change_project',))\n", "task = self.queryset.get(pk=pk, project=project_pk)\n", "serializer = TaskSerializer(task, data=request.data, partial=partial)\n", "serializer.is_valid(raise_exce...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def __getstate__(self):...\n", "return self.serialize()\n" ]
[ "def __getstate__(self):...\n", "return self.serialize()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self, VAR_2):...\n", "return self.c.execute(VAR_2)\n" ]
[ "def query(self, query):...\n", "return self.c.execute(query)\n" ]
[ 0, 4 ]
[ "FunctionDef'", "Return'" ]
[ "@functools.wraps(VAR_3)...\n", "VAR_23 = VAR_5.pop('timeout', None)\n", "VAR_24 = eventlet.spawn(VAR_3, self, *VAR_4, **kwargs)\n", "if VAR_23 is None:\n", "return VAR_24.wait()\n", "VAR_36 = eventlet.spawn_after(VAR_23, VAR_24.kill)\n", "VAR_48 = VAR_24.wait()\n", "VAR_36.cancel()\n", "return VAR_...
[ "@functools.wraps(f)...\n", "timeout = kwargs.pop('timeout', None)\n", "gt = eventlet.spawn(f, self, *args, **kwargs)\n", "if timeout is None:\n", "return gt.wait()\n", "kill_thread = eventlet.spawn_after(timeout, gt.kill)\n", "res = gt.wait()\n", "kill_thread.cancel()\n", "return res\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_2(self, VAR_4, VAR_5):...\n", "VAR_8 = (\n \"\"\"\n INSERT INTO Clients (username, password)\n VALUES ('{}', '{}')\n \"\"\"\n .format(VAR_4, VAR_5))\n", "VAR_7 = self.__conn.cursor()\n", "VAR_7.execute(VAR_8)\n", "self.__conn.commit()\n" ]
[ "def register(self, username, password):...\n", "insert_sql = (\n \"\"\"\n INSERT INTO Clients (username, password)\n VALUES ('{}', '{}')\n \"\"\"\n .format(username, password))\n", "cursor = self.__conn.cursor()\n", "cursor.execute(insert_sql)\n", "self.__conn.commit()\n"...
[ 0, 4, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "VAR_7 = engine.connect()\n", "VAR_8 = VAR_7.begin()\n", "VAR_9 = text(\n 'INSERT INTO users(username, hashed_password, roll_id) VALUES(:username, :hashed_password, :roll_id)'\n )\n", "VAR_8.rollback()\n", "VAR_7.close()\n", "VAR_7.execute(VAR_9, VAR_1=self.username, VAR_...
[ "def save(self):...\n", "connection = engine.connect()\n", "trans = connection.begin()\n", "s = text(\n 'INSERT INTO users(username, hashed_password, roll_id) VALUES(:username, :hashed_password, :roll_id)'\n )\n", "trans.rollback()\n", "connection.close()\n", "connection.execute(s, username=self.u...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]