lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_3(VAR_5, VAR_6=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_43 = None\n",
"VAR_44 = None\n",
"VAR_45 = '%Y-%m-%d %H:%M:%S.%f'\n",
"if VAR_6:\n",
"VAR_45 = ('%Y-%m-%d %H:%M:%S.%f' if VAR_6.fieldtype == 'Datetime' else\n '%Y-%m-%d')\n",
"if VAR_5 and isinstance(VAR_5, (list, tuple)):\n",
... | [
"def get_between_date_filter(value, df=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from_date = None\n",
"to_date = None\n",
"date_format = '%Y-%m-%d %H:%M:%S.%f'\n",
"if df:\n",
"date_format = ('%Y-%m-%d %H:%M:%S.%f' if df.fieldtype == 'Datetime' else\n '%Y-%m-%d')\n",
"if value and isinstance(value,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_26(self):...\n",
"FUNC_4()\n"
] | [
"def setUp(self):...\n",
"create_dummy_data()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_53):...\n",
"if VAR_53:\n",
"self.error()\n",
"VAR_23 = _force_utf8(VAR_53)\n",
"return self.error(errors.USER_DOESNT_EXIST)\n",
"return Account._by_name(VAR_23)\n"
] | [
"def run(self, username):...\n",
"if username:\n",
"self.error()\n",
"name = _force_utf8(username)\n",
"return self.error(errors.USER_DOESNT_EXIST)\n",
"return Account._by_name(name)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Return'"
] |
[
"@VAR_0.route('/restrict/<int:id>')...\n",
"VAR_7 = get_db()\n",
"VAR_15 = get_user(VAR_4)\n",
"VAR_16 = None\n",
"if VAR_15['restricted'] == 1:\n",
"VAR_16 = 'User already restricted.'\n",
"if VAR_15['admin'] == 1:\n",
"if VAR_16 is None:\n",
"VAR_16 = 'Cannot restrict admins.'\n",
"VAR_7.execute... | [
"@bp.route('/restrict/<int:id>')...\n",
"db = get_db()\n",
"user = get_user(id)\n",
"error = None\n",
"if user['restricted'] == 1:\n",
"error = 'User already restricted.'\n",
"if user['admin'] == 1:\n",
"if error is None:\n",
"error = 'Cannot restrict admins.'\n",
"db.execute('UPDATE user SET rest... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"GenericRequest._prepare(self)\n",
"self.files = list(zip(self.submission_format, self.filenames))\n"
] | [
"def _prepare(self):...\n",
"GenericRequest._prepare(self)\n",
"self.files = list(zip(self.submission_format, self.filenames))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_1(self, VAR_8=...\n",
"VAR_22 = {}\n",
"if VAR_8.find('typing-booster:') > 0:\n",
"VAR_8 = VAR_8.replace('typing-booster:', '')\n",
"VAR_23 = re.compile('^#')\n",
"for line in file(VAR_8):\n",
"if not VAR_23.match(line):\n",
"return VAR_22\n",
"VAR_57, VAR_58 = line.strip().split('=', 1)\n... | [
"def __parse_conf_file(self, conf_file=...\n",
"key_val_dict = {}\n",
"if conf_file.find('typing-booster:') > 0:\n",
"conf_file = conf_file.replace('typing-booster:', '')\n",
"comment_patt = re.compile('^#')\n",
"for line in file(conf_file):\n",
"if not comment_patt.match(line):\n",
"return key_val_di... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, VAR_9=None, VAR_1=None, VAR_6=None, VAR_11={}, VAR_13=...\n",
"self.conf = VAR_11\n",
"self.parents = set()\n",
"self.children = set()\n",
"self.name = VAR_9\n",
"self.directory = VAR_1\n",
"self.options = VAR_6 or {}\n",
"self.exclude_from_cmake = VAR_13\n",
"self.external_proje... | [
"def __init__(self, name=None, directory=None, options=None, conf={},...\n",
"self.conf = conf\n",
"self.parents = set()\n",
"self.children = set()\n",
"self.name = name\n",
"self.directory = directory\n",
"self.options = options or {}\n",
"self.exclude_from_cmake = exclude_from_cmake\n",
"self.exte... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@FUNC_2...\n",
"VAR_15 = {'page_title': 'Bootstrap', 'admin_group': model.ADMIN_GROUP,\n 'return_url': self.request.get('r') or ''}\n",
"self.reply('auth/admin/bootstrap.html', VAR_15)\n"
] | [
"@forbid_ui_on_replica...\n",
"env = {'page_title': 'Bootstrap', 'admin_group': model.ADMIN_GROUP,\n 'return_url': self.request.get('r') or ''}\n",
"self.reply('auth/admin/bootstrap.html', env)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'"
] |
[
"async def FUNC_2(self, VAR_5):...\n",
"if isinstance(VAR_5, FrameNavigated):\n",
"await self._runon('load')\n",
"self._loaded = True\n"
] | [
"async def push(self, item):...\n",
"if isinstance(item, FrameNavigated):\n",
"await self._runon('load')\n",
"self._loaded = True\n"
] | [
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_1(self):...\n",
"return 'Running ssh host check for %s with pid %s' % (self.hostname, self.pid)\n"
] | [
"def info(self):...\n",
"return 'Running ssh host check for %s with pid %s' % (self.hostname, self.pid)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_20(self, VAR_10=None, VAR_11=None, VAR_1=None):...\n",
"VAR_10 = self.add_rule(VAR_10, VAR_11, VAR_1)\n",
"VAR_13 = self.get_rule(VAR_10)\n",
"def FUNC_39(VAR_101):...\n",
"if VAR_101.input:\n",
"VAR_13.set_input(*VAR_101.input[0], **ruleinfo.input[1])\n",
"if VAR_101.output:\n",
"VAR_13.set... | [
"def rule(self, name=None, lineno=None, snakefile=None):...\n",
"name = self.add_rule(name, lineno, snakefile)\n",
"rule = self.get_rule(name)\n",
"def decorate(ruleinfo):...\n",
"if ruleinfo.input:\n",
"rule.set_input(*ruleinfo.input[0], **ruleinfo.input[1])\n",
"if ruleinfo.output:\n",
"rule.set_out... | [
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'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Con... |
[
"def FUNC_13(self, VAR_6='/dev'):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = '(sr[0-9]|hd[c-z]|cdrom[0-9]?)'\n",
"for dvd in [re.match(VAR_22, dev) for dev in os.listdir(VAR_6)]:\n",
"if dvd is not None:\n",
"return '/dev/{0}'.format(dvd.group(0))\n"
] | [
"def get_dvd_device(self, dev_dir='/dev'):...\n",
"\"\"\"docstring\"\"\"\n",
"patten = '(sr[0-9]|hd[c-z]|cdrom[0-9]?)'\n",
"for dvd in [re.match(patten, dev) for dev in os.listdir(dev_dir)]:\n",
"if dvd is not None:\n",
"return '/dev/{0}'.format(dvd.group(0))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'"
] |
[
"def FUNC_11(VAR_35, VAR_27):...\n",
"return {'complete_output': VAR_35, 'categories': VAR_27}\n"
] | [
"def _output_dict(complete_output, categories):...\n",
"return {'complete_output': complete_output, 'categories': categories}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(self, VAR_11, VAR_7):...\n",
""
] | [
"def expectation(self, observable, wires):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@auth.route('/register', methods=['GET', 'POST'])...\n",
"VAR_1 = RegistrationForm()\n",
"if VAR_1.validate_on_submit():\n",
"VAR_2 = User(email=form.email.data, username=form.username.data, password=\n form.password.data)\n",
"return render_template('auth/register.html', VAR_1=form)\n",
"db.session.a... | [
"@auth.route('/register', methods=['GET', 'POST'])...\n",
"form = RegistrationForm()\n",
"if form.validate_on_submit():\n",
"user = User(email=form.email.data, username=form.username.data, password=\n form.password.data)\n",
"return render_template('auth/register.html', form=form)\n",
"db.session.add(u... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7, VAR_12 = self.make_xsrf_handling_app()\n",
"VAR_17 = VAR_7.get('/request').body\n",
"VAR_7.post('/request', VAR_20={'X-XSRF-Token': token})\n",
"self.assertEqual([('POST', True)], VAR_12)\n"
] | [
"def test_xsrf_token_header(self):...\n",
"\"\"\"docstring\"\"\"\n",
"app, calls = self.make_xsrf_handling_app()\n",
"token = app.get('/request').body\n",
"app.post('/request', headers={'X-XSRF-Token': token})\n",
"self.assertEqual([('POST', True)], calls)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(VAR_3, VAR_2):...\n",
"print('first name: ', end='')\n",
"VAR_7 = input()\n",
"print('last name: ', end='')\n",
"VAR_8 = input()\n",
"print('phone number (xxxxxxxxxxx): ', end='')\n",
"VAR_9 = input()\n",
"VAR_9 = int(VAR_9) if VAR_9.isdigit() else None\n",
"print('email: ', end='')\n",
... | [
"def create_new_user(username, query):...\n",
"print('first name: ', end='')\n",
"fname = input()\n",
"print('last name: ', end='')\n",
"lname = input()\n",
"print('phone number (xxxxxxxxxxx): ', end='')\n",
"phone = input()\n",
"phone = int(phone) if phone.isdigit() else None\n",
"print('email: ', ... | [
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,
4
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",... |
[
"import pymysql\n",
"import dbconfig\n",
"def FUNC_0(self, VAR_0='crimemap'):...\n",
"return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\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, passwd=\n dbconfig.db_password, db=database)\n"
] | [
0,
0,
0,
0
] | [
"Import'",
"Import'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_40(VAR_87):...\n",
"return filterfalse(self.is_rule, VAR_87)\n"
] | [
"def files(items):...\n",
"return filterfalse(self.is_rule, items)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = enterprise_customer_for_request(VAR_3)\n",
"if not VAR_21:\n",
"return {}\n",
"VAR_22 = configuration_helpers.get_value('PLATFORM_NAME', settings.\n PLATFORM_NAME)\n",
"if VAR_21.branding_configuration.logo:\n",
"VAR_39 = VAR_21.brandi... | [
"def enterprise_sidebar_context(request):...\n",
"\"\"\"docstring\"\"\"\n",
"enterprise_customer = enterprise_customer_for_request(request)\n",
"if not enterprise_customer:\n",
"return {}\n",
"platform_name = configuration_helpers.get_value('PLATFORM_NAME', settings.\n PLATFORM_NAME)\n",
"if enterpri... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = 'CREATE TABLE {0}(ID INTEGER PRIMARY KEY '.format(VAR_2)\n",
"for i in VAR_4:\n",
"VAR_7 += ',' + i + ' '\n",
"VAR_7 += ');'\n",
"VAR_7 += VAR_0(VAR_4[i])\n",
"self._run_command(VAR_7)\n"
] | [
"def createTable(self, data):...\n",
"\"\"\"docstring\"\"\"\n",
"command = 'CREATE TABLE {0}(ID INTEGER PRIMARY KEY '.format(TABLE_NAME)\n",
"for i in data:\n",
"command += ',' + i + ' '\n",
"command += ');'\n",
"command += getSQLiteType(data[i])\n",
"self._run_command(command)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"Expr'"
] |
[
"def FUNC_24(self, VAR_37='/tmp/soledad-test/test'):...\n",
"return os.path.join(VAR_37, str(VAR_1.uuid4()))\n"
] | [
"def _generate_soledad_test_folder_name(self, soledad_test_folder=...\n",
"return os.path.join(soledad_test_folder, str(uuid.uuid4()))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import absolute_import\n",
"from mock import MagicMock, patch\n",
"from six.moves.urllib_parse import quote_plus\n",
"from flask import url_for, session\n",
"from invenio.testsuite import make_test_suite, run_test_suite\n",
"from invenio.ext.sqlalchemy import db\n",
"from .helpers impor... | [
"from __future__ import absolute_import\n",
"from mock import MagicMock, patch\n",
"from six.moves.urllib_parse import quote_plus\n",
"from flask import url_for, session\n",
"from invenio.testsuite import make_test_suite, run_test_suite\n",
"from invenio.ext.sqlalchemy import db\n",
"from .helpers impor... | [
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
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign... |
[
"def FUNC_24(VAR_36):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_66 = {}\n",
"for VAR_76, v in VAR_36:\n",
"VAR_66[VAR_76] = v\n",
"return VAR_66\n"
] | [
"def _kw(keywords):...\n",
"\"\"\"docstring\"\"\"\n",
"r = {}\n",
"for k, v in keywords:\n",
"r[k] = v\n",
"return r\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"\"\"\"\nRun Git commands in separate processes\n\"\"\"\n",
"import shlex\n",
"import subprocess\n",
"from os import path\n",
"from typing import Dict\n",
"from .printing import print_green\n",
"from .printing import print_yellow\n",
"def FUNC_0(VAR_0: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
... | [
"\"\"\"\nRun Git commands in separate processes\n\"\"\"\n",
"import shlex\n",
"import subprocess\n",
"from os import path\n",
"from typing import Dict\n",
"from .printing import print_green\n",
"from .printing import print_yellow\n",
"def shell(command: str) ->str:...\n",
"\"\"\"docstring\"\"\"\n",
... | [
0,
2,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_38(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.reportMatch(p1='A', p2=1)\n"
] | [
"def test_p1_contains_letter(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.reportMatch(p1='A', p2=1)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_0():...\n",
"return tornado.web.Application([('/', CLASS_0), ('/blog/(.*)', CLASS_1), (\n '/webResources/(.*)', tornado.web.StaticFileHandler, {'path':\n 'webResources'})], xsrf_cookies=True, cookie_secret='this is my org blog')\n"
] | [
"def make_app():...\n",
"return tornado.web.Application([('/', HomeHandler), ('/blog/(.*)',\n BlogHandler), ('/webResources/(.*)', tornado.web.StaticFileHandler, {\n 'path': 'webResources'})], xsrf_cookies=True, cookie_secret=\n 'this is my org blog')\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(self, VAR_8):...\n",
"VAR_0 = this_file.read()\n",
"VAR_31 = re.findall('->\\\\s+(?!http)([\\\\w\\\\.\\\\/]+)', VAR_0)\n",
"return VAR_31\n"
] | [
"def get_file_links_in_file(self, filename):...\n",
"contents = this_file.read()\n",
"links = re.findall('->\\\\s+(?!http)([\\\\w\\\\.\\\\/]+)', contents)\n",
"return links\n"
] | [
0,
0,
1,
1
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(VAR_24):...\n",
"return binary_to_object_id(VAR_24).redis_shard_hash() % len(self.state.\n redis_clients)\n"
] | [
"def to_shard_index(id_bin):...\n",
"return binary_to_object_id(id_bin).redis_shard_hash() % len(self.state.\n redis_clients)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_18(VAR_26):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_43 = subprocess.check_output(VAR_26)\n",
"VAR_44 = VAR_43.split(b' ')[1]\n",
"return int(VAR_44)\n",
"return VAR_44\n"
] | [
"def sysctl(command):...\n",
"\"\"\"docstring\"\"\"\n",
"out = subprocess.check_output(command)\n",
"result = out.split(b' ')[1]\n",
"return int(result)\n",
"return result\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_61 = self._accounts[VAR_16.user_auth.username]\n",
"self._services_by_user[VAR_16.user_auth.uuid] = VAR_61.services\n",
"yield defer.succeed(None)\n"
] | [
"@defer.inlineCallbacks...\n",
"account = self._accounts[leap_session.user_auth.username]\n",
"self._services_by_user[leap_session.user_auth.uuid] = account.services\n",
"yield defer.succeed(None)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_2, VAR_6, VAR_7, VAR_4, VAR_3):...\n",
"setattr(VAR_2, VAR_6, db.Text(VAR_7))\n"
] | [
"def parse_input(self, report, name, value, request, attribute):...\n",
"setattr(report, name, db.Text(value))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_0):...\n",
"VAR_5 = 'id SERIAL PRIMARY KEY'\n",
"return VAR_5\n"
] | [
"def create_field(self, name):...\n",
"field_string = 'id SERIAL PRIMARY KEY'\n",
"return field_string\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"VAR_14 = 'DROP TABLE IF EXISTS DPNET'\n",
"self.cursor.execute(VAR_14)\n",
"self.connection.commit()\n"
] | [
"def destroy_junk_table(self):...\n",
"query = 'DROP TABLE IF EXISTS DPNET'\n",
"self.cursor.execute(query)\n",
"self.connection.commit()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_1, VAR_6):...\n",
""
] | [
"def directory_index(path, fullpath):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_37 = get_current_registry()\n",
"VAR_39 = VAR_37.getUtility(IDataTraversalProxyFactory)\n",
"if VAR_22 == RELATION_OPERATIONS.ADD or VAR_22 == RELATION_OPERATIONS.UPDATE:\n",
"if VAR_22 == RELATION_OPERATIONS.ADD and not VAR_21 is None:\n",
"VAR_17 = ... | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"reg = get_current_registry()\n",
"prx_fac = reg.getUtility(IDataTraversalProxyFactory)\n",
"if relation_operation == RELATION_OPERATIONS.ADD or relation_operation == RELATION_OPERATIONS.UPDATE:\n",
"if relation_operation == RELATION_OPERATIONS.ADD and not t... | [
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",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Conditi... |
[
"def FUNC_16(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = VAR_19(VAR_16, 'dynamic')\n",
"VAR_31 = [VAR_30] if FUNC_10(VAR_30) else VAR_30\n",
"for VAR_3 in VAR_31:\n",
"VAR_52 = list(VAR_5.finditer(VAR_3))\n",
"return VAR_30\n",
"for VAR_29 in VAR_52:\n",
"if VAR_29.group('constraint'):\n"
] | [
"def dynamic(value):...\n",
"\"\"\"docstring\"\"\"\n",
"annotated = flag(value, 'dynamic')\n",
"tocheck = [annotated] if not_iterable(annotated) else annotated\n",
"for file in tocheck:\n",
"matches = list(_wildcard_regex.finditer(file))\n",
"return annotated\n",
"for match in matches:\n",
"if match... | [
0,
0,
7,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"For",
"Condition"
] |
[
"def __init__(self, VAR_18, VAR_35=10000, **VAR_16):...\n",
"CLASS_17.__init__(self, VAR_18, VAR_35=length, **kw)\n"
] | [
"def __init__(self, item, length=10000, **kw):...\n",
"VLength.__init__(self, item, length=length, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"VAR_21 = self.agent.type_to_payload('deleteGoogleLoadBalancerDescription',\n {'region': self.bindings['TEST_GCE_REGION'], 'credentials': self.\n bindings['GCE_CREDENTIALS'], 'loadBalancerName': self.__use_lb_name})\n",
"VAR_20 = gcp.GceContractBuilder(self.gce_observer)\n",
"V... | [
"def delete_load_balancer(self):...\n",
"payload = self.agent.type_to_payload('deleteGoogleLoadBalancerDescription',\n {'region': self.bindings['TEST_GCE_REGION'], 'credentials': self.\n bindings['GCE_CREDENTIALS'], 'loadBalancerName': self.__use_lb_name})\n",
"builder = gcp.GceContractBuilder(self.gce_ob... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@FUNC_0('create', {'path': '{path}', 'fsal': '{fsal.name}', 'cluster_id':...\n",
"if VAR_15['name'] not in Ganesha.fsals_available():\n",
"VAR_23 = GaneshaConf.instance(VAR_6)\n",
"VAR_24 = VAR_23.create_export({'path': VAR_5, 'pseudo': VAR_8, 'cluster_id':\n VAR_6, 'daemons': VAR_7, 'tag': VAR_9, 'access... | [
"@NfsTask('create', {'path': '{path}', 'fsal': '{fsal.name}', 'cluster_id':...\n",
"if fsal['name'] not in Ganesha.fsals_available():\n",
"ganesha_conf = GaneshaConf.instance(cluster_id)\n",
"ex_id = ganesha_conf.create_export({'path': path, 'pseudo': pseudo,\n 'cluster_id': cluster_id, 'daemons': daemons,... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"from distutils.core import setup\n",
"setup(name='emp-1zlab', version='0.1.13', py_modules=['emp_wifi',\n 'emp_boot', 'emp_dev', 'emp_utils', 'emp_webrepl'], author=\n 'fuermohao@1zlab.com', author_email='fuermohao@outlook.com', url=\n 'http://emp.1zlab.com', description=\n 'EMP(Easy MicroPython) is ... | [
"from distutils.core import setup\n",
"setup(name='emp-1zlab', version='0.1.13', py_modules=['emp_wifi',\n 'emp_boot', 'emp_dev', 'emp_utils', 'emp_webrepl'], author=\n 'fuermohao@1zlab.com', author_email='fuermohao@outlook.com', url=\n 'http://emp.1zlab.com', description=\n 'EMP(Easy MicroPython) is ... | [
0,
1
] | [
"ImportFrom'",
"Expr'"
] |
[
"@VAR_0.route('/analogy')...\n",
"VAR_12 = request.args.get('like1', '')\n",
"VAR_13 = request.args.get('like2', '')\n",
"VAR_14 = [word.lower() for word in [VAR_12, VAR_13] if word != '']\n",
"VAR_15 = request.args.get('unlike', '')\n",
"VAR_15 = [word.lower() for word in list(VAR_15) if word not in ('',... | [
"@application.route('/analogy')...\n",
"like1 = request.args.get('like1', '')\n",
"like2 = request.args.get('like2', '')\n",
"likes = [word.lower() for word in [like1, like2] if word != '']\n",
"unlike = request.args.get('unlike', '')\n",
"unlike = [word.lower() for word in list(unlike) if word not in (''... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_83.included_stack:\n",
"return None\n",
"return os.path.join(os.path.dirname(VAR_83.included_stack[-1]), VAR_0)\n"
] | [
"def srcdir(path):...\n",
"\"\"\"docstring\"\"\"\n",
"if not workflow.included_stack:\n",
"return None\n",
"return os.path.join(os.path.dirname(workflow.included_stack[-1]), path)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\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}/scale'.format(**locals())\n",
"VAR_8 = {'web': 'not_an_int'}\n",
"VAR_5 = self.client.post(VAR_4, json.dumps(... | [
"def test_container_errors(self):...\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}/scale'.format(**locals())\n",
"body = {'web': 'not_an_int'}\n",
"response = self.client.po... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_35(VAR_29):...\n",
"VAR_40 = VAR_29.group('name')\n",
"VAR_16 = VAR_11[VAR_40]\n",
"if VAR_15:\n",
"if VAR_13 and VAR_16 == VAR_14:\n",
"return '{{{}}}'.format(VAR_40)\n",
"if VAR_12:\n",
"return str(VAR_16)\n",
"return VAR_14\n"
] | [
"def format_match(match):...\n",
"name = match.group('name')\n",
"value = wildcards[name]\n",
"if keep_dynamic:\n",
"if fail_dynamic and value == dynamic_fill:\n",
"return '{{{}}}'.format(name)\n",
"if fill_missing:\n",
"return str(value)\n",
"return dynamic_fill\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_21(self, VAR_21, VAR_38, VAR_39):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_57 = self.getfile(VAR_21)\n",
"if VAR_57 == False:\n",
"VAR_57[VAR_7] = VAR_39\n"
] | [
"def utime(self, path, atime, mtime):...\n",
"\"\"\"docstring\"\"\"\n",
"p = self.getfile(path)\n",
"if p == False:\n",
"p[A_CTIME] = mtime\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'"
] |
[
"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 FUNC_14(self):...\n",
"if not self.report.owner == self.request.user:\n",
"VAR_0.warn(self.invalid_access_user_message)\n"
] | [
"def _check_report_owner(self):...\n",
"if not self.report.owner == self.request.user:\n",
"logger.warn(self.invalid_access_user_message)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"@VAR_7.route('/dashboard', 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",
"return render_template('calendar/create/create.html')\n",
"VAR_12 = calendar.getCalendarList(VAR_8, VAR_6)\n... | [
"@app.route('/dashboard', methods=['GET', 'POST'])...\n",
"isAuthorized = isUserAuthorized()\n",
"if not isAuthorized:\n",
"return 'Unauthorized'\n",
"username, password = getUsernameAndPassword()\n",
"if request.method == 'POST':\n",
"return render_template('calendar/create/create.html')\n",
"calenda... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def __hash__(self):...\n",
"return self.name.__hash__()\n"
] | [
"def __hash__(self):...\n",
"return self.name.__hash__()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(VAR_0):...\n",
"if VAR_0.do_not_run is True:\n",
"VAR_15 = 'DNR'\n",
"VAR_15 = 'RUN'\n",
"VAR_15 += '_{}'.format(VAR_0.id)\n",
"return VAR_15\n"
] | [
"def run_status(obj):...\n",
"if obj.do_not_run is True:\n",
"s = 'DNR'\n",
"s = 'RUN'\n",
"s += '_{}'.format(obj.id)\n",
"return s\n"
] | [
0,
0,
1,
1,
1,
1
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = ('view.%s' % self.type_, 'admin.%s' % self.type_, 'view.file',\n 'add.file', 'edit.file')\n",
"if self.status in ('draft', 'wait', 'invalid'):\n",
"VAR_12 += ('edit.%s' % self.type_, 'valid.%s' % self.type_, 'delete.%s' %\n self.type_, 'dr... | [
"def _get_admin_status_acl(self):...\n",
"\"\"\"docstring\"\"\"\n",
"perms = ('view.%s' % self.type_, 'admin.%s' % self.type_, 'view.file',\n 'add.file', 'edit.file')\n",
"if self.status in ('draft', 'wait', 'invalid'):\n",
"perms += ('edit.%s' % self.type_, 'valid.%s' % self.type_, 'delete.%s' %\n se... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"AugAssign'",
"Return'",
"Condition",
"AugAssign'"
] |
[
"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_16(self):...\n",
"def FUNC_24(VAR_19, VAR_20, VAR_21=None):...\n",
"VAR_28 = None\n",
"if VAR_21:\n",
"VAR_28 = jsonutils.dumps({'httpStatus': 'dummy', 'error_code': VAR_21,\n 'module_name': 'dummy', 'error_message': 'bad'})\n",
"VAR_29 = mocks.MockRequestsResponse(VAR_20, VAR_28)\n",
"VAR_... | [
"def test_client_validate_result(self):...\n",
"def _verb_response_code(http_verb, status_code, error_code=None):...\n",
"content = None\n",
"if error_code:\n",
"content = jsonutils.dumps({'httpStatus': 'dummy', 'error_code': error_code,\n 'module_name': 'dummy', 'error_message': 'bad'})\n",
"response ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._icon\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._icon\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_17(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_15 is None:\n",
"return dict()\n",
"VAR_37 = 0\n",
"VAR_38 = None\n",
"for o in self.products:\n",
"VAR_47 = o.match(VAR_15)\n",
"return VAR_38\n",
"if VAR_47:\n",
"VAR_50 = self.get_wildcard_len(VAR_47.groupdict())\n",
"if ... | [
"def get_wildcards(self, requested_output):...\n",
"\"\"\"docstring\"\"\"\n",
"if requested_output is None:\n",
"return dict()\n",
"bestmatchlen = 0\n",
"bestmatch = None\n",
"for o in self.products:\n",
"match = o.match(requested_output)\n",
"return bestmatch\n",
"if match:\n",
"l = self.get_wi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def __getstate__(self):...\n",
"return self.serialize()\n"
] | [
"def __getstate__(self):...\n",
"return self.serialize()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import json\n",
"import sys\n",
"import os\n",
"import platform\n",
"import subprocess\n",
"from datetime import datetime\n",
"import click\n",
"import humanize\n",
"import yaml\n",
"import yamlordereddictloader\n",
"from terminaltables import SingleTable\n",
"import neres.newrelic as newreli... | [
"import json\n",
"import sys\n",
"import os\n",
"import platform\n",
"import subprocess\n",
"from datetime import datetime\n",
"import click\n",
"import humanize\n",
"import yaml\n",
"import yamlordereddictloader\n",
"from terminaltables import SingleTable\n",
"import neres.newrelic as newreli... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0... | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"... |
[
"def FUNC_18(self, VAR_24, VAR_25, VAR_26):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_65 = 0\n",
"VAR_24 = VAR_24.lower().replace('.', ' ').replace('_', ' ').replace(' ', ' ')\n",
"if VAR_24 and VAR_25 and VAR_26:\n",
"VAR_80 = '%s/%s/%s' % (VAR_24, VAR_25, VAR_26)\n",
"return VAR_65 > 0\n",
"VAR_61 = s... | [
"def have_episode(self, series, season, episode):...\n",
"\"\"\"docstring\"\"\"\n",
"total = 0\n",
"series = series.lower().replace('.', ' ').replace('_', ' ').replace(' ', ' ')\n",
"if series and season and episode:\n",
"pattern = '%s/%s/%s' % (series, season, episode)\n",
"return total > 0\n",
"res... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_31():...\n",
"yield self._bin_path\n",
"if self._is_jdk:\n",
"yield os.path.join(self.home, 'jre', 'bin')\n"
] | [
"def bin_paths():...\n",
"yield self._bin_path\n",
"if self._is_jdk:\n",
"yield os.path.join(self.home, 'jre', 'bin')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"return self.HandleGet()\n"
] | [
"def HandlePost(self):...\n",
"return self.HandleGet()\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"@tornado.gen.coroutine...\n",
"VAR_17 = 'string'\n",
"assert VAR_13\n",
"assert VAR_14\n",
"VAR_18 = [VAR_13, VAR_14]\n",
"for VAR_41 in VAR_0:\n",
"VAR_18.append(FUNC_12(VAR_10, VAR_41))\n",
"yield VAR_1.execute(query=sql, VAR_18=params)\n"
] | [
"@tornado.gen.coroutine...\n",
"sql = (\n 'INSERT INTO boiler_room_reports VALUES (NULL, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'\n )\n",
"assert room_id\n",
"assert report_id\n",
"params = [room_id, report_id]\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assert'",
"Assert'",
"Assign'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_4, VAR_5, VAR_6, VAR_7, VAR_8=None, VAR_9=None):...\n",
"VAR_16 = FUNC_11(collect_config.collect_config(VAR_4, VAR_9), VAR_8)\n",
"VAR_31 = FUNC_4(FUNC_9(VAR_5), VAR_16)\n",
"if not VAR_7:\n",
"for VAR_13, VAR_14 in VAR_31.items():\n",
"FUNC_3(os.path.join(VAR_6, FUNC_10('/', VAR_13)), VAR... | [
"def install_config(config_path, template_root, output_path, validate,...\n",
"config = strip_hash(collect_config.collect_config(config_path,\n fallback_metadata), subhash)\n",
"tree = build_tree(template_paths(template_root), config)\n",
"if not validate:\n",
"for path, contents in tree.items():\n",
"... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"For",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_3 = [['a', '=', 1]]\n",
"assert conditions_expr(VAR_3, {}) == 'a = 1'\n",
"VAR_3 = [[['a', '=', 1]]]\n",
"assert conditions_expr(VAR_3, {}) == 'a = 1'\n",
"VAR_3 = [['a', '=', 1], ['b', '=', 2]]\n",
"assert conditions_expr(VAR_3, {}) == 'a = 1 AND b = 2'\n",
"VAR_3 = [[[... | [
"def test_conditions_expr(self):...\n",
"conditions = [['a', '=', 1]]\n",
"assert conditions_expr(conditions, {}) == 'a = 1'\n",
"conditions = [[['a', '=', 1]]]\n",
"assert conditions_expr(conditions, {}) == 'a = 1'\n",
"conditions = [['a', '=', 1], ['b', '=', 2]]\n",
"assert conditions_expr(conditions,... | [
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'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assign'",
"Assign'",
"Assert'",
"Assign'",
"Assign'",
"Expr'",
"Assert'",
"Assign'",
"Assert'",
"... |
[
"def FUNC_3(self, VAR_0):...\n",
"self._input(VAR_0)\n",
"self.terminal.reset_mock()\n",
"self.oms_ssh.handle_TAB()\n"
] | [
"def _tab_after(self, string):...\n",
"self._input(string)\n",
"self.terminal.reset_mock()\n",
"self.oms_ssh.handle_TAB()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __str__(self):...\n",
"return '%s(id=%s)' % (self._data.__class__.__name__, self.get_id())\n"
] | [
"def __str__(self):...\n",
"return '%s(id=%s)' % (self._data.__class__.__name__, self.get_id())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_1=None, VAR_2=5):...\n",
"self.size = VAR_2\n",
"self.data = VAR_1 or []\n"
] | [
"def __init__(self, list=None, size=5):...\n",
"self.size = size\n",
"self.data = list or []\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_9(self, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_6:\n",
"return False\n",
"if VAR_6['iss'] not in self.app.config['OIDC_VALID_ISSUERS']:\n",
"VAR_0.error('id_token issued by non-trusted issuer: %s' % VAR_6['iss'])\n",
"if isinstance(VAR_6['aud'], list):\n",
"return False\n",
"... | [
"def is_id_token_valid(self, id_token):...\n",
"\"\"\"docstring\"\"\"\n",
"if not id_token:\n",
"return False\n",
"if id_token['iss'] not in self.app.config['OIDC_VALID_ISSUERS']:\n",
"logger.error('id_token issued by non-trusted issuer: %s' % id_token['iss'])\n",
"if isinstance(id_token['aud'], list):\... | [
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",
"Condition",
"Return'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Expr'",
"Condition",
"Return'",
"Return'",
"Expr'",
"Condition",
"Ret... |
[
"@classmethod...\n",
"return '-C-encoding', '-CUTF-8', '-S-encoding', '-SUTF-8', '-S-g:vars'\n"
] | [
"@classmethod...\n",
"return '-C-encoding', '-CUTF-8', '-S-encoding', '-SUTF-8', '-S-g:vars'\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'"
] |
[
"def FUNC_2():...\n",
"return FUNC_0('config.json')\n"
] | [
"def read_config():...\n",
"return readJsonFile('config.json')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(self, VAR_24, VAR_25):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_24[VAR_10] and os.path.exists(VAR_25) and not os.path.islink(VAR_25\n",
"VAR_24[VAR_10] = VAR_25\n"
] | [
"def update_realfile(self, f, realfile):...\n",
"\"\"\"docstring\"\"\"\n",
"if not f[A_REALFILE] and os.path.exists(realfile) and not os.path.islink(\n",
"f[A_REALFILE] = realfile\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'"
] |
[
"import inspect\n",
"import os\n",
"import pipes\n",
"import re\n",
"import six\n",
"import socket\n",
"import sys\n",
"\"\"\"string\"\"\"\n",
"def __init__(self, VAR_0=None):...\n",
"self.args = VAR_0\n",
"self.set_defaults()\n",
"self.parse_config()\n",
"self.parse_options()\n",
"self.ch... | [
"import inspect\n",
"import os\n",
"import pipes\n",
"import re\n",
"import six\n",
"import socket\n",
"import sys\n",
"\"\"\" Dict subclass that is used to handle configuration information\n needed by both SosCollector and the SosNode classes \"\"\"\n",
"def __init__(self, args=None):...\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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assig... |
[
"@classmethod...\n",
"VAR_85 = {}\n",
"VAR_86 = g.RATELIMIT * 60\n",
"if VAR_86 <= 0:\n",
"return\n",
"VAR_87 = datetime.now(g.tz) + timedelta(VAR_86=seconds)\n",
"if VAR_61 and VAR_101.user_is_loggedin:\n",
"VAR_85['user' + VAR_100(VAR_101.user._id36)] = VAR_87\n",
"if VAR_62:\n",
"VAR_85['ip' + ... | [
"@classmethod...\n",
"to_set = {}\n",
"seconds = g.RATELIMIT * 60\n",
"if seconds <= 0:\n",
"return\n",
"expire_time = datetime.now(g.tz) + timedelta(seconds=seconds)\n",
"if rate_user and c.user_is_loggedin:\n",
"to_set['user' + str(c.user._id36)] = expire_time\n",
"if rate_ip:\n",
"to_set['ip' +... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"from reddit_base import RedditController\n",
"from r2.lib.pages import BoringPage, ShowMeetup, NewMeetup, EditMeetup, PaneStack, CommentListing, LinkInfoPage, CommentReplyBox, NotEnoughKarmaToPost\n",
"from validator import validate, VUser, VRequired, VMeetup, VEditMeetup, VFloat, ValueOrBlank, ValidIP, VMenu,... | [
"from reddit_base import RedditController\n",
"from r2.lib.pages import BoringPage, ShowMeetup, NewMeetup, EditMeetup, PaneStack, CommentListing, LinkInfoPage, CommentReplyBox, NotEnoughKarmaToPost\n",
"from validator import validate, VUser, VRequired, VMeetup, VEditMeetup, VFloat, ValueOrBlank, ValidIP, VMenu,... | [
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"@staticmethod...\n",
"VAR_22 = VAR_15.get_response(VAR_13['REQUEST_METHOD'], VAR_13)\n",
"VAR_23 = '{} {}'.format(VAR_22.status, VAR_22.status.phrase)\n",
"VAR_14(VAR_23, list(VAR_22.headers))\n",
"if VAR_22.file is not None:\n",
"VAR_27 = VAR_13.get('wsgi.file_wrapper', FileWrapper)\n",
"return []\n",... | [
"@staticmethod...\n",
"response = static_file.get_response(environ['REQUEST_METHOD'], environ)\n",
"status_line = '{} {}'.format(response.status, response.status.phrase)\n",
"start_response(status_line, list(response.headers))\n",
"if response.file is not None:\n",
"file_wrapper = environ.get('wsgi.file_w... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_18(self, VAR_14):...\n",
""
] | [
"def is_relation_many_to_one(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@login_required...\n",
"VAR_5 = {}\n",
"if not VAR_0.user.is_authenticated:\n",
"return invalid_permission_redirect(VAR_0)\n",
"VAR_20 = VAR_2.get('transaction_code', None)\n",
"VAR_4 = get_object_or_404(Transaction, code=transaction_code)\n",
"VAR_5['transaction'] = VAR_4\n",
"return render(VAR_0, '... | [
"@login_required...\n",
"extra_context = {}\n",
"if not request.user.is_authenticated:\n",
"return invalid_permission_redirect(request)\n",
"transaction_code = kwargs.get('transaction_code', None)\n",
"transaction = get_object_or_404(Transaction, code=transaction_code)\n",
"extra_context['transaction'] ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"config.set(xsrf_token_key='abcdef')\n",
"VAR_1 = utils.XsrfTool()\n",
"VAR_2 = VAR_1.generate_token(12345, 'test_action')\n",
"self.assertTrue(VAR_1.verify_token(VAR_2, 12345, 'test_action'))\n"
] | [
"def test_gen_and_verify_good_token(self):...\n",
"\"\"\"docstring\"\"\"\n",
"config.set(xsrf_token_key='abcdef')\n",
"tool = utils.XsrfTool()\n",
"token = tool.generate_token(12345, 'test_action')\n",
"self.assertTrue(tool.verify_token(token, 12345, 'test_action'))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.create_snapshot(VAR_8)\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.create_snapshot(snapshot)\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1.value = beamr.interpreters.Citation(VAR_1.value[3:-1])\n",
"return VAR_1\n"
] | [
"def t_CITATION(t):...\n",
"\"\"\"docstring\"\"\"\n",
"t.value = beamr.interpreters.Citation(t.value[3:-1])\n",
"return t\n"
] | [
0,
0,
2,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"from django.test import TestCase\n",
"from deis import __version__\n",
"\"\"\"Tests middleware.py's business logic\"\"\"\n",
"VAR_0 = ['tests.json']\n",
"d... | [
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"from django.test import TestCase\n",
"from deis import __version__\n",
"\"\"\"Tests middleware.py's business logic\"\"\"\n",
"fixtures = ['tests.json']\n",
... | [
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
5,
0,
0,
0,
5,
0,
0,
0,
5,
0
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self\n",
"VAR_12 = []\n",
"@api.require(lambda : False)...\n",
"VAR_6.fail('Handler code should not be called')\n",
"def FUNC_37(self, VAR_29):...\n",
"VAR_12.append('authorization_error')\n",
"super(CLASS_7, self).authorization_error(VAR... | [
"def test_authorization_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"test = self\n",
"calls = []\n",
"@api.require(lambda : False)...\n",
"test.fail('Handler code should not be called')\n",
"def authorization_error(self, err):...\n",
"calls.append('authorization_error')\n",
"super(Handler, self).... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_31):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.info('TaskDetails(%s)', VAR_31)\n",
"if not isinstance(VAR_31, dict):\n",
"self.bot_id = VAR_31['bot_id']\n",
"self.command = VAR_31['command'] or []\n",
"self.inputs_ref = VAR_31['inputs_ref']\n",
"self.extra_args = VAR_31['extra... | [
"def __init__(self, data):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.info('TaskDetails(%s)', data)\n",
"if not isinstance(data, dict):\n",
"self.bot_id = data['bot_id']\n",
"self.command = data['command'] or []\n",
"self.inputs_ref = data['inputs_ref']\n",
"self.extra_args = data['extra_args']\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = self.bindings\n",
"VAR_11 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"VAR_9 = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'gce', 'application': self.TEST_APP, 'credentials': b... | [
"def create_server_group(self):...\n",
"\"\"\"docstring\"\"\"\n",
"bindings = self.bindings\n",
"group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'gce', 'application': self.TEST... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_19, VAR_20):...\n",
"self.initialize(VAR_19, VAR_20)\n",
"self.upload = None\n"
] | [
"def __init__(self, request, response):...\n",
"self.initialize(request, response)\n",
"self.upload = None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_11(self, *VAR_17, **VAR_12):...\n",
"return self.url_from_directory(*VAR_17, VAR_1=self.directory, **kwargs)\n"
] | [
"def url_from_checkout(self, *args, **kwargs):...\n",
"return self.url_from_directory(*args, directory=self.directory, **kwargs)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(self, VAR_10):...\n",
"self.cursor.execute(\n \"SELECT upc, name, weight, description FROM product WHERE upc ILIKE '%%%s%%';\"\n , (VAR_10,))\n",
"return self.cursor.fetchall()\n"
] | [
"def find_products_by_upc(self, product_upc):...\n",
"self.cursor.execute(\n \"SELECT upc, name, weight, description FROM product WHERE upc ILIKE '%%%s%%';\"\n , (product_upc,))\n",
"return self.cursor.fetchall()\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@VAR_47.exception(Exception)...\n",
"VAR_56 = None\n",
"VAR_57 = None\n",
"if isinstance(VAR_52, NotFound):\n",
"VAR_66 = 404\n",
"if isinstance(VAR_52, InvalidUsage):\n",
"VAR_64 = {}\n",
"VAR_66 = 405\n",
"if isinstance(VAR_52, DatasetteError):\n",
"VAR_67 = VAR_52.args[0]\n",
"VAR_64 = {}\n"... | [
"@app.exception(Exception)...\n",
"title = None\n",
"help = None\n",
"if isinstance(exception, NotFound):\n",
"status = 404\n",
"if isinstance(exception, InvalidUsage):\n",
"info = {}\n",
"status = 405\n",
"if isinstance(exception, DatasetteError):\n",
"message = exception.args[0]\n",
"info = {}... | [
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'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'"... |
[
"@VAR_0.route('/disconnect/<remote_app>/')...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1 not in disconnect_handlers:\n",
"return abort(404)\n",
"return disconnect_handlers[VAR_1]()\n"
] | [
"@blueprint.route('/disconnect/<remote_app>/')...\n",
"\"\"\"docstring\"\"\"\n",
"if remote_app not in disconnect_handlers:\n",
"return abort(404)\n",
"return disconnect_handlers[remote_app]()\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_12(self, VAR_20, VAR_21=False):...\n",
"import shutil\n",
"VAR_38 = self.directory\n",
"os.chdir(VAR_38)\n",
"if not VAR_21 and isdir(VAR_20):\n",
"shutil.rmtree(VAR_20)\n",
"if not isdir(VAR_20):\n",
"os.makedirs(VAR_20)\n",
"VAR_37 = os.environ.copy()\n",
"VAR_37['LC_MESSAGES'] = 'C'\n... | [
"def mirror(self, dst, quick=False):...\n",
"import shutil\n",
"src = self.directory\n",
"os.chdir(src)\n",
"if not quick and isdir(dst):\n",
"shutil.rmtree(dst)\n",
"if not isdir(dst):\n",
"os.makedirs(dst)\n",
"env = os.environ.copy()\n",
"env['LC_MESSAGES'] = 'C'\n",
"dirs = ['.']\n",
"for ... | [
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'",
"Import'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Co... |
[
"def FUNC_5(self):...\n",
"VAR_24 = 'katotest-httplb-' + self.test_id\n",
"self.__use_http_lb_name = VAR_24\n",
"self.__use_http_lb_hc_name = VAR_24 + '-health-check'\n",
"self.__use_http_lb_bs_name = VAR_24 + '-backend-service'\n",
"self.__use_http_lb_fr_name = VAR_24\n",
"self.__use_http_lb_map_name =... | [
"def create_http_load_balancer(self):...\n",
"logical_http_lb_name = 'katotest-httplb-' + self.test_id\n",
"self.__use_http_lb_name = logical_http_lb_name\n",
"self.__use_http_lb_hc_name = logical_http_lb_name + '-health-check'\n",
"self.__use_http_lb_bs_name = logical_http_lb_name + '-backend-service'\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"return self.get_serializer_class().setup_eager_loading(Establishment.\n objects.all())\n"
] | [
"def get_queryset(self):...\n",
"return self.get_serializer_class().setup_eager_loading(Establishment.\n objects.all())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(VAR_0=None, VAR_1=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_0 is None:\n",
"VAR_0 = active_view()\n",
"if not get_settings(VAR_0, 'anaconda_go_linting', True):\n",
"return\n",
"if VAR_0.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n",
"anaconda_sublime.erase_lint_marks(VAR_... | [
"def slow_linters(view=None, hook=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if view is None:\n",
"view = active_view()\n",
"if not get_settings(view, 'anaconda_go_linting', True):\n",
"return\n",
"if view.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n",
"anaconda_sublime.erase_lint_marks(view... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_25(VAR_3):...\n",
"VAR_0, VAR_10 = FUNC_0()\n",
"VAR_18 = \"SELECT adm_token FROM {} WHERE poll_name='{}'\".format(CFG(\n 'admintoken_table_name'), VAR_3)\n",
"VAR_31 = FUNC_3(VAR_10, VAR_18)\n",
"FUNC_1(VAR_0)\n",
"return VAR_31\n"
] | [
"def getAdmToken(poll_name):...\n",
"conn, c = connectDB()\n",
"req = \"SELECT adm_token FROM {} WHERE poll_name='{}'\".format(CFG(\n 'admintoken_table_name'), poll_name)\n",
"admtok = queryOne(c, req)\n",
"closeDB(conn)\n",
"return admtok\n"
] | [
0,
0,
4,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_21(self, VAR_2):...\n",
"VAR_1 = frappe.get_meta(self.doctype)\n",
"if self.order_by:\n",
"VAR_2.order_by = self.order_by\n",
"VAR_2.order_by = ''\n",
"VAR_65 = len(self.fields) == 1 and (self.fields[0].lower().startswith(\n 'count(') or self.fields[0].lower().startswith('min(') or self.field... | [
"def set_order_by(self, args):...\n",
"meta = frappe.get_meta(self.doctype)\n",
"if self.order_by:\n",
"args.order_by = self.order_by\n",
"args.order_by = ''\n",
"group_function_without_group_by = len(self.fields) == 1 and (self.fields[0]\n .lower().startswith('count(') or self.fields[0].lower().starts... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, *VAR_3, **VAR_4):...\n",
"super(CLASS_0, self).__init__(*VAR_3, **kwargs)\n",
"self.common = None\n",
"self.configuration.append_config_values(hpcommon.hp3par_opts)\n",
"self.configuration.append_config_values(san.san_opts)\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super(HP3PARISCSIDriver, self).__init__(*args, **kwargs)\n",
"self.common = None\n",
"self.configuration.append_config_values(hpcommon.hp3par_opts)\n",
"self.configuration.append_config_values(san.san_opts)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(VAR_4, VAR_5, VAR_11):...\n",
"VAR_16 = VAR_5.create_jwt(VAR_1, VAR_0)\n",
"VAR_14 = {'Authorization': 'Bearer ' + VAR_16}\n",
"VAR_12 = '/api/v1/requests/phonetics/' + urllib.parse.quote(VAR_11) + '/*'\n",
"print(VAR_12)\n",
"VAR_17 = VAR_4.get(VAR_12, VAR_14=headers)\n",
"assert VAR_17.sta... | [
"def search(client, jwt, query):...\n",
"token = jwt.create_jwt(claims, token_header)\n",
"headers = {'Authorization': 'Bearer ' + token}\n",
"url = '/api/v1/requests/phonetics/' + urllib.parse.quote(query) + '/*'\n",
"print(url)\n",
"rv = client.get(url, headers=headers)\n",
"assert rv.status_code == 2... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assert'",
"Return'"
] |
[
"def FUNC_14(self, VAR_23, VAR_32):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_23.shape != (4, 4):\n",
"if len(VAR_32) != 2:\n",
"VAR_32 = np.asarray(VAR_32)\n",
"if np.any(VAR_32 < 0) or np.any(VAR_32 >= self.wires) or VAR_32[0] == VAR_32[1\n",
"VAR_9 = np.min(VAR_32)\n",
"VAR_10 = np.max(VAR_32)\n",
... | [
"def expand_two(self, U, wires):...\n",
"\"\"\"docstring\"\"\"\n",
"if U.shape != (4, 4):\n",
"if len(wires) != 2:\n",
"wires = np.asarray(wires)\n",
"if np.any(wires < 0) or np.any(wires >= self.wires) or wires[0] == wires[1]:\n",
"a = np.min(wires)\n",
"b = np.max(wires)\n",
"n_between = b - a - 1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self):...\n",
"super().__init__()\n",
"self.num_tasks = [0]\n",
"self.tasks = []\n"
] | [
"def __init__(self):...\n",
"super().__init__()\n",
"self.num_tasks = [0]\n",
"self.tasks = []\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.