lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(self, VAR_3):...\n",
"VAR_10 = [self.actors[VAR_6] for VAR_6 in self.actors.keys() if \n 'User Controlled' in self.actors[VAR_6].name and self.actors[VAR_6].visible\n ]\n",
"VAR_11 = [user.getPos() for user in VAR_10]\n",
"VAR_12 = []\n",
"VAR_13 = [self.actors[VAR_6] for VAR_6 in self.act... | [
"def computeAI(self, boardObj):...\n",
"users = [self.actors[ID] for ID in self.actors.keys() if 'User Controlled' in\n self.actors[ID].name and self.actors[ID].visible]\n",
"user_locations = [user.getPos() for user in users]\n",
"all_paths = []\n",
"AIs = [self.actors[ID] for ID in self.actors.keys() if... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"For",
"Assign'",
"Expr'",
"Condition",
"For",
"... |
[
"def FUNC_6(VAR_13, VAR_14, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = sql.connect('./resources/comments.db')\n",
"VAR_28 = sql.connect('./resources/messages.db')\n",
"VAR_31 = VAR_28.cursor()\n",
"VAR_32 = VAR_30.cursor()\n",
"if VAR_14 is not None:\n",
"VAR_20 = (\n \"\"\"UPDATE message... | [
"def update_message(message_id, likes, comment):...\n",
"\"\"\"docstring\"\"\"\n",
"comment_con = sql.connect('./resources/comments.db')\n",
"message_con = sql.connect('./resources/messages.db')\n",
"message_cur = message_con.cursor()\n",
"comment_cur = comment_con.cursor()\n",
"if likes is not None:\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Retur... |
[
"def FUNC_6(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = None\n",
"VAR_15 = {}\n",
"def FUNC_17(VAR_4, VAR_1):...\n",
"VAR_38 = 5\n",
"if VAR_4 == 'country_ru' or VAR_4 == 'country_en':\n",
"VAR_52 = users.find_one(VAR_1).language + VAR_4\n",
"VAR_52 = VAR_4\n",
"VAR_39 = VAR_14 + timedelta... | [
"def cache_most_popular_items(func):...\n",
"\"\"\"docstring\"\"\"\n",
"when_was_called = None\n",
"result = {}\n",
"def function_launcher(item_type, message):...\n",
"cache_time = 5\n",
"if item_type == 'country_ru' or item_type == 'country_en':\n",
"result_id = users.find_one(message).language + ite... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Return'"
] |
[
"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_0():...\n",
"VAR_4 = {'TEST_STACK': CLASS_0.DEFAULT_TEST_ID, 'TEST_APP': 'gcpsvrgrptst' +\n CLASS_0.DEFAULT_TEST_ID}\n",
"return st.ScenarioTestRunner.main(CLASS_0, default_binding_overrides=\n defaults, test_case_list=[GoogleServerGroupTest])\n"
] | [
"def main():...\n",
"defaults = {'TEST_STACK': GoogleServerGroupTestScenario.DEFAULT_TEST_ID,\n 'TEST_APP': 'gcpsvrgrptst' + GoogleServerGroupTestScenario.DEFAULT_TEST_ID}\n",
"return st.ScenarioTestRunner.main(GoogleServerGroupTestScenario,\n default_binding_overrides=defaults, test_case_list=[GoogleServ... | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_17):...\n",
"self.cset_id = VAR_17\n",
"self.green = Counter()\n",
"self.orange = Counter()\n",
"self.red = Counter()\n",
"self.blue = Counter()\n"
] | [
"def __init__(self, cset_id):...\n",
"self.cset_id = cset_id\n",
"self.green = Counter()\n",
"self.orange = Counter()\n",
"self.red = Counter()\n",
"self.blue = Counter()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"VAR_1 = self.client.get(url_for('oauthclient.login', remote_app='test'))\n",
"self.assertStatus(VAR_1, 302)\n",
"self.assertEqual(VAR_1.location, \n 'https://foo.bar/oauth/authorize?response_type=code&client_id=testid&redirect_uri=%s'\n % quote_plus(url_for('oauthclient.autho... | [
"def test_login(self):...\n",
"resp = self.client.get(url_for('oauthclient.login', remote_app='test'))\n",
"self.assertStatus(resp, 302)\n",
"self.assertEqual(resp.location, \n 'https://foo.bar/oauth/authorize?response_type=code&client_id=testid&redirect_uri=%s'\n % quote_plus(url_for('oauthclient.auth... | [
0,
5,
0,
5,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"return False\n"
] | [
"@staticmethod...\n",
"return False\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.priority = VAR_77\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.priority = priority\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(VAR_28):...\n",
"VAR_38 = optparse.OptionParser(description=sys.modules[__name__].__doc__)\n",
"VAR_38.add_option('--in-file', help='Name of the request file')\n",
"VAR_38.add_option('--out-file', help=\n 'Name of the JSON file to write a task summary to')\n",
"VAR_38.add_option('--swarming-s... | [
"def main(args):...\n",
"parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)\n",
"parser.add_option('--in-file', help='Name of the request file')\n",
"parser.add_option('--out-file', help=\n 'Name of the JSON file to write a task summary to')\n",
"parser.add_option('--swarming-serve... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
5,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"async def FUNC_2(self) ->None:...\n",
"VAR_1 = self.get_body_argument('lexer')\n",
"VAR_5 = self.get_body_argument('code')\n",
"VAR_6 = self.get_body_argument('expiry')\n",
"if VAR_1 not in utility.list_languages():\n",
"VAR_0.info('Paste.post: a paste was submitted with an invalid lexer')\n",
"if not ... | [
"async def post(self) ->None:...\n",
"lexer = self.get_body_argument('lexer')\n",
"raw = self.get_body_argument('code')\n",
"expiry = self.get_body_argument('expiry')\n",
"if lexer not in utility.list_languages():\n",
"log.info('Paste.post: a paste was submitted with an invalid lexer')\n",
"if not raw:\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_45(VAR_25, VAR_39):...\n",
"if self.parentfield:\n",
"return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(VAR_25.label), VAR_39)\n",
"return '{}: {}'.format(_(VAR_25.label), VAR_39)\n"
] | [
"def get_msg(df, docname):...\n",
"if self.parentfield:\n",
"return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(df.label), docname)\n",
"return '{}: {}'.format(_(df.label), docname)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = \"SELECT rowid FROM tids WHERE tid = '\" + VAR_3 + \"'\"\n",
"self.query(VAR_9)\n",
"return self.c.fetchone()[0]\n"
] | [
"def tid_to_tid_num(self, tid):...\n",
"\"\"\"docstring\"\"\"\n",
"q = \"SELECT rowid FROM tids WHERE tid = '\" + tid + \"'\"\n",
"self.query(q)\n",
"return self.c.fetchone()[0]\n"
] | [
0,
0,
4,
4,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None, VAR_20=''):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11)\n",
"VAR_31 = {'all': 'all.zip', 'geotiff': os.path.join('odm_orthophoto',\n 'odm_orthophoto.tif'), 'las': os.path.join('odm_georeferencing',\n 'odm_... | [
"def get(self, request, pk=None, project_pk=None, asset=''):...\n",
"\"\"\"docstring\"\"\"\n",
"task = self.get_and_check_task(request, pk, project_pk)\n",
"allowed_assets = {'all': 'all.zip', 'geotiff': os.path.join(\n 'odm_orthophoto', 'odm_orthophoto.tif'), 'las': os.path.join(\n 'odm_georeferencing'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __str__(self):...\n",
"return f'Instance of a handler of users. There is {len(self.users)} users in cache right now.'\n"
] | [
"def __str__(self):...\n",
"return f'Instance of a handler of users. There is {len(self.users)} users in cache right now.'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self, VAR_3, VAR_6, VAR_7, VAR_9):...\n",
"VAR_4 = self.iden_reqid_map.get_key(VAR_3)\n",
"if VAR_6 == 0:\n",
"self.iden_reqid_map.del_value(VAR_4, VAR_3)\n",
"VAR_5 = list(VAR_4)\n",
"VAR_5.append(b'')\n",
"VAR_5.extend(make_rep_msg(VAR_3, VAR_6, VAR_7, VAR_9))\n",
"return VAR_5\n"
] | [
"def make_router_rep_msg(self, reqid, seqnum, status, answer):...\n",
"iden = self.iden_reqid_map.get_key(reqid)\n",
"if seqnum == 0:\n",
"self.iden_reqid_map.del_value(iden, reqid)\n",
"msg = list(iden)\n",
"msg.append(b'')\n",
"msg.extend(make_rep_msg(reqid, seqnum, status, answer))\n",
"return msg\... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_4(VAR_21, VAR_22, VAR_23, VAR_24=settings.DEFAULT_SHARDING_KEY):...\n",
"return 'Distributed(%(cluster)s, %(database)s, %(local_table)s, %(sharding_key)s);' % {\n 'cluster': VAR_21, 'database': VAR_22, 'local_table': VAR_23,\n 'sharding_key': VAR_24}\n"
] | [
"def get_distributed_engine(cluster, database, local_table, sharding_key=...\n",
"return 'Distributed(%(cluster)s, %(database)s, %(local_table)s, %(sharding_key)s);' % {\n 'cluster': cluster, 'database': database, 'local_table': local_table,\n 'sharding_key': sharding_key}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_2: HttpRequest, VAR_3: str):...\n",
"\"\"\"docstring\"\"\"\n",
"js_string: str = ''\n",
"VAR_8: GroupReservation = None\n",
"u: Profile = get_current_user(VAR_2)\n",
"VAR_5: str = VAR_3\n",
"if VAR_2.GET.get('redirect'):\n",
"VAR_5 = VAR_2.GET['redirect']\n",
"if 'srid' in VAR_2.GET:... | [
"def manipulate_reservation_action(request: HttpRequest,...\n",
"\"\"\"docstring\"\"\"\n",
"js_string: str = ''\n",
"r: GroupReservation = None\n",
"u: Profile = get_current_user(request)\n",
"forward_url: str = default_foreward_url\n",
"if request.GET.get('redirect'):\n",
"forward_url = request.GET['... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"AnnAssign'",
"AnnAssign'",
"AnnAssign'",
"AnnAssign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Return'",
"AnnAssign'",
"Assign'",
"Condition",
"AnnAssign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Con... |
[
"def FUNC_0(self):...\n",
"return hpcommon.HP3PARCommon(self.configuration)\n"
] | [
"def _init_common(self):...\n",
"return hpcommon.HP3PARCommon(self.configuration)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self, VAR_7):...\n",
"super().set_attributes_from_name(VAR_7)\n",
"self.base_field.set_attributes_from_name(VAR_7)\n"
] | [
"def set_attributes_from_name(self, name):...\n",
"super().set_attributes_from_name(name)\n",
"self.base_field.set_attributes_from_name(name)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@click.command(help='Update from state')...\n",
"if not VAR_16:\n",
"print('This is a dry run. Run with --apply to make the changes.\\n')\n",
"VAR_38 = newrelic.get_state(VAR_0.obj['ACCOUNT'])\n",
"VAR_27 = yaml.load(VAR_17)\n",
"VAR_28 = 0\n",
"for VAR_12 in VAR_27:\n",
"for there_monitor in VAR_38:... | [
"@click.command(help='Update from state')...\n",
"if not apply:\n",
"print('This is a dry run. Run with --apply to make the changes.\\n')\n",
"there_data = newrelic.get_state(ctx.obj['ACCOUNT'])\n",
"here_data = yaml.load(statefile)\n",
"changes = 0\n",
"for monitor in here_data:\n",
"for there_monito... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(VAR_14, VAR_15, VAR_18=True):...\n",
"VAR_26 = 0\n",
"VAR_27 = len(VAR_15)\n",
"for line in VAR_15:\n",
"if len(line) > VAR_26:\n",
"VAR_14 = (VAR_14[0][0] / VAR_26, VAR_14[0][1]) if VAR_14[0] else None, (\n VAR_14[1][0] / VAR_27, VAR_14[1][1]) if VAR_14[1] else None\n",
"VAR_26 = len(lin... | [
"def grid(dims, files, implicitFillWidth=True):...\n",
"x = 0\n",
"y = len(files)\n",
"for line in files:\n",
"if len(line) > x:\n",
"dims = (dims[0][0] / x, dims[0][1]) if dims[0] else None, (dims[1][0] / y,\n dims[1][1]) if dims[1] else None\n",
"x = len(line)\n",
"if not (dims[0] or dims[1]):\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Return'",
"AugAssign'",
"AugAssign'"
] |
[
"def FUNC_1(VAR_2):...\n",
"VAR_4 = f.read()\n",
"def FUNC_16(VAR_1):...\n",
"async def FUNC_15(VAR_3):...\n",
"VAR_19 = await VAR_1(VAR_3, VAR_4)\n",
"return VAR_19\n"
] | [
"def using_base(filename):...\n",
"base = f.read()\n",
"def decorator(func):...\n",
"async def ret(request):...\n",
"out = await func(request, base)\n",
"return out\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"FunctionDef'",
"AsyncFunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_10(VAR_6=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_6:\n",
"conda.ensure_pip_packages(HUB_ENV_PREFIX, VAR_6)\n",
"VAR_18 = pluggy.PluginManager('tljh')\n",
"VAR_18.add_hookspecs(hooks)\n",
"VAR_18.load_setuptools_entrypoints('tljh')\n",
"return VAR_18\n"
] | [
"def setup_plugins(plugins=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if plugins:\n",
"conda.ensure_pip_packages(HUB_ENV_PREFIX, plugins)\n",
"pm = pluggy.PluginManager('tljh')\n",
"pm.add_hookspecs(hooks)\n",
"pm.load_setuptools_entrypoints('tljh')\n",
"return pm\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"super(CLASS_0, self).setUp()\n",
"self.shard = os.environ.get('SHARD')\n",
"self.env_var_override = EnvironmentVarGuard()\n"
] | [
"def setUp(self):...\n",
"super(TestPaverBokChoyCmd, self).setUp()\n",
"self.shard = os.environ.get('SHARD')\n",
"self.env_var_override = EnvironmentVarGuard()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(self):...\n",
"self.objects = load_model_objects()\n"
] | [
"def setUp(self):...\n",
"self.objects = load_model_objects()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"VAR_13 = []\n",
"for n in self.nodes:\n",
"if len(self.get_dependencies(n['node_object'])) < 1:\n",
"return VAR_13\n",
"VAR_13.append(n)\n"
] | [
"def get_leaf_nodes(self):...\n",
"leafs = []\n",
"for n in self.nodes:\n",
"if len(self.get_dependencies(n['node_object'])) < 1:\n",
"return leafs\n",
"leafs.append(n)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"self.run_test_case(self.scenario.create_server_group(), timeout_ok=True)\n"
] | [
"def test_c_create_server_group(self):...\n",
"self.run_test_case(self.scenario.create_server_group(), timeout_ok=True)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_51):...\n",
""
] | [
"def _get_validated_data(self, where):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_10(self):...\n",
"self.run_test_case(self.scenario.upsert_load_balancer(VAR_5=False))\n"
] | [
"def test_b_upsert_load_balancer_public(self):...\n",
"self.run_test_case(self.scenario.upsert_load_balancer(use_vpc=False))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_12, VAR_13=None, VAR_14=200):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_13 is None:\n",
"VAR_13 = {}\n",
"VAR_13['menu_items'] = VAR_6\n",
"VAR_13['is_oss_fuzz'] = utils.is_oss_fuzz()\n",
"VAR_13['is_development'] = environment.is_running_on_app_engine_development()\n",
"VAR_13[... | [
"def render(self, path, values=None, status=200):...\n",
"\"\"\"docstring\"\"\"\n",
"if values is None:\n",
"values = {}\n",
"values['menu_items'] = _MENU_ITEMS\n",
"values['is_oss_fuzz'] = utils.is_oss_fuzz()\n",
"values['is_development'] = environment.is_running_on_app_engine_development()\n",
"valu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_1, VAR_2, VAR_3='TEXT', VAR_7=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = 'TEXT', 'TREE', 'JSON', 'YAML', 'NGTREE'\n",
"if VAR_3 in VAR_11:\n",
"VAR_30 = nglib.config['nglib']['logcmd']\n",
"VAR_31 = nglib.config['nglib']['logurl']\n",
"VAR_32 = nglib.query.net.find_cidr(VAR_1)\n"... | [
"def get_fw_path(src, dst, rtype='TEXT', verbose=True):...\n",
"\"\"\"docstring\"\"\"\n",
"rtypes = 'TEXT', 'TREE', 'JSON', 'YAML', 'NGTREE'\n",
"if rtype in rtypes:\n",
"logcmd = nglib.config['nglib']['logcmd']\n",
"logurl = nglib.config['nglib']['logurl']\n",
"srcnet = nglib.query.net.find_cidr(src)\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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"@VAR_0.route('/authorized/<remote_app>/')...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1 not in handlers:\n",
"return abort(404)\n",
"return handlers[VAR_1]()\n"
] | [
"@blueprint.route('/authorized/<remote_app>/')...\n",
"\"\"\"docstring\"\"\"\n",
"if remote_app not in handlers:\n",
"return abort(404)\n",
"return handlers[remote_app]()\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"@app.route('/people/<user_id>/', methods=['GET'])...\n",
"VAR_11 = User.query.get(int(VAR_0))\n",
"if not VAR_11:\n",
"return redirect(url_for('error404'))\n",
"VAR_4 = VAR_11.name\n",
"VAR_12 = VAR_11.get_articles_writing()\n",
"VAR_13 = VAR_11.get_articles_editing()\n",
"return render_template('peo... | [
"@app.route('/people/<user_id>/', methods=['GET'])...\n",
"user = User.query.get(int(user_id))\n",
"if not user:\n",
"return redirect(url_for('error404'))\n",
"name = user.name\n",
"articles_writing = user.get_articles_writing()\n",
"articles_editing = user.get_articles_editing()\n",
"return render_te... | [
0,
0,
0,
0,
0,
4,
4,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name}\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'access',\n 'delete', '1')\n",
"self.mox.ReplayAll()\n",
"self.driver.terminate_connection(VAR_1,... | [
"def test_terminate_connection(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name}\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'access',\n 'delete', '1')\n",
"self.mox.ReplayAll()\n",
"self.driver.termina... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_3=None):...\n",
"VAR_4 = Flask(__name__)\n",
"VAR_4.config.from_object(app_config[VAR_3])\n",
"VAR_4.config.from_envvar('BENWAONLINE_SETTINGS', silent=True)\n",
"VAR_4.config.from_object('secrets')\n",
"db.init_app(VAR_4)\n",
"VAR_5 = Migrate(VAR_4, db)\n",
"oauth.init_app(VAR_4)\n",
... | [
"def create_app(config=None):...\n",
"app = Flask(__name__)\n",
"app.config.from_object(app_config[config])\n",
"app.config.from_envvar('BENWAONLINE_SETTINGS', silent=True)\n",
"app.config.from_object('secrets')\n",
"db.init_app(app)\n",
"migrate = Migrate(app, db)\n",
"oauth.init_app(app)\n",
"logi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Return'"
] |
[
"def FUNC_24(self):...\n",
"VAR_29 = self.request.body\n",
"if not isinstance(VAR_29, dict) or len(VAR_29.keys()) != 5:\n",
"for filekey in VAR_29.keys():\n",
"if filekey not in [u'body', u'body_len', u'content_type', u'filename',\n",
"return VAR_29\n"
] | [
"def get_uploaded_file(self):...\n",
"uploaded_file = self.request.body\n",
"if not isinstance(uploaded_file, dict) or len(uploaded_file.keys()) != 5:\n",
"for filekey in uploaded_file.keys():\n",
"if filekey not in [u'body', u'body_len', u'content_type', u'filename',\n",
"return uploaded_file\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"For",
"Condition",
"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'"
] |
[
"@api.public...\n",
""
] | [
"@api.public...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"@trial_timeout(20)...\n",
"\"\"\"docstring\"\"\"\n",
"self.messages_to_wait_for = 20\n",
"def FUNC_8(VAR_5):...\n",
"self.session.notifier.notify(NTFY_UPGRADER, NTFY_STARTED, None, None)\n",
"self.session.notifier.notify(NTFY_UPGRADER_TICK, NTFY_STARTED, None, None)\n",
"self.session.notifier.notify(NT... | [
"@trial_timeout(20)...\n",
"\"\"\"docstring\"\"\"\n",
"self.messages_to_wait_for = 20\n",
"def send_notifications(_):...\n",
"self.session.notifier.notify(NTFY_UPGRADER, NTFY_STARTED, None, None)\n",
"self.session.notifier.notify(NTFY_UPGRADER_TICK, NTFY_STARTED, None, None)\n",
"self.session.notifier.n... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"VAR_0 = {}\n",
"\"\"\"Configuration of remote applications.\"\"\"\n",
"VAR_1 = 'oauth_token'\n",
"\"\"\"Session key prefix used when storing the access token for a remote app.\"\"\"\n"
] | [
"\"\"\" Configuration variables for defining remote applications.\n\n================================ ==============================================\n`OAUTHCLIENT_REMOTE_APPS` Dictionary of remote applications. See example\n below. **Default:** ``{}``.\n`OAUTHCLIENT_SESSION_KE... | [
0,
0,
0,
0,
0
] | [
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_28, VAR_27 in zip(self.output, self.rule.output):\n",
"if VAR_28 in self.dynamic_output:\n",
"VAR_29 = self.expand_dynamic(VAR_27, VAR_13=self.wildcards, VAR_14=_IOFile.\n dynamic_fill)\n",
"yield VAR_28\n",
"if not VAR_29:\n",
"yield VAR_27\n",... | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"for f, f_ in zip(self.output, self.rule.output):\n",
"if f in self.dynamic_output:\n",
"expansion = self.expand_dynamic(f_, restriction=self.wildcards, omit_value=\n _IOFile.dynamic_fill)\n",
"yield f\n",
"if not expansion:\n",
"yield f_\n",
"for f, _... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
7
] | [
"Condition",
"Docstring",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'"
] |
[
"@property...\n",
"return self.step.definition if self.step else None\n"
] | [
"@property...\n",
"return self.step.definition if self.step else None\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_69, VAR_63 = self.get('/mails', {'q': [VAR_41], 'w': [str(VAR_40)], 'p':\n [str(VAR_39)]})\n",
"VAR_69 = yield VAR_69\n",
"defer.returnValue([ResponseMail(m) for m in VAR_69['mails']])\n"
] | [
"@defer.inlineCallbacks...\n",
"res, _ = self.get('/mails', {'q': [query], 'w': [str(window)], 'p': [str(\n page)]})\n",
"res = yield res\n",
"defer.returnValue([ResponseMail(m) for m in res['mails']])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(VAR_1):...\n",
"VAR_10 = VAR_1.substr(sublime.Region(0, self.view.size()))\n",
"return VAR_10\n"
] | [
"def get_contents(view):...\n",
"contents = view.substr(sublime.Region(0, self.view.size()))\n",
"return contents\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_7, VAR_8, VAR_9, VAR_10=None, VAR_4=None):...\n",
"GenericRequest.__init__(self, VAR_1, VAR_4)\n",
"self.url = '%stasks/%s/submit' % (self.base_url, VAR_7[1])\n",
"self.task = VAR_7\n",
"self.submission_format = VAR_8\n",
"self.filenames = VAR_9\n",
"self.data = {}\n",
"... | [
"def __init__(self, browser, task, submission_format, filenames, language=...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.url = '%stasks/%s/submit' % (self.base_url, task[1])\n",
"self.task = task\n",
"self.submission_format = submission_format\n",
"self.filenames = filenames\n",
"se... | [
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"async def FUNC_11(VAR_6):...\n",
"VAR_10 = {'Authorization': f'Bearer {VAR_1}'}\n",
"VAR_8 = await VAR_6.get(\"/results?page=0&count=2&filter=date eq '2019-07-15'\",\n VAR_10=headers)\n",
"VAR_9 = await VAR_8.json()\n",
"assert VAR_8.status == 200\n",
"assert len(VAR_9) == 1\n",
"VAR_8 = await VAR_6... | [
"async def test_positive_check_filters(test_cli):...\n",
"headers = {'Authorization': f'Bearer {access_token}'}\n",
"resp = await test_cli.get(\"/results?page=0&count=2&filter=date eq '2019-07-15'\"\n , headers=headers)\n",
"resp_json = await resp.json()\n",
"assert resp.status == 200\n",
"assert len(r... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Assert'",
"Assign'",
"Assign'",
"Assert'",
"Assert'",
"Assign'",
"Assign'",
"Assert'",
"Assert'",
"Assign'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_0(VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = VAR_4.get(VAR_0, VAR_1=sqli)\n",
"while not VAR_8.ok:\n",
"VAR_2.remove('--')\n",
"print(f\"There are {VAR_2.count('NULL')} columns\")\n",
"VAR_2.extend([',', 'NULL', '--'])\n",
"return VAR_2\n",
"VAR_3['category'] = f\"Lifestyle{... | [
"def sqli_union_lab_1(null, sqli):...\n",
"\"\"\"docstring\"\"\"\n",
"lab1 = api_session.get(url, params=sqli)\n",
"while not lab1.ok:\n",
"null.remove('--')\n",
"print(f\"There are {null.count('NULL')} columns\")\n",
"null.extend([',', 'NULL', '--'])\n",
"return null\n",
"sqli['category'] = f\"Life... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_2, VAR_12, VAR_4=None):...\n",
"VAR_62 = [VAR_12.name]\n",
"VAR_63 = ''\n",
"if VAR_12.kind is not None:\n",
"VAR_63 = ' ({})'.format(VAR_12.kind)\n",
"VAR_64 = ''\n",
"VAR_62.insert(0, VAR_12.kind)\n",
"if VAR_12.at is not None:\n",
"VAR_64 = '@' + VAR_12.at\n",
"VAR_65 = ['... | [
"def _call(self, msg, args, errorSink=None):...\n",
"userargs = [args.name]\n",
"kindstr = ''\n",
"if args.kind is not None:\n",
"kindstr = ' ({})'.format(args.kind)\n",
"atstr = ''\n",
"userargs.insert(0, args.kind)\n",
"if args.at is not None:\n",
"atstr = '@' + args.at\n",
"call = ['dig', '+tim... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2():...\n",
"\"\"\"docstring\"\"\"\n",
"return calendar.timegm(time.gmtime())\n"
] | [
"def get_time_now():...\n",
"\"\"\"docstring\"\"\"\n",
"return calendar.timegm(time.gmtime())\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"VAR_9 = {}\n",
"VAR_9['inventory_hostname'] = self.name\n",
"VAR_9['inventory_hostname_short'] = self.name.split('.')[0]\n",
"VAR_9['group_names'] = sorted([VAR_10.name for VAR_10 in self.get_groups() if\n VAR_10.name != 'all'])\n",
"return VAR_9\n"
] | [
"def get_magic_vars(self):...\n",
"results = {}\n",
"results['inventory_hostname'] = self.name\n",
"results['inventory_hostname_short'] = self.name.split('.')[0]\n",
"results['group_names'] = sorted([g.name for g in self.get_groups() if g.\n name != 'all'])\n",
"return results\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_31 = users.get_current_user()\n",
"return CLASS_4(VAR_31.user_id(), VAR_31.email(), None) if VAR_31 else None\n"
] | [
"@staticmethod...\n",
"user = users.get_current_user()\n",
"return CurrentUser(user.user_id(), user.email(), None) if user else None\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"assert escape_literal(\"'\") == \"'\\\\''\"\n",
"assert escape_literal(date(2001, 1, 1)) == \"toDate('2001-01-01')\"\n",
"assert escape_literal(datetime(2001, 1, 1, 1, 1, 1)\n ) == \"toDateTime('2001-01-01T01:01:01')\"\n",
"assert escape_literal([1, 'a', date(2001, 1, 1)]\n ... | [
"def test_escape(self):...\n",
"assert escape_literal(\"'\") == \"'\\\\''\"\n",
"assert escape_literal(date(2001, 1, 1)) == \"toDate('2001-01-01')\"\n",
"assert escape_literal(datetime(2001, 1, 1, 1, 1, 1)\n ) == \"toDateTime('2001-01-01T01:01:01')\"\n",
"assert escape_literal([1, 'a', date(2001, 1, 1)]\... | [
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Assert'",
"Assert'",
"Assert'"
] |
[
"def FUNC_2(self):...\n",
"SQLObjectStore.connect(self)\n",
"if self._autocommit:\n",
"VAR_2 = self._pool\n",
"def FUNC_1(self):...\n",
"VAR_8 = VAR_2.connection\n",
"VAR_3 = self._normalConnection()\n",
"VAR_3.autocommit(True)\n",
"return VAR_3\n"
] | [
"def connect(self):...\n",
"SQLObjectStore.connect(self)\n",
"if self._autocommit:\n",
"pool = self._pool\n",
"def newConnection(self):...\n",
"connection = pool.connection\n",
"conn = self._normalConnection()\n",
"conn.autocommit(True)\n",
"return conn\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"self.ann_id = VAR_6 if VAR_6 else ''\n",
"self._['id'] = self.ann_id\n",
"self._['title'] = self.get_argument('title', '')\n",
"self._['content'] = self.get_argument('content', '')\n",
"self.group = self.get_argument('group', '')\n",
"sel... | [
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"self.ann_id = ann_id if ann_id else ''\n",
"self._['id'] = self.ann_id\n",
"self._['title'] = self.get_argument('title', '')\n",
"self._['content'] = self.get_argument('content', '')\n",
"self.group = self.get_argument('group', '')\n",
"s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Ex... |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_3(self, VAR_4, VAR_1, VAR_2):...\n",
"VAR_5 = (\n \"insert into comments(comment,userid,date,postid) values('%s',%d,current_timestamp(0),%d);\"\n % (VAR_4, VAR_1, VAR_2))\n",
"VAR_6 = sql.insertDB(self.conn, VAR_5)\n",
"return VAR_6\n"
] | [
"def insertData(self, comment, userid, postid):...\n",
"sqlText = (\n \"insert into comments(comment,userid,date,postid) values('%s',%d,current_timestamp(0),%d);\"\n % (comment, userid, postid))\n",
"result = sql.insertDB(self.conn, sqlText)\n",
"return result\n"
] | [
0,
4,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@integration_synonym_api...\n",
"FUNC_2(VAR_2)\n",
"FUNC_3(VAR_2, 'FE', VAR_7='1')\n",
"FUNC_5(VAR_4, VAR_5, VAR_11='FA', VAR_10=[{'name': '----FA'}])\n"
] | [
"@integration_synonym_api...\n",
"clean_database(solr)\n",
"seed_database_with(solr, 'FE', id='1')\n",
"verify_results(client, jwt, query='FA', expected=[{'name': '----FA'}])\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_30():...\n",
"def FUNC_36():...\n",
"yield os.path.join(self.home, 'lib')\n",
"if self.jdk:\n",
"yield os.path.join(self.home, 'jre', 'lib')\n",
"for VAR_1 in VAR_9:\n",
"for VAR_3 in FUNC_36():\n",
"VAR_53 = os.path.join(VAR_3, VAR_1)\n",
"if os.path.exists(VAR_53):\n",
"yield VAR_53\n"... | [
"def collect_existing_libs():...\n",
"def lib_paths():...\n",
"yield os.path.join(self.home, 'lib')\n",
"if self.jdk:\n",
"yield os.path.join(self.home, 'jre', 'lib')\n",
"for name in names:\n",
"for path in lib_paths():\n",
"lib_path = os.path.join(path, name)\n",
"if os.path.exists(lib_path):\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"For",
"For",
"Assign'",
"Condition",
"Expr'"
] |
[
"def __init__(self, VAR_17):...\n",
"self.tokens = iter(VAR_17)\n",
"self.token = None\n",
"self.last = None\n",
"self.next()\n"
] | [
"def __init__(self, tokens):...\n",
"self.tokens = iter(tokens)\n",
"self.token = None\n",
"self.last = None\n",
"self.next()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"self.assertTrue(self.client.login(VAR_1='autotest-1', VAR_2='password'))\n",
"VAR_6 = self.client.get('/api/apps')\n",
"VAR_8 = VAR_6.data['results'][0]['id']\n",
"VAR_5 = '/api/apps/{}/perms'.format(VAR_8)\n",
"VAR_7 = {'username': 'autotest-2'}\n",
"VAR_6 = self.client.post(... | [
"def test_delete(self):...\n",
"self.assertTrue(self.client.login(username='autotest-1', password='password'))\n",
"response = self.client.get('/api/apps')\n",
"app_id = response.data['results'][0]['id']\n",
"url = '/api/apps/{}/perms'.format(app_id)\n",
"body = {'username': 'autotest-2'}\n",
"response ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = request.get_json()\n",
"if not VAR_1['email']:\n",
"return jsonify({'msg': 'Missing email'}), 400\n",
"VAR_2 = database_utilities.execute_query(\n f\"select * from admins where email = '{VAR_1['email']}'\")\n",
"if VAR_2:\n",
"VAR_6 = VA... | [
"def post(self):...\n",
"\"\"\"docstring\"\"\"\n",
"json_data = request.get_json()\n",
"if not json_data['email']:\n",
"return jsonify({'msg': 'Missing email'}), 400\n",
"data = database_utilities.execute_query(\n f\"select * from admins where email = '{json_data['email']}'\")\n",
"if data:\n",
"em... | [
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@staticmethod...\n",
"return os.path.join(lore.env.root, lore.env.project, 'extracts', VAR_18 +\n VAR_19)\n"
] | [
"@staticmethod...\n",
"return os.path.join(lore.env.root, lore.env.project, 'extracts', filename +\n extension)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_52(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = next(x for x in self.b_mgr.b_ts.tests['ExceptHandler'] if x.\n __name__ == 'try_except_pass')\n",
"VAR_9._config = {'check_typed_exception': True}\n",
"VAR_2 = {'SEVERITY': {'LOW': 3}, 'CONFIDENCE': {'HIGH': 3}}\n",
"self.check_example('try... | [
"def test_try_except_pass(self):...\n",
"\"\"\"docstring\"\"\"\n",
"test = next(x for x in self.b_mgr.b_ts.tests['ExceptHandler'] if x.__name__ ==\n 'try_except_pass')\n",
"test._config = {'check_typed_exception': True}\n",
"expect = {'SEVERITY': {'LOW': 3}, 'CONFIDENCE': {'HIGH': 3}}\n",
"self.check_e... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"if not VAR_1 or not VAR_7 or not VAR_6:\n",
"if not VAR_5:\n",
"VAR_5 = CLASS_0.get_report(VAR_1)['analysis']\n",
"VAR_16 = VAR_5['behavior']['generic']\n",
"VAR_17 = [z for z in VAR_16 if z['pid'] == VAR_6]\n",
"if not VAR_17:\n",
"VAR_17 = VAR_17[0]\n",
"VAR_18 = VAR_17['sum... | [
"@staticmethod...\n",
"if not task_id or not watcher or not pid:\n",
"if not report:\n",
"report = AnalysisController.get_report(task_id)['analysis']\n",
"behavior_generic = report['behavior']['generic']\n",
"process = [z for z in behavior_generic if z['pid'] == pid]\n",
"if not process:\n",
"process ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"import pymysql\n",
"from db_connect import *\n",
"from query_functions import *\n",
"def FUNC_0():...\n",
"print('\\nQuery options:')\n",
"print('1: List ETCs in the country __ having more than __ open beds.')\n",
"print(\n '2: List average age & education of respondents whose sex=__ and live in _... | [
"import pymysql\n",
"from db_connect import *\n",
"from query_functions import *\n",
"def print_menu():...\n",
"print('\\nQuery options:')\n",
"print('1: List ETCs in the country __ having more than __ open beds.')\n",
"print(\n '2: List average age & education of respondents whose sex=__ and live ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'"... |
[
"def FUNC_2(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = ray.gcs_utils.TablePrefix_RAYLET_TASK_string.encode('ascii')\n",
"VAR_18 = ray.gcs_utils.TablePrefix_OBJECT_string.encode('ascii')\n",
"VAR_19 = self.state.task_table()\n",
"VAR_20 = binary_to_hex(VAR_8)\n",
"VAR_21 = set()\n",
"for... | [
"def _xray_clean_up_entries_for_driver(self, driver_id):...\n",
"\"\"\"docstring\"\"\"\n",
"xray_task_table_prefix = ray.gcs_utils.TablePrefix_RAYLET_TASK_string.encode(\n 'ascii')\n",
"xray_object_table_prefix = ray.gcs_utils.TablePrefix_OBJECT_string.encode(\n 'ascii')\n",
"task_table_objects = self... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Expr'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_12, VAR_13, VAR_14=None):...\n",
"\"\"\"docstring\"\"\"\n",
"assert VAR_14 is None or (VAR_13 is None or VAR_14 >= VAR_23(VAR_13))\n",
"if VAR_14:\n",
"VAR_37 = 'create table t1(s %s(%s))' % (VAR_12, VAR_14)\n",
"VAR_37 = 'create table t1(s %s)' % VAR_12\n",
"self.cursor.execute(V... | [
"def _test_strtype(self, sqltype, value, colsize=None):...\n",
"\"\"\"docstring\"\"\"\n",
"assert colsize is None or (value is None or colsize >= len(value))\n",
"if colsize:\n",
"sql = 'create table t1(s %s(%s))' % (sqltype, colsize)\n",
"sql = 'create table t1(s %s)' % sqltype\n",
"self.cursor.execute... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assert'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_3):...\n",
"VAR_11 = []\n",
"VAR_12 = []\n",
"VAR_13 = []\n",
"VAR_25 = VAR_3.index('--')\n",
"VAR_13 = []\n",
"VAR_13 = VAR_3[VAR_25 + 1:]\n",
"for VAR_26 in VAR_3:\n",
"VAR_3 = VAR_3[:VAR_25]\n",
"if VAR_26 == '-h' or VAR_26 == '--help':\n",
"VAR_15 = False\n",
"return VAR_3,... | [
"def _group_args(argv):...\n",
"supported = []\n",
"pydevd = []\n",
"script = []\n",
"pos = argv.index('--')\n",
"script = []\n",
"script = argv[pos + 1:]\n",
"for arg in argv:\n",
"argv = argv[:pos]\n",
"if arg == '-h' or arg == '--help':\n",
"gottarget = False\n",
"return argv, [], script\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,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"For",
"Condition",
"Return'",
"AugAssign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'"... |
[
"@property...\n",
"return self.exists and not os.access(self.file, os.W_OK)\n"
] | [
"@property...\n",
"return self.exists and not os.access(self.file, os.W_OK)\n"
] | [
0,
7
] | [
"Condition",
"Return'"
] |
[
"def FUNC_41():...\n",
"self.listenTCP(VAR_22, VAR_23)\n",
"reactor.run()\n"
] | [
"def _start():...\n",
"self.listenTCP(port, host)\n",
"reactor.run()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_10):...\n",
"VAR_31 = VAR_10.find('[')\n",
"VAR_32 = VAR_10.find('\\n', VAR_31)\n",
"VAR_33 = VAR_10.find(' ', VAR_31) + 1 or VAR_32\n",
"VAR_34 = VAR_10[VAR_31 + 1:VAR_33].strip()\n",
"if len(VAR_34) > 0:\n",
"if VAR_34[0] == '.':\n",
"super(CLASS_2, self).__init__(slideParser... | [
"def __init__(self, txt):...\n",
"headBegin = txt.find('[')\n",
"headEnd = txt.find('\\n', headBegin)\n",
"headSplit = txt.find(' ', headBegin) + 1 or headEnd\n",
"opts = txt[headBegin + 1:headSplit].strip()\n",
"if len(opts) > 0:\n",
"if opts[0] == '.':\n",
"super(Slide, self).__init__(slideParser.pa... | [
0,
2,
2,
2,
2,
0,
0,
2,
0,
2,
0,
2,
0,
2,
0,
0,
2,
2
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5(VAR_11, VAR_1, VAR_3, VAR_4):...\n",
"VAR_12 = []\n",
"for VAR_15 in range(VAR_11[1]):\n",
"VAR_29 = VAR_1.pop()\n",
"if VAR_12[0] > 0 and VAR_12[1] > 0:\n",
"if VAR_29 >= 0:\n",
"if len(VAR_12) == 3 and VAR_12[2] < 0:\n",
"VAR_30 = VAR_14[VAR_11[0]]\n",
"VAR_12.insert(0, int(VAR_29, 16)... | [
"def handleArithOps(item, stack, symbols, symId):...\n",
"params = []\n",
"for i in range(item[1]):\n",
"p = stack.pop()\n",
"if params[0] > 0 and params[1] > 0:\n",
"if p >= 0:\n",
"if len(params) == 3 and params[2] < 0:\n",
"func = arithMapSym[item[0]]\n",
"params.insert(0, int(p, 16))\n",
"para... | [
0,
0,
0,
0,
1,
0,
0,
0,
1,
1,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_20(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_65 = 0\n",
"if self.execute('SELECT sum(bytes) FROM history'):\n",
"VAR_66 = int(this_month(time.time()))\n",
"VAR_65 = self.c.fetchone().get('sum(bytes)')\n",
"VAR_67 = 0\n",
"if self.execute('SELECT sum(bytes) FROM history WHERE \"completed\... | [
"def get_history_size(self):...\n",
"\"\"\"docstring\"\"\"\n",
"total = 0\n",
"if self.execute('SELECT sum(bytes) FROM history'):\n",
"month_timest = int(this_month(time.time()))\n",
"total = self.c.fetchone().get('sum(bytes)')\n",
"month = 0\n",
"if self.execute('SELECT sum(bytes) FROM history WHERE ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_14(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = self.session.query(self.resource_type).get(VAR_9)\n",
"if VAR_19 is None:\n",
"for attribute, value in self.data.items():\n",
"setattr(VAR_19, attribute, value)\n",
"self.session.add(VAR_19)\n",
"return VAR_19\n"
] | [
"def update(self, model_id):...\n",
"\"\"\"docstring\"\"\"\n",
"model = self.session.query(self.resource_type).get(model_id)\n",
"if model is None:\n",
"for attribute, value in self.data.items():\n",
"setattr(model, attribute, value)\n",
"self.session.add(model)\n",
"return model\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"For",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"VAR_31 = c.get('/saml2-metadata')\n",
"self.assertEqual(VAR_31.status, '200 OK')\n"
] | [
"def test_metadataview(self):...\n",
"response = c.get('/saml2-metadata')\n",
"self.assertEqual(response.status, '200 OK')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_1):...\n",
"VAR_15 = self.session.get(VAR_1)\n",
"for cookie in VAR_15.cookies:\n",
"if cookie.name == '_xsrf':\n",
"self.xsrf_token = cookie.value\n"
] | [
"def read_xsrf_token(self, url):...\n",
"response = self.session.get(url)\n",
"for cookie in response.cookies:\n",
"if cookie.name == '_xsrf':\n",
"self.xsrf_token = cookie.value\n"
] | [
0,
5,
5,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Assign'"
] |
[
"def FUNC_8(self):...\n",
"self.uut.executable = 'echo'\n",
"self.uut.config_file = lambda : ['config line1']\n",
"VAR_6 = self.uut.generate_config_file()\n",
"self.assertTrue(os.path.isfile(VAR_6))\n",
"os.remove(VAR_6)\n",
"self.uut.lint('filename')\n"
] | [
"def test_config_file_generator(self):...\n",
"self.uut.executable = 'echo'\n",
"self.uut.config_file = lambda : ['config line1']\n",
"config_filename = self.uut.generate_config_file()\n",
"self.assertTrue(os.path.isfile(config_filename))\n",
"os.remove(config_filename)\n",
"self.uut.lint('filename')\n"... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"async def FUNC_15(*VAR_8, **VAR_9):...\n",
"if time.time() - VAR_10[1] > FUNC_3.timeout:\n",
"VAR_10[0] = await VAR_1(*VAR_8, **kwargs)\n",
"return VAR_10[0]\n",
"VAR_10[1] = time.time()\n"
] | [
"async def ret(*args, **kwargs):...\n",
"if time.time() - cache[1] > cache_page.timeout:\n",
"cache[0] = await func(*args, **kwargs)\n",
"return cache[0]\n",
"cache[1] = time.time()\n"
] | [
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def _prepare(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_0(VAR_2, VAR_3):...\n",
"print('Quantizing model')\n",
"VAR_5 = tf.contrib.lite.TocoConverter.from_saved_model(VAR_2)\n",
"VAR_5.post_training_quantize = True\n",
"VAR_6 = VAR_5.convert()\n",
"open(VAR_3 + '.tflite', 'wb').write(VAR_6)\n"
] | [
"def QuantizeModel(model_path, output_file_name):...\n",
"print('Quantizing model')\n",
"converter = tf.contrib.lite.TocoConverter.from_saved_model(model_path)\n",
"converter.post_training_quantize = True\n",
"quant_model = converter.convert()\n",
"open(output_file_name + '.tflite', 'wb').write(quant_mode... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = 'DELETE FROM crimes;'\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"VAR_2.commit()\n"
] | [
"def clear_all(self):...\n",
"connection = self.connect()\n",
"query = 'DELETE FROM crimes;'\n",
"connection.close()\n",
"cursor.execute(query)\n",
"connection.commit()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import argparse\n",
"import ast\n",
"import io\n",
"import os\n",
"import sys\n",
"import threading\n",
"import random\n",
"import time\n",
"from cms import conf... | [
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import argparse\n",
"import ast\n",
"import io\n",
"import os\n",
"import sys\n",
"import threading\n",
"import random\n",
"import time\n",
"from cms import conf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",... |
[
"def __init__(self):...\n",
"self.selected_fields = defaultdict(self.__class__)\n",
"self.is_subquery = False\n"
] | [
"def __init__(self):...\n",
"self.selected_fields = defaultdict(self.__class__)\n",
"self.is_subquery = False\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"@VAR_2.route('/placings')...\n",
"if VAR_0 == None:\n",
"FUNC_16()\n",
"VAR_5 = request.args.get('tag', default='christmas mike')\n",
"VAR_8 = \"SELECT * FROM placings WHERE player = '{}'\".format(VAR_5)\n",
"VAR_31 = list(VAR_0.exec(VAR_8))\n",
"VAR_31.sort(key=lambda x: int(x[2]))\n",
"return json.... | [
"@endpoints.route('/placings')...\n",
"if db == None:\n",
"init()\n",
"tag = request.args.get('tag', default='christmas mike')\n",
"sql = \"SELECT * FROM placings WHERE player = '{}'\".format(tag)\n",
"results = list(db.exec(sql))\n",
"results.sort(key=lambda x: int(x[2]))\n",
"return json.dumps(resul... | [
0,
0,
0,
0,
4,
4,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_31(VAR_1, VAR_16):...\n",
"VAR_30 = VAR_1.xsrf_token_data == {'some': 'data'}\n",
"VAR_12.append((VAR_16, VAR_30))\n"
] | [
"def record(request_handler, method):...\n",
"is_valid = request_handler.xsrf_token_data == {'some': 'data'}\n",
"calls.append((method, is_valid))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"VAR_1 = self.client.get(f'/qa/chemicalpresence/')\n",
"self.assertIn(f\"/qa/chemicalpresencegroup/49/'> View Chemical Presence Lists\"\n .encode(), VAR_1.content)\n",
"VAR_1 = self.client.get(f'/qa/chemicalpresencegroup/49', follow=True)\n",
"self.assertIn(f'/qa/extractedtext/2... | [
"def test_cpcat_qa(self):...\n",
"response = self.client.get(f'/qa/chemicalpresence/')\n",
"self.assertIn(f\"/qa/chemicalpresencegroup/49/'> View Chemical Presence Lists\"\n .encode(), response.content)\n",
"response = self.client.get(f'/qa/chemicalpresencegroup/49', follow=True)\n",
"self.assertIn(f'/qa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"self.skipTest('Revist')\n",
"VAR_10 = mocks.MockRequestSessionApi()\n",
"VAR_11 = mock.Mock()\n",
"VAR_11.provider.url = 'https://1.2.3.4'\n",
"VAR_7 = cluster.NSXRequestsHTTPProvider()\n",
"self.assertRaises(nsxlib_exc.ResourceNotFound, VAR_7.validate_connection,\n mock.Mo... | [
"def test_validate_connection(self):...\n",
"self.skipTest('Revist')\n",
"mock_conn = mocks.MockRequestSessionApi()\n",
"mock_ep = mock.Mock()\n",
"mock_ep.provider.url = 'https://1.2.3.4'\n",
"provider = cluster.NSXRequestsHTTPProvider()\n",
"self.assertRaises(nsxlib_exc.ResourceNotFound, provider.vali... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_30(self):...\n",
"VAR_2 = FUNC_0(self.file\n ).st_mode & ~stat.S_IWUSR & ~stat.S_IWGRP & ~stat.S_IWOTH\n",
"if os.path.isdir(self.file):\n",
"for root, dirs, VAR_6 in os.walk(self.file):\n",
"FUNC_2(self.file, VAR_2)\n",
"for d in dirs:\n",
"FUNC_2(os.path.join(self.file, d), VAR_2)\n",
"... | [
"def protect(self):...\n",
"mode = lstat(self.file).st_mode & ~stat.S_IWUSR & ~stat.S_IWGRP & ~stat.S_IWOTH\n",
"if os.path.isdir(self.file):\n",
"for root, dirs, files in os.walk(self.file):\n",
"lchmod(self.file, mode)\n",
"for d in dirs:\n",
"lchmod(os.path.join(self.file, d), mode)\n",
"for f in f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"For",
"Expr'",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.input = VAR_69, VAR_70\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.input = paths, kwpaths\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_8):...\n",
"self.spdx = VAR_8\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.lexer = lex.lex(module=self, reflags=re.UNICODE)\n",
"self.parser = yacc.yacc(module=self, write_tables=False, debug=False)\n",
"self.lines_checked = 0\n",
"self.checked = 0\n",
"self.spd... | [
"def __init__(self, spdx):...\n",
"self.spdx = spdx\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.lexer = lex.lex(module=self, reflags=re.UNICODE)\n",
"self.parser = yacc.yacc(module=self, write_tables=False, debug=False)\n",
"self.lines_checked = 0\n",
"self.checked = 0\n",
"self.spdx_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5(self, VAR_5):...\n",
"if VAR_5 in self.groups:\n",
"self.groups.remove(VAR_5)\n",
"for oldg in VAR_5.get_ancestors():\n",
"if oldg.name != 'all':\n",
"for childg in self.groups:\n",
"if oldg in childg.get_ancestors():\n"
] | [
"def remove_group(self, group):...\n",
"if group in self.groups:\n",
"self.groups.remove(group)\n",
"for oldg in group.get_ancestors():\n",
"if oldg.name != 'all':\n",
"for childg in self.groups:\n",
"if oldg in childg.get_ancestors():\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"For",
"Condition",
"For",
"Condition"
] |
[
"def __init__(self, VAR_3, VAR_4, VAR_5=None, VAR_6=None):...\n",
"self.rule = VAR_3\n",
"self.dag = VAR_4\n",
"self.targetfile = VAR_5\n",
"self.wildcards_dict = self.rule.get_wildcards(VAR_5)\n",
"self.wildcards = Wildcards(fromdict=self.wildcards_dict)\n",
"self._format_wildcards = self.wildcards if ... | [
"def __init__(self, rule, dag, targetfile=None, format_wildcards=None):...\n",
"self.rule = rule\n",
"self.dag = dag\n",
"self.targetfile = targetfile\n",
"self.wildcards_dict = self.rule.get_wildcards(targetfile)\n",
"self.wildcards = Wildcards(fromdict=self.wildcards_dict)\n",
"self._format_wildcards ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Cond... |
[
"def FUNC_7(self, VAR_13):...\n",
"VAR_3 = VAR_13.split()\n",
"VAR_27 = self.yml\n",
"for subkey in VAR_3:\n",
"VAR_27 = VAR_27[subkey]\n",
"return VAR_27\n"
] | [
"def _cfg(self, yamlkeys_str):...\n",
"yamlkeys = yamlkeys_str.split()\n",
"yamlval = self.yml\n",
"for subkey in yamlkeys:\n",
"yamlval = yamlval[subkey]\n",
"return yamlval\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/signup/<remote_app>/', methods=['GET', 'POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1 not in signup_handlers:\n",
"return abort(404)\n",
"VAR_3 = signup_handlers[VAR_1]['view']()\n",
"return abort(404) if VAR_3 is None else VAR_3\n"
] | [
"@blueprint.route('/signup/<remote_app>/', methods=['GET', 'POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"if remote_app not in signup_handlers:\n",
"return abort(404)\n",
"res = signup_handlers[remote_app]['view']()\n",
"return abort(404) if res is None else res\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertEqual(FUNC_1(), 0)\n"
] | [
"def test_drop_database_tables_if_exist(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertEqual(drop(), 0)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_13(self, VAR_21='text/plain', VAR_22=200):...\n",
"self.send_response(VAR_22)\n",
"self.send_header('Content-Type', VAR_21)\n",
"self.end_headers()\n"
] | [
"def _WriteHeader(self, content_type='text/plain', status_code=200):...\n",
"self.send_response(status_code)\n",
"self.send_header('Content-Type', content_type)\n",
"self.end_headers()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"import geopandas as gpd\n",
"VAR_49 = gpd.read_file(self.subdomains_fn)\n",
"self.names_dict = dict(zip(VAR_49[self.id_field], VAR_49[self.name_field]))\n"
] | [
"def _get_subdomains_dict(self):...\n",
"import geopandas as gpd\n",
"gdf = gpd.read_file(self.subdomains_fn)\n",
"self.names_dict = dict(zip(gdf[self.id_field], gdf[self.name_field]))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0():...\n",
"VAR_19 = sys.path[0]\n",
"VAR_19 = VAR_19.split('/')[-1]\n",
"return sys.path[0] if VAR_19 == 'app' else os.path.dirname(sys.path[0])\n"
] | [
"def get_app_dir():...\n",
"d = sys.path[0]\n",
"d = d.split('/')[-1]\n",
"return sys.path[0] if d == 'app' else os.path.dirname(sys.path[0])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.