lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"@FUNC_7...\n",
"\"\"\"docstring\"\"\"\n",
"if not current_user.is_authenticated():\n",
"return current_app.login_manager.unauthorized()\n",
"VAR_20 = RemoteAccount.get(user_id=current_user.get_id(), client_id=remote.\n consumer_key)\n",
"if VAR_20:\n",
"VAR_20.delete()\n",
"return redirect(url_for... | [
"@oauth_error_handler...\n",
"\"\"\"docstring\"\"\"\n",
"if not current_user.is_authenticated():\n",
"return current_app.login_manager.unauthorized()\n",
"account = RemoteAccount.get(user_id=current_user.get_id(), client_id=remote\n .consumer_key)\n",
"if account:\n",
"account.delete()\n",
"return ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"self.handled_resp = 1\n",
"self.handled_remote = 1\n",
"self.handled_args = 1\n",
"self.handled_kwargs = 1\n"
] | [
"def handler_invalid(self):...\n",
"self.handled_resp = 1\n",
"self.handled_remote = 1\n",
"self.handled_args = 1\n",
"self.handled_kwargs = 1\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"self.object.run()\n",
"return '/threat_hunter'\n"
] | [
"def get_success_url(self):...\n",
"self.object.run()\n",
"return '/threat_hunter'\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_16(self):...\n",
"self.run_test_case(self.scenario.destroy_server_group('v000'))\n"
] | [
"def test_g_destroy_server_group_v000(self):...\n",
"self.run_test_case(self.scenario.destroy_server_group('v000'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return import_from_settings('LOGOUT_REDIRECT_URL', '/')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return import_from_settings('LOGOUT_REDIRECT_URL', '/')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
"def test_a_create_app(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"import os\n",
"import sys\n",
"import threading\n",
"import traceback\n",
"import types\n",
"from importlib.abc import InspectLoader\n",
"from cauldron import environ\n",
"from cauldron import templating\n",
"from cauldron.cli import threads\n",
"from cauldron.runner import redirection\n",
"fro... | [
"import os\n",
"import sys\n",
"import threading\n",
"import traceback\n",
"import types\n",
"from importlib.abc import InspectLoader\n",
"from cauldron import environ\n",
"from cauldron import templating\n",
"from cauldron.cli import threads\n",
"from cauldron.runner import redirection\n",
"fro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"As... |
[
"def FUNC_3(self, VAR_7):...\n",
"VAR_11 = VAR_7[0]\n",
"VAR_12 = VAR_7[1]\n",
"VAR_13 = self.G.nodes(1)[VAR_11][1]['keys']\n",
"VAR_14 = self.G.nodes(1)[VAR_12][1]['keys']\n",
"VAR_15 = VAR_13.intersection(VAR_14)\n",
"VAR_16 = set()\n",
"VAR_17 = 0\n",
"while not VAR_15.issubset(VAR_16):\n",
"VA... | [
"def calcLKVM(self, edge):...\n",
"i = edge[0]\n",
"j = edge[1]\n",
"iKeys = self.G.nodes(1)[i][1]['keys']\n",
"jKeys = self.G.nodes(1)[j][1]['keys']\n",
"sharedKeys = iKeys.intersection(jKeys)\n",
"c = set()\n",
"lkvm = 0\n",
"while not sharedKeys.issubset(c):\n",
"randNodeIndex = random.randint(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_3(VAR_3, VAR_6):...\n",
"VAR_2 = FUNC_2(VAR_3, 'rank', VAR_0)\n",
"VAR_11 = VAR_2[0][0]\n",
"VAR_12 = FUNC_0(\"SELECT {} FROM {} WHERE FUNCTION = '{}';\".format(VAR_11,\n VAR_1, VAR_6))\n",
"if VAR_12[0][0] == True:\n",
"return True\n",
"return False\n"
] | [
"def rank_check(id, function):...\n",
"query = check(id, 'rank', user_table)\n",
"rank = query[0][0]\n",
"query2 = fetch(\"SELECT {} FROM {} WHERE FUNCTION = '{}';\".format(rank,\n rank_permit_table, function))\n",
"if query2[0][0] == True:\n",
"return True\n",
"return False\n"
] | [
0,
4,
4,
4,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(VAR_7, VAR_15):...\n",
"VAR_9 = VAR_7.find_where({'window_name': VAR_15})\n",
"return VAR_9\n"
] | [
"def find_window(session, window_name):...\n",
"window = session.find_where({'window_name': window_name})\n",
"return window\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"import hashlib\n",
"import os\n",
"import pandas as pd\n",
"def FUNC_0(VAR_0, VAR_1, **VAR_2):...\n",
"VAR_6 = '{}/{}?'.format(VAR_0, VAR_1)\n",
"VAR_7 = sorted(VAR_2.keys())\n",
"for key in VAR_7:\n",
"VAR_6 += '{}={}&'.format(key, VAR_2[key])\n",
"return hashlib.sha224(VAR_6.encode('utf8')).hexdi... | [
"import hashlib\n",
"import os\n",
"import pandas as pd\n",
"def query_hash(project_id, query_name, **query_params):...\n",
"id_string = '{}/{}?'.format(project_id, query_name)\n",
"keylist = sorted(query_params.keys())\n",
"for key in keylist:\n",
"id_string += '{}={}&'.format(key, query_params[key])... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_1 = 'http://my.url.com'\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(VAR_1), timeout=mox.IgnoreArg()\n ).AndReturn(StringIO.StringIO(VAR_2))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(url_helper.UrlOpen(VAR_1, method='GET'), VAR_2)\n",
"self... | [
"def testUrlOpenGETSuccess(self):...\n",
"url = 'http://my.url.com'\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(url), timeout=mox.IgnoreArg()\n ).AndReturn(StringIO.StringIO(response))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(url_helper.UrlOpen(url, method='GET'), res... | [
0,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@commands.command(aliases=['stock115', 'stock'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = discord.Embed(VAR_2='Running stock (unmodified) 11.4+ firmware?',\n VAR_3=discord.Color.dark_orange())\n",
"VAR_7.description = 'string'\n",
"await self.bot.say('', VAR_7=embed)\n"
] | [
"@commands.command(aliases=['stock115', 'stock'])...\n",
"\"\"\"docstring\"\"\"\n",
"embed = discord.Embed(title='Running stock (unmodified) 11.4+ firmware?',\n color=discord.Color.dark_orange())\n",
"embed.description = \"\"\"You have 3 possible options for installing CFW:\n- [NTRBoot](https://3ds.guide/n... | [
0,
0,
0,
2,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"VAR_13 = VAR_0.path.dirname(VAR_0.path.abspath(__file__))\n",
"return VAR_0.path.join(VAR_13, 'server/ycmd.py')\n"
] | [
"def _PathToServerScript():...\n",
"dir_of_current_script = os.path.dirname(os.path.abspath(__file__))\n",
"return os.path.join(dir_of_current_script, 'server/ycmd.py')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self, VAR_18, VAR_11, VAR_19, VAR_20, VAR_21, VAR_22, VAR_23,...\n",
"VAR_28 = (VAR_18.classes_dir,) + tuple(ce.path for ce in VAR_19)\n",
"if self.get_options().capture_classpath:\n",
"self._record_compile_classpath(VAR_28, VAR_18.target, VAR_18.classes_dir)\n",
"VAR_36 = JvmPlatform.preferred... | [
"def compile(self, ctx, args, dependency_classpath, upstream_analysis,...\n",
"classpath = (ctx.classes_dir,) + tuple(ce.path for ce in dependency_classpath)\n",
"if self.get_options().capture_classpath:\n",
"self._record_compile_classpath(classpath, ctx.target, ctx.classes_dir)\n",
"distribution = JvmPlatf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'"... |
[
"def FUNC_5(self, VAR_0, VAR_1):...\n",
""
] | [
"def del_sig_handler(self, interface, method):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@property...\n",
"if self._snakefile is None:\n",
"return os.path.abspath(os.path.join(self.workdir, 'Snakefile'))\n",
"if not os.path.isabs(self._snakefile):\n",
"return os.path.abspath(os.path.join(self.workflow.basedir, self._snakefile))\n",
"return self._snakefile\n"
] | [
"@property...\n",
"if self._snakefile is None:\n",
"return os.path.abspath(os.path.join(self.workdir, 'Snakefile'))\n",
"if not os.path.isabs(self._snakefile):\n",
"return os.path.abspath(os.path.join(self.workflow.basedir, self._snakefile))\n",
"return self._snakefile\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_16(self):...\n",
"VAR_7 = Pa11yCrawler('')\n",
"VAR_7.get_test_course()\n",
"self._mock_sh.assert_has_calls([call(\n 'wget {targz} -O {dir}demo_course.tar.gz'.format(targz=suite.\n tar_gz_file, dir=suite.imports_dir)), call(\n 'tar zxf {dir}demo_course.tar.gz -C {dir}'.format(dir=suite.impo... | [
"def test_get_test_course(self):...\n",
"suite = Pa11yCrawler('')\n",
"suite.get_test_course()\n",
"self._mock_sh.assert_has_calls([call(\n 'wget {targz} -O {dir}demo_course.tar.gz'.format(targz=suite.\n tar_gz_file, dir=suite.imports_dir)), call(\n 'tar zxf {dir}demo_course.tar.gz -C {dir}'.format(d... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"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_3(self, VAR_3, VAR_4):...\n",
""
] | [
"def retrieveLastInsertId(self, conn, cur):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_39 = {re.compile(p): v for p, v in VAR_9.items()}\n",
"def FUNC_35(VAR_40):...\n",
"VAR_68 = VAR_10[VAR_40]\n",
"for pattern, has_argument in VAR_39.items():\n",
"if pattern.match(VAR_68):\n",
"VAR_8.warn(\n \"Zinc argument '{}' is not supported... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"valid_patterns = {re.compile(p): v for p, v in whitelisted_args.items()}\n",
"def validate(idx):...\n",
"arg = args[idx]\n",
"for pattern, has_argument in valid_patterns.items():\n",
"if pattern.match(arg):\n",
"log.warn(\n \"Zinc argument '{}' is n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_12():...\n",
"VAR_18 = requests.get(FUNC_2('healthy'))\n",
"VAR_18.raise_for_status()\n",
"return VAR_18.json()\n"
] | [
"def _ServerIsHealthy():...\n",
"response = requests.get(_BuildUri('healthy'))\n",
"response.raise_for_status()\n",
"return response.json()\n"
] | [
0,
7,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"if not self.campaign['id']:\n",
"self.cursor.execute('SELECT * FROM log_campaign ORDER BY id DESC LIMIT 1')\n",
"if self.campaign['id'] == '*':\n",
"return self.cursor.fetchone()\n",
"self.cursor.execute('SELECT * FROM log_campaign ORDER BY id')\n",
"self.cursor.execute('SELEC... | [
"def get_campaign(self):...\n",
"if not self.campaign['id']:\n",
"self.cursor.execute('SELECT * FROM log_campaign ORDER BY id DESC LIMIT 1')\n",
"if self.campaign['id'] == '*':\n",
"return self.cursor.fetchone()\n",
"self.cursor.execute('SELECT * FROM log_campaign ORDER BY id')\n",
"self.cursor.execute(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"@VAR_1.route(VAR_0 + '/create', methods=['GET'])...\n",
"return ujson.dumps({'success': True})\n"
] | [
"@thread.route(BASE_URL + '/create', methods=['GET'])...\n",
"return ujson.dumps({'success': True})\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"VAR_1 = '/api/apps'\n",
"VAR_2 = self.client.post(VAR_1)\n",
"self.assertEqual(VAR_2.status_code, 201)\n",
"VAR_3 = VAR_2.data['id']\n",
"VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d... | [
"def test_config_chaos(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}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_6(self, VAR_8=None):...\n",
"if self.closed:\n",
"if self._session is None:\n",
"if VAR_8 is None:\n",
"VAR_8 = self._adapter\n",
"assert VAR_8 is not None\n",
"if not self._session.is_client:\n",
"self._detach()\n"
] | [
"def detach(self, adapter=None):...\n",
"if self.closed:\n",
"if self._session is None:\n",
"if adapter is None:\n",
"adapter = self._adapter\n",
"assert adapter is not None\n",
"if not self._session.is_client:\n",
"self._detach()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assert'",
"Condition",
"Expr'"
] |
[
"def FUNC_1(self, VAR_6):...\n",
"if VAR_6:\n",
"VAR_15 = Announce.by_id(VAR_6, self.sql_session).scalar()\n",
"VAR_18 = FUNC_0(self.get_argument('start', '0'), -1, 0, 10000000000000000000)\n",
"if not VAR_15:\n",
"VAR_19 = FUNC_0(self.get_argument('step', '12'), 0, 1, 20)\n",
"if VAR_15.is_private and ... | [
"def get(self, ann_id):...\n",
"if ann_id:\n",
"ann = Announce.by_id(ann_id, self.sql_session).scalar()\n",
"start = _to_int(self.get_argument('start', '0'), -1, 0, 10000000000000000000)\n",
"if not ann:\n",
"step = _to_int(self.get_argument('step', '12'), 0, 1, 20)\n",
"if ann.is_private and not self.i... | [
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,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condi... |
[
"def FUNC_6(self):...\n",
"self.mock(bot_main, 'get_remote', lambda : self.server)\n",
"VAR_9 = []\n",
"def FUNC_21(VAR_10):...\n",
"VAR_9.append(1)\n",
"return False\n"
] | [
"def test_setup_bot(self):...\n",
"self.mock(bot_main, 'get_remote', lambda : self.server)\n",
"setup_bots = []\n",
"def setup_bot(_bot):...\n",
"setup_bots.append(1)\n",
"return False\n"
] | [
0,
5,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"import os\n",
"import unittest\n",
"from coalib.bearlib.abstractions.Lint import Lint\n",
"from coalib.misc.ContextManagers import prepare_file\n",
"from coalib.misc.Shell import escape_path_argument\n",
"from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY\n",
"from coalib.results.SourceRange im... | [
"import os\n",
"import unittest\n",
"from coalib.bearlib.abstractions.Lint import Lint\n",
"from coalib.misc.ContextManagers import prepare_file\n",
"from coalib.misc.Shell import escape_path_argument\n",
"from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY\n",
"from coalib.results.SourceRange im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Ex... |
[
"@property...\n",
"return self._input\n"
] | [
"@property...\n",
"return self._input\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from datetime import datetime\n",
"from django.conf import settings\n",
"from django.core.cache import cache\n",
"from django.template import RequestContext\n",
"from django.core.urlresolvers import reverse\n",
"from django.http import Http404, HttpResponseRedirect, HttpResponseNotAllowed, HttpResponse, ... | [
"from datetime import datetime\n",
"from django.conf import settings\n",
"from django.core.cache import cache\n",
"from django.template import RequestContext\n",
"from django.core.urlresolvers import reverse\n",
"from django.http import Http404, HttpResponseRedirect, HttpResponseNotAllowed, HttpResponse, ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
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'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"ImportFrom'",
"Assi... |
[
"def FUNC_1(self):...\n",
"self.handled_resp = None\n",
"self.handled_remote = None\n",
"self.handled_args = None\n",
"self.handled_kwargs = None\n",
"from invenio.modules.oauthclient.models import RemoteToken, RemoteAccount\n",
"RemoteToken.query.delete()\n",
"RemoteAccount.query.delete()\n",
"db.s... | [
"def tearDown(self):...\n",
"self.handled_resp = None\n",
"self.handled_remote = None\n",
"self.handled_args = None\n",
"self.handled_kwargs = None\n",
"from invenio.modules.oauthclient.models import RemoteToken, RemoteAccount\n",
"RemoteToken.query.delete()\n",
"RemoteAccount.query.delete()\n",
"db... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"for VAR_13 in DataDocument.objects.all():\n",
"VAR_11 = VAR_13.id\n",
"VAR_12 = self.client.get('/datadocument/%s/' % VAR_11)\n",
"self.assertEqual(VAR_12.status_code, 200,\n 'The page must return a 200 status code')\n",
"VAR_20 = ExtractedText.objects.get(data_document=dd)\n... | [
"def test_absent_extracted_text(self):...\n",
"for dd in DataDocument.objects.all():\n",
"ddid = dd.id\n",
"resp = self.client.get('/datadocument/%s/' % ddid)\n",
"self.assertEqual(resp.status_code, 200,\n 'The page must return a 200 status code')\n",
"extracted_text = ExtractedText.objects.get(data_do... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_7=None, VAR_8=None, VAR_12=True):...\n",
"if VAR_7:\n",
"self.entry_id = VAR_7\n",
"self.create_entry()\n",
"self.populate_entry_data()\n",
"self.set_entry_id()\n",
"self.writeable = VAR_12\n",
"if VAR_8:\n",
"self.title = VAR_8\n",
"self.update_title()\n"
] | [
"def __init__(self, entry_id=None, title=None, writeable=True):...\n",
"if entry_id:\n",
"self.entry_id = entry_id\n",
"self.create_entry()\n",
"self.populate_entry_data()\n",
"self.set_entry_id()\n",
"self.writeable = writeable\n",
"if title:\n",
"self.title = title\n",
"self.update_title()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"for i in xrange(VAR_1):\n",
"yield unichr(random.randint(0, 65535))\n"
] | [
"@staticmethod...\n",
"for i in xrange(cnt):\n",
"yield unichr(random.randint(0, 65535))\n"
] | [
0,
0,
0
] | [
"Condition",
"For",
"Expr'"
] |
[
"@pyqtSlot(str)...\n",
"self.log_area.moveCursor(QTextCursor.End)\n",
"self.log_area.insertPlainText(VAR_3)\n"
] | [
"@pyqtSlot(str)...\n",
"self.log_area.moveCursor(QTextCursor.End)\n",
"self.log_area.insertPlainText(message)\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_26(self, VAR_26, VAR_7, VAR_27, VAR_28):...\n",
"if VAR_28 is None:\n",
"VAR_49 = 'ADD'\n",
"if VAR_27 is None:\n",
"VAR_3 = '%s,None' % VAR_27\n",
"VAR_49 = 'REMOVE'\n",
"VAR_49 = 'UPDATE'\n",
"if not VAR_7 is None:\n",
"VAR_3 = 'None,%s' % VAR_28\n",
"VAR_3 = '%s,%s' % (VAR_27, VAR_28)... | [
"def __log_traverse_one(self, path, attribute, source, target):...\n",
"if target is None:\n",
"mode = 'ADD'\n",
"if source is None:\n",
"data = '%s,None' % source\n",
"mode = 'REMOVE'\n",
"mode = 'UPDATE'\n",
"if not attribute is None:\n",
"data = 'None,%s' % target\n",
"data = '%s,%s' % (source,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = self.describe()\n",
"self.start_time = time.time()\n",
"self.response = self.browser.do_request(self.url, self.data, self.files)\n",
"self.exception_data = traceback.format_exc()\n",
"self.outcome = None\n",
"self.stop_time = time.time()\n... | [
"def _execute(self):...\n",
"\"\"\"docstring\"\"\"\n",
"description = self.describe()\n",
"self.start_time = time.time()\n",
"self.response = self.browser.do_request(self.url, self.data, self.files)\n",
"self.exception_data = traceback.format_exc()\n",
"self.outcome = None\n",
"self.stop_time = time.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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Ass... |
[
"def FUNC_13(self, VAR_10=None, VAR_14=None, VAR_15=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_15:\n",
"VAR_10 = sys.argv[1:] if VAR_10 is None else VAR_10\n",
"return super().parse_known_args(VAR_10, VAR_14)\n",
"VAR_10 = [a for a in VAR_10 if a != '-h' and a != '--help']\n"
] | [
"def parse_known_args(self, args=None, namespace=None, nohelp=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if nohelp:\n",
"args = sys.argv[1:] if args is None else args\n",
"return super().parse_known_args(args, namespace)\n",
"args = [a for a in args if a != '-h' and a != '--help']\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_0(self):...\n",
"VAR_0 = self.client.get('/api/v1/questions/answers', headers={\n 'Authorization': 'JWT ' + self.token})\n",
"self.assertEqual(VAR_0.status_code, 200)\n",
"self.assertEqual(VAR_0.get_json()['status'], 'success')\n"
] | [
"def test_list_answers(self):...\n",
"response = self.client.get('/api/v1/questions/answers', headers={\n 'Authorization': 'JWT ' + self.token})\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(response.get_json()['status'], 'success')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0 = str(VAR_0)\n",
"pathlib.Path(VAR_0).mkdir(parents=True, exist_ok=True)\n"
] | [
"def create_directory_tree(path):...\n",
"\"\"\"docstring\"\"\"\n",
"path = str(path)\n",
"pathlib.Path(path).mkdir(parents=True, exist_ok=True)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(VAR_3, VAR_7, VAR_8=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {'currentProvider': None, 'providers': [], 'secondaryProviders': [],\n 'finishAuthUrl': None, 'errorMessage': None}\n",
"if third_party_auth.is_enabled():\n",
"if not enterprise_customer_for_request(VAR_3):\n",
"return VA... | [
"def _third_party_auth_context(request, redirect_to, tpa_hint=None):...\n",
"\"\"\"docstring\"\"\"\n",
"context = {'currentProvider': None, 'providers': [], 'secondaryProviders':\n [], 'finishAuthUrl': None, 'errorMessage': None}\n",
"if third_party_auth.is_enabled():\n",
"if not enterprise_customer_for_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"For",
"Return'",
"For",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'"
] |
[
"def FUNC_4(VAR_0, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = VAR_0.tournamentplayer_set.all()\n",
"VAR_17 = VAR_5.roundplayer_set.all()\n",
"VAR_18 = []\n",
"VAR_13 = set()\n",
"VAR_19 = set()\n",
"for VAR_36 in VAR_17:\n",
"assert VAR_36.gameplayers().count(\n ) == 0, '%d games already... | [
"def _sitters_and_two_gamers(tournament, the_round):...\n",
"\"\"\"docstring\"\"\"\n",
"tourney_players = tournament.tournamentplayer_set.all()\n",
"round_players = the_round.roundplayer_set.all()\n",
"rps = []\n",
"sitters = set()\n",
"two_gamers = set()\n",
"for rp in round_players:\n",
"assert rp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assert'",
"Assert'",
"Expr'",
"Condition",
"Condition",
"Assert'",
"Condition",
"Condition",
"Assert'",
"For",
"Expr'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Assert'",
... |
[
"def FUNC_33(VAR_39):...\n",
"return True\n"
] | [
"def acquire(self2):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import absolute_import, division, print_function\n",
"__metaclass__ = type\n",
"from ansible.errors import AnsibleError\n",
"\"\"\" a group of ansible hosts \"\"\"\n",
"def __init__(self, VAR_0=None):...\n",
"self.depth = 0\n",
"self.name = VAR_0\n",
"self.hosts = []\n",
"self._host... | [
"from __future__ import absolute_import, division, print_function\n",
"__metaclass__ = type\n",
"from ansible.errors import AnsibleError\n",
"\"\"\" a group of ansible hosts \"\"\"\n",
"def __init__(self, name=None):...\n",
"self.depth = 0\n",
"self.name = name\n",
"self.hosts = []\n",
"self._hosts ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Assign'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_0, self).__init__(VAR_1, VAR_4)\n",
"VAR_1 = self.bindings\n",
"VAR_1['TEST_APP_COMPONENT_NAME'] = '{app}-{stack}-{detail}'.format(app=\n bindings['TEST_APP'], stack=bindings['TEST_STACK'], detail=bindings[\n 'TEST_... | [
"def __init__(self, bindings, agent=None):...\n",
"\"\"\"docstring\"\"\"\n",
"super(AwsSmokeTestScenario, self).__init__(bindings, agent)\n",
"bindings = self.bindings\n",
"bindings['TEST_APP_COMPONENT_NAME'] = '{app}-{stack}-{detail}'.format(app=\n bindings['TEST_APP'], stack=bindings['TEST_STACK'], det... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._zinc_factory._zinc(self._products)\n"
] | [
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._zinc_factory._zinc(self._products)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_2 = self.client.get(f'/datagroup/{DataGroup.objects.first().id}/'\n ).content.decode('utf8')\n",
"self.assertIn('0 extracted', VAR_2,\n 'Data Group should contain a count of 0 total extracted documents')\n",
"self.objects.doc.extracted = True\n",
"self.objects.doc.save()... | [
"def test_extracted_count(self):...\n",
"response = self.client.get(f'/datagroup/{DataGroup.objects.first().id}/'\n ).content.decode('utf8')\n",
"self.assertIn('0 extracted', response,\n 'Data Group should contain a count of 0 total extracted documents')\n",
"self.objects.doc.extracted = True\n",
"sel... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_25(self):...\n",
"if not os.path.isfile(self.newproxyfile):\n",
"return\n",
"VAR_48 = set()\n",
"for VAR_57 in f:\n",
"return VAR_48.difference(self.proxylist)\n",
"VAR_57 = VAR_57.rstrip('\\n')\n",
"self.log.exception('Line %s raised exception %s', VAR_57, e)\n",
"VAR_58 = tuple(VAR_57.sp... | [
"def read_newproxies(self):...\n",
"if not os.path.isfile(self.newproxyfile):\n",
"return\n",
"newproxies = set()\n",
"for line in f:\n",
"return newproxies.difference(self.proxylist)\n",
"line = line.rstrip('\\n')\n",
"self.log.exception('Line %s raised exception %s', line, e)\n",
"proxypair = tupl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"For",
"Return'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def __init__(self, VAR_7, VAR_14=errors.NO_THING_ID, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_7, VAR_14, *VAR_15, **kw)\n"
] | [
"def __init__(self, param, error=errors.NO_THING_ID, *a, **kw):...\n",
"VRequired.__init__(self, param, error, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_10():...\n",
"return {'divider': True}\n"
] | [
"def divider_entry():...\n",
"return {'divider': True}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"@functools.wraps(VAR_7)...\n",
"assert isinstance(self, webapp2.RequestHandler)\n",
"assert self.request.method == 'GET'\n",
"if model.is_replica():\n",
"VAR_40 = model.get_replication_state().primary_url\n",
"return VAR_7(self, *VAR_9, **kwargs)\... | [
"def redirect_ui_on_replica(method):...\n",
"\"\"\"docstring\"\"\"\n",
"@functools.wraps(method)...\n",
"assert isinstance(self, webapp2.RequestHandler)\n",
"assert self.request.method == 'GET'\n",
"if model.is_replica():\n",
"primary_url = model.get_replication_state().primary_url\n",
"return method(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assert'",
"Assert'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assert'",
"Assert'",
"Expr'"
] |
[
"def FUNC_4():...\n",
"return FUNC_5(LoginForm())\n"
] | [
"def render_login():...\n",
"return render_loginForm(LoginForm())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@hook.command(autohelp=False)...\n",
"return FUNC_1(VAR_8, 'ban', VAR_4, VAR_5, VAR_1, VAR_6, VAR_7)\n"
] | [
"@hook.command(autohelp=False)...\n",
"return process_vote(inp, 'ban', chan, mask, db, notice, conn)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from datetime import datetime\n",
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from dashboard.forms import DataSourceForm, PriorityForm\n",
"from dashboard.models import DataSource, DataGroup, DataDocument\n",
"from ... | [
"from datetime import datetime\n",
"from django.contrib.auth.decorators import login_required\n",
"from django.shortcuts import render, redirect, get_object_or_404\n",
"from dashboard.forms import DataSourceForm, PriorityForm\n",
"from dashboard.models import DataSource, DataGroup, DataDocument\n",
"from ... | [
6,
0,
0,
0,
0,
6,
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'",
"Condition",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"A... |
[
"@classmethod...\n",
"VAR_30 = []\n",
"for plugin, VAR_11 in VAR_24.items():\n",
"for arg in VAR_11:\n",
"return VAR_30\n",
"if ' ' in arg:\n",
"VAR_30.append('-Xplugin:{} {}'.format(plugin, ' '.join(VAR_11)))\n"
] | [
"@classmethod...\n",
"ret = []\n",
"for plugin, args in javac_plugin_map.items():\n",
"for arg in args:\n",
"return ret\n",
"if ' ' in arg:\n",
"ret.append('-Xplugin:{} {}'.format(plugin, ' '.join(args)))\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Expr'"
] |
[
"def __init__(self, VAR_11=VAR_2):...\n",
"return self.load_sqlfs(VAR_11)\n"
] | [
"def __init__(self, db=Database):...\n",
"return self.load_sqlfs(db)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_57():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"VAR_38 = set(['a'])\n",
"self.cursor.executemany('insert into t1 (word) values (?)', [VAR_38])\n"
] | [
"def f():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"words = set(['a'])\n",
"self.cursor.executemany('insert into t1 (word) values (?)', [words])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_4 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_8 = {'image': 'autotest/example', 'sha': 'a' *... | [
"def test_container_str(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"from flask import jsonify, request, make_response, g\n",
"from sqlalchemy.exc import IntegrityError\n",
"from . import api\n",
"from .. import db, auth\n",
"from ..models import Song\n",
"from .errors import bad_request, route_not_found\n",
"@api.route('/songs/<name>')...\n",
"return jsonify(VAR_0=na... | [
"from flask import jsonify, request, make_response, g\n",
"from sqlalchemy.exc import IntegrityError\n",
"from . import api\n",
"from .. import db, auth\n",
"from ..models import Song\n",
"from .errors import bad_request, route_not_found\n",
"@api.route('/songs/<name>')...\n",
"return jsonify(name=nam... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"LogoutHandler.post(self)\n",
"self.get('You logged out')\n"
] | [
"def post(self):...\n",
"LogoutHandler.post(self)\n",
"self.get('You logged out')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def __call__(self, *VAR_19, **VAR_5):...\n",
"return CLASS_9(self.start, self.end, *VAR_19, **kwargs)\n"
] | [
"def __call__(self, *args, **kwargs):...\n",
"return SliceTransform(self.start, self.end, *args, **kwargs)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"VAR_4 = {'username': 'first', 'password': 'password', 'email':\n 'autotest@deis.io'}\n",
"VAR_5 = '/api/auth/register'\n",
"VAR_6 = self.client.post(VAR_5, json.dumps(VAR_4), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_6.status_code, 201)\n",
"self.assert... | [
"def test_delete(self):...\n",
"submit = {'username': 'first', 'password': 'password', 'email':\n 'autotest@deis.io'}\n",
"url = '/api/auth/register'\n",
"response = self.client.post(url, json.dumps(submit), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5=None, VAR_6=...\n",
"self.logger = logging.getLogger('fuxploider')\n",
"self.postData = VAR_4\n",
"self.formUrl = VAR_6\n",
"VAR_18 = urlparse(self.formUrl)\n",
"self.schema = VAR_18.scheme\n",
"self.host = VAR_18.netloc\n",
"self.uploadUrl ... | [
"def __init__(self, notRegex, trueRegex, session, size, postData,...\n",
"self.logger = logging.getLogger('fuxploider')\n",
"self.postData = postData\n",
"self.formUrl = formUrl\n",
"url = urlparse(self.formUrl)\n",
"self.schema = url.scheme\n",
"self.host = url.netloc\n",
"self.uploadUrl = urljoin(fo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"import time\n",
"import mox\n",
"import paramiko\n",
"from cinder import context\n",
"from cinder import exception\n",
"from cinder.openstack.common import log as logging\n",
"from cinder.openstack.common import processutils\n",
"from cinder import test\n",
"from cinder.volume import configuration ... | [
"import time\n",
"import mox\n",
"import paramiko\n",
"from cinder import context\n",
"from cinder import exception\n",
"from cinder.openstack.common import log as logging\n",
"from cinder.openstack.common import processutils\n",
"from cinder import test\n",
"from cinder.volume import configuration ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"... |
[
"def FUNC_4(self, VAR_6, **VAR_7):...\n",
"if self.closed:\n",
"if self._adapter is None:\n",
"if self._session is not None:\n"
] | [
"def attach_pid(self, pid, **kwargs):...\n",
"if self.closed:\n",
"if self._adapter is None:\n",
"if self._session is not None:\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Condition"
] |
[
"def FUNC_6(self, VAR_9):...\n",
"VAR_19 = urllib2.Request(self.url + VAR_9)\n",
"VAR_20 = self._opener.open(VAR_19)\n",
"VAR_10 = VAR_20.read()\n",
"return VAR_10\n"
] | [
"def get(self, suburl):...\n",
"request = urllib2.Request(self.url + suburl)\n",
"f = self._opener.open(request)\n",
"data = f.read()\n",
"return data\n"
] | [
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_4, VAR_13, VAR_14):...\n",
"VAR_35 = None\n",
"if VAR_4.properties.commands:\n",
"VAR_35 = VAR_4.properties.commands[0]\n",
"if VAR_4.properties.command:\n",
"VAR_36 = {'cmd': 'run', 'manifest': {'bot_id': VAR_14, 'command': VAR_35,\n 'dimensions': VAR_4.properties.dimensions, 'en... | [
"def _cmd_run(self, request, run_result_key, bot_id):...\n",
"cmd = None\n",
"if request.properties.commands:\n",
"cmd = request.properties.commands[0]\n",
"if request.properties.command:\n",
"out = {'cmd': 'run', 'manifest': {'bot_id': bot_id, 'command': cmd,\n 'dimensions': request.properties.dimensi... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2():...\n",
"VAR_2 = json.load(f)\n"
] | [
"def read_cms_config():...\n",
"cms_config = json.load(f)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_9(self, VAR_18, VAR_11, VAR_12):...\n",
"self.logger.info('Arrived at ' + str((VAR_11, VAR_12)) +\n ' (map position is ' + str((self.navloc.map_pos.x, self.navloc.map_pos.\n y)) + ')')\n",
"self.navloc.csvLogArrival(self.test_name, VAR_11, VAR_12)\n"
] | [
"def logArrival(self, name, x, y):...\n",
"self.logger.info('Arrived at ' + str((x, y)) + ' (map position is ' + str((\n self.navloc.map_pos.x, self.navloc.map_pos.y)) + ')')\n",
"self.navloc.csvLogArrival(self.test_name, x, y)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"from django.utils import timezone\n",
"from django.contrib.auth.models import User\n",
"from dashboard.models import *\n",
"VAR_0 = ['00_superuser', '01_lookups', '02_datasource', '03_datagroup',\n '04_PUC', '05_product', '06_datadocument', '07_rawchem_etc',\n '08_script', '09_productdocument', '10_hab... | [
"from django.utils import timezone\n",
"from django.contrib.auth.models import User\n",
"from dashboard.models import *\n",
"fixtures_standard = ['00_superuser', '01_lookups', '02_datasource',\n '03_datagroup', '04_PUC', '05_product', '06_datadocument',\n '07_rawchem_etc', '08_script', '09_productdocume... | [
0,
0,
0,
0,
0,
0,
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'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"A... |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_35 = quotas.get_disabled_quotas(VAR_1)\n",
"VAR_36 = [quota for quota in quotas.QUOTA_FIELDS if quota not in VAR_35]\n",
"return {'items': VAR_36}\n"
] | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"disabled_quotas = quotas.get_disabled_quotas(request)\n",
"editable_quotas = [quota for quota in quotas.QUOTA_FIELDS if quota not in\n disabled_quotas]\n",
"return {'items': editable_quotas}\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(VAR_6, VAR_7):...\n",
"if not which(VAR_6):\n"
] | [
"def check_executable(cmdname, pkg):...\n",
"if not which(cmdname):\n"
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_15(self, VAR_16, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = self._eql_execute('volume', 'select', VAR_18['volume_name'],\n 'snapshot', 'select', VAR_18['name'], 'clone', VAR_16['name'])\n",
"VAR_0.error(_('Failed to create volume from snapshot %s'), VAR_18['name'])\n",
"return self._g... | [
"def create_volume_from_snapshot(self, volume, snapshot):...\n",
"\"\"\"docstring\"\"\"\n",
"out = self._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'select', snapshot['name'], 'clone', volume['name'])\n",
"LOG.error(_('Failed to create volume from snapshot %s'), snapshot['name']... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_3():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = {}\n",
"for arg in request.args:\n",
"VAR_8 = re.findall('_oc_(.*)', arg)\n",
"return VAR_7\n",
"if VAR_8:\n",
"VAR_7[VAR_8[0]] = request.args.get(arg), request.args.get('_od_' + VAR_8[0])\n"
] | [
"def get_order_args():...\n",
"\"\"\"docstring\"\"\"\n",
"orders = {}\n",
"for arg in request.args:\n",
"re_match = re.findall('_oc_(.*)', arg)\n",
"return orders\n",
"if re_match:\n",
"orders[re_match[0]] = request.args.get(arg), request.args.get('_od_' +\n re_match[0])\n"
] | [
0,
0,
0,
0,
0,
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def FUNC_1(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"from app.questions.api.v1.view import question_blueprint\n",
"from .home.views import home_blueprint\n",
"from .auth.api.v1.view import auth_blueprint\n",
"from .answers.api.v1.view import answers_blueprint\n",
"from .votes.api.v1.view import votes_... | [
"def configure_blueprints(app):...\n",
"\"\"\"docstring\"\"\"\n",
"from app.questions.api.v1.view import question_blueprint\n",
"from .home.views import home_blueprint\n",
"from .auth.api.v1.view import auth_blueprint\n",
"from .answers.api.v1.view import answers_blueprint\n",
"from .votes.api.v1.view i... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_3(self, VAR_7):...\n",
"self.index = VAR_7\n"
] | [
"def set_index(self, new_index):...\n",
"self.index = new_index\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def __eq__(self, VAR_35):...\n",
"return self.__class__ == VAR_35.__class__ and self.size == VAR_35.size\n"
] | [
"def __eq__(self, other):...\n",
"return self.__class__ == other.__class__ and self.size == other.size\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_27(self, VAR_14, VAR_30, VAR_29):...\n",
"VAR_53 = \"%s '%s' '%s'\" % (VAR_5, VAR_30, VAR_14)\n",
"VAR_12 = \"ssh %s 'bash -s' < %s\" % (VAR_29, VAR_53)\n",
"FUNC_7(self.session, VAR_12)\n"
] | [
"def start_remote_clone_session(self, comp_name, session_name, hostname):...\n",
"remote_cmd = \"%s '%s' '%s'\" % (SCRIPT_CLONE_PATH, session_name, comp_name)\n",
"cmd = \"ssh %s 'bash -s' < %s\" % (hostname, remote_cmd)\n",
"send_main_session_command(self.session, cmd)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_23):...\n",
"VAR_23 = FUNC_1(VAR_23)\n",
"if not VAR_23:\n",
"return self.error()\n",
"VAR_15 = Subreddit._by_name(VAR_23)\n",
"return VAR_23\n",
"return self.error(errors.SUBREDDIT_EXISTS)\n"
] | [
"def run(self, name):...\n",
"name = chksrname(name)\n",
"if not name:\n",
"return self.error()\n",
"a = Subreddit._by_name(name)\n",
"return name\n",
"return self.error(errors.SUBREDDIT_EXISTS)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_20(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.registerPlayer(VAR_1='a')\n"
] | [
"def test_name_less_two_characters(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.registerPlayer(player_name='a')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"@staticmethod...\n",
"def FUNC_14(VAR_7):...\n",
"def FUNC_13(self, *VAR_16, **VAR_10):...\n",
"if not self.is_group_user(VAR_8):\n",
"return VAR_7(self, *VAR_16, **kwargs)\n"
] | [
"@staticmethod...\n",
"def decorator(method):...\n",
"def wrapper(self, *args, **kwargs):...\n",
"if not self.is_group_user(group):\n",
"return method(self, *args, **kwargs)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"FunctionDef'",
"FunctionDef'",
"Condition",
"Return'"
] |
[
"{'name': 'FIT BCNL Events', 'category': 'Website', 'version': '10.0.0.0.1',\n 'author': 'Fundament IT', 'website': 'https://fundament.it/', 'licence':\n 'AGPL-3', 'depends': ['website_event'], 'summary': '', 'description':\n \"\"\"\nExtension for the default Events module; used for BCNL, .\n \"\"\",\n ... | [
"{'name': 'FIT BCNL Events', 'category': 'Website', 'version': '10.0.0.0.1',\n 'author': 'Fundament IT', 'website': 'https://fundament.it/', 'licence':\n 'AGPL-3', 'depends': ['website_event'], 'summary': '', 'description':\n \"\"\"\nExtension for the default Events module; used for BCNL, .\n \"\"\",\n ... | [
6
] | [
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"VAR_28 = Gtk.Builder()\n",
"VAR_28.add_from_resource('/run/terminal/KeepassGtk/main_window.ui')\n",
"self.headerbar = VAR_28.get_object('headerbar')\n",
"VAR_29 = VAR_28.get_object('open_button')\n",
"VAR_29.connect('clicked', self.open_filechooser, None)\n",
"VAR_30 = VAR_28.... | [
"def create_headerbar(self):...\n",
"builder = Gtk.Builder()\n",
"builder.add_from_resource('/run/terminal/KeepassGtk/main_window.ui')\n",
"self.headerbar = builder.get_object('headerbar')\n",
"file_open_button = builder.get_object('open_button')\n",
"file_open_button.connect('clicked', self.open_filechoo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_0):...\n",
""
] | [
"def get(self, user_id):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_7(self):...\n",
"super(CLASS_0, self).validate()\n",
"if not self.blog_intro:\n",
"self.blog_intro = self.content[:140]\n",
"if self.blog_intro:\n",
"self.blog_intro = strip_html_tags(self.blog_intro)\n",
"self.blog_intro = self.blog_intro[:140]\n",
"if self.published and not self.published_... | [
"def validate(self):...\n",
"super(BlogPost, self).validate()\n",
"if not self.blog_intro:\n",
"self.blog_intro = self.content[:140]\n",
"if self.blog_intro:\n",
"self.blog_intro = strip_html_tags(self.blog_intro)\n",
"self.blog_intro = self.blog_intro[:140]\n",
"if self.published and not self.publish... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"import re\n",
"from flask import request\n",
"\"\"\"\n Stack data structure will not insert\n equal sequential data\n \"\"\"\n",
"def __init__(self, VAR_1=None, VAR_2=5):...\n",
"self.size = VAR_2\n",
"self.data = VAR_1 or []\n",
"def FUNC_5(self, VAR_3):...\n",
"if self.data:\n",
... | [
"import re\n",
"from flask import request\n",
"\"\"\"\n Stack data structure will not insert\n equal sequential data\n \"\"\"\n",
"def __init__(self, list=None, size=5):...\n",
"self.size = size\n",
"self.data = list or []\n",
"def push(self, item):...\n",
"if self.data:\n",
"if ite... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_11(self, VAR_2, VAR_3, VAR_19, VAR_20={}, VAR_7={}):...\n",
"VAR_39 = self.browse(VAR_2, VAR_3, VAR_19, VAR_7=context)\n",
"VAR_20 = VAR_20 or {}\n",
"VAR_7['active_test'] = False\n",
"VAR_20['state'] = 'open'\n",
"if not VAR_20.get('name', False):\n",
"VAR_20['name'] = VAR_39.name + _(' (copy... | [
"def copy(self, cr, uid, id, default={}, context={}):...\n",
"proj = self.browse(cr, uid, id, context=context)\n",
"default = default or {}\n",
"context['active_test'] = False\n",
"default['state'] = 'open'\n",
"if not default.get('name', False):\n",
"default['name'] = proj.name + _(' (copy)')\n",
"re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __iter__(self):...\n",
"return iter(self.current)\n"
] | [
"def __iter__(self):...\n",
"return iter(self.current)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.local:\n",
"self.sftp.stat(VAR_5)\n",
"return False\n",
"os.stat(VAR_5)\n",
"return False\n",
"return True\n",
"return True\n"
] | [
"def file_exists(self, fname):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.local:\n",
"self.sftp.stat(fname)\n",
"return False\n",
"os.stat(fname)\n",
"return False\n",
"return True\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Return'",
"Expr'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_6(self, VAR_64):...\n",
"if not VAR_64:\n",
"return None\n",
"VAR_88 = [int(i, 36) for i in VAR_64.split(',')]\n",
"VAR_89 = Comment._byID(VAR_88, data=True, return_dict=False)\n",
"return VAR_89\n"
] | [
"def run(self, id_str):...\n",
"if not id_str:\n",
"return None\n",
"cids = [int(i, 36) for i in id_str.split(',')]\n",
"comments = Comment._byID(cids, data=True, return_dict=False)\n",
"return comments\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_13(VAR_16)\n"
] | [
"def temporary(value):...\n",
"\"\"\"docstring\"\"\"\n",
"return temp(value)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@property...\n",
"return (file for VAR_13 in self.rules for file in chain(VAR_13.input,\n VAR_13.output) if not callable(file) and not file.contains_wildcard())\n"
] | [
"@property...\n",
"return (file for rule in self.rules for file in chain(rule.input, rule.\n output) if not callable(file) and not file.contains_wildcard())\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_1):...\n",
"self.conn = VAR_1\n",
"self.s = VAR_1.s\n",
"self.addr = VAR_1.addr\n",
"self.args = VAR_1.args\n",
"self.auth = VAR_1.auth\n",
"self.sr = VAR_1.sr\n",
"self.bufsz = 1024 * 32\n",
"self.ok = True\n",
"self.log_func = VAR_1.log_func\n",
"self.log_src = VAR_1.lo... | [
"def __init__(self, conn):...\n",
"self.conn = conn\n",
"self.s = conn.s\n",
"self.addr = conn.addr\n",
"self.args = conn.args\n",
"self.auth = conn.auth\n",
"self.sr = conn.sr\n",
"self.bufsz = 1024 * 32\n",
"self.ok = True\n",
"self.log_func = conn.log_func\n",
"self.log_src = conn.log_src\n"
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def __setstate__(self, VAR_0):...\n",
"return self.deserialize(VAR_0)\n"
] | [
"def __setstate__(self, data):...\n",
"return self.deserialize(data)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(self, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = {}\n",
"for tag_list in self.get_tags_dict(VAR_7).values():\n",
"for VAR_6 in tag_list:\n",
"return VAR_12\n",
"if VAR_6 not in VAR_12:\n",
"VAR_12[VAR_6] = 1\n",
"VAR_12[VAR_6] += 1\n"
] | [
"def tag_count(self, tids):...\n",
"\"\"\"docstring\"\"\"\n",
"count_dict = {}\n",
"for tag_list in self.get_tags_dict(tids).values():\n",
"for tag in tag_list:\n",
"return count_dict\n",
"if tag not in count_dict:\n",
"count_dict[tag] = 1\n",
"count_dict[tag] += 1\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Assign'",
"AugAssign'"
] |
[
"def FUNC_1(self, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_2 in self.__id_map\n"
] | [
"def has_id(self, entity_id):...\n",
"\"\"\"docstring\"\"\"\n",
"return entity_id in self.__id_map\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_0(VAR_4):...\n",
"return render(VAR_4, 'index.html')\n"
] | [
"def index(request):...\n",
"return render(request, 'index.html')\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(VAR_1, **VAR_6):...\n",
"import sql\n",
"VAR_43 = 'waf.sh'\n",
"VAR_44 = sql.get_setting('tmp_config_path')\n",
"VAR_24 = sql.get_setting('proxy')\n",
"VAR_53 = sql.get_setting('haproxy_dir')\n",
"VAR_54 = FUNC_14(VAR_1)\n",
"os.system('cp scripts/%s .' % VAR_43)\n",
"VAR_13 = ['sudo ch... | [
"def waf_install(serv, **kwargs):...\n",
"import sql\n",
"script = 'waf.sh'\n",
"tmp_config_path = sql.get_setting('tmp_config_path')\n",
"proxy = sql.get_setting('proxy')\n",
"haproxy_dir = sql.get_setting('haproxy_dir')\n",
"ver = check_haproxy_version(serv)\n",
"os.system('cp scripts/%s .' % script... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'"
] |
[
"from __future__ import absolute_import, division, print_function, with_statement\n",
"import os\n",
"import sys\n",
"import argparse\n",
"if __name__ == '__main__':\n",
"VAR_0 = argparse.ArgumentParser(description='See README')\n",
"VAR_0.add_argument('-c', '--count', default=3, type=int, help=\n 'w... | [
"from __future__ import absolute_import, division, print_function, with_statement\n",
"import os\n",
"import sys\n",
"import argparse\n",
"if __name__ == '__main__':\n",
"parser = argparse.ArgumentParser(description='See README')\n",
"parser.add_argument('-c', '--count', default=3, type=int, help=\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
2,
0,
0,
0,
2,
2,
0,
2
] | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.