lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def __init__(self, VAR_7=None, VAR_8=None, VAR_9=True, VAR_10=True, VAR_11=True...\n", "if VAR_7:\n", "self.param = VAR_7\n", "self.param = self.default_param\n", "self.default = VAR_8\n", "self.post, self.get, self.url = VAR_9, VAR_10, VAR_11\n" ]
[ "def __init__(self, param=None, default=None, post=True, get=True, url=True):...\n", "if param:\n", "self.param = param\n", "self.param = self.default_param\n", "self.default = default\n", "self.post, self.get, self.url = post, get, url\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_14(self):...\n", "VAR_36 = self.builder.get_object('unlock_failed_revealer')\n", "VAR_36.set_reveal_child(not VAR_36.get_reveal_child())\n" ]
[ "def hide_unlock_failed_revealer(self):...\n", "unlock_failed_revealer = self.builder.get_object('unlock_failed_revealer')\n", "unlock_failed_revealer.set_reveal_child(not unlock_failed_revealer.\n get_reveal_child())\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "self.update()\n", "return self.data.keys()\n" ]
[ "def get_module_names(self):...\n", "\"\"\"docstring\"\"\"\n", "self.update()\n", "return self.data.keys()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Return'" ]
[ "def FUNC_12(VAR_15):...\n", "return \"'%s'\" % VAR_15.replace('\\\\', '\\\\\\\\').replace(\"'\", \"''\")\n" ]
[ "def QuotedString(s):...\n", "return \"'%s'\" % s.replace('\\\\', '\\\\\\\\').replace(\"'\", \"''\")\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_5(self):...\n", "VAR_6 = self.client.get('/api/apps')\n", "VAR_8 = VAR_6.data['results'][0]['id']\n", "self.assertTrue(self.client.login(VAR_1='autotest-2', VAR_2='password'))\n", "VAR_5 = '/api/apps/{}/perms'.format(VAR_8)\n", "VAR_7 = {'username': 'autotest-2'}\n", "VAR_6 = self.client.post(...
[ "def test_create_errors(self):...\n", "response = self.client.get('/api/apps')\n", "app_id = response.data['results'][0]['id']\n", "self.assertTrue(self.client.login(username='autotest-2', password='password'))\n", "url = '/api/apps/{}/perms'.format(app_id)\n", "body = {'username': 'autotest-2'}\n", "re...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "import urllib, re, html\n", "from settings import MAX_BASENAME_LENGTH, ITEMS_PER_PAGE, PASSWORD_KEY, SECRET_KEY, BASE_URL, BASE_URL_ROOT\n", "from core.libs.bottle import redirect, response\n", "import hashlib, base64\n", "from core.libs.bottle import _stderr\n", "VAR_0 = '%Y-%m-%d %H:%M:%S'\n", "def F...
[ "import urllib, re, html\n", "from settings import MAX_BASENAME_LENGTH, ITEMS_PER_PAGE, PASSWORD_KEY, SECRET_KEY, BASE_URL, BASE_URL_ROOT\n", "from core.libs.bottle import redirect, response\n", "import hashlib, base64\n", "from core.libs.bottle import _stderr\n", "DATE_FORMAT = '%Y-%m-%d %H:%M:%S'\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "Assign'", "FunctionDef'", "Import'", "Condition", "Return'", "FunctionDef'", "Import'", "ImportFrom'", "Return'" ]
[ "def FUNC_11(VAR_22, VAR_23):...\n", "if not VAR_23:\n", "return VAR_22\n", "for k in VAR_23.split('.'):\n", "if k in VAR_22 and isinstance(VAR_22[k], dict):\n", "return VAR_22\n", "VAR_22 = VAR_22[k]\n" ]
[ "def strip_hash(h, keys):...\n", "if not keys:\n", "return h\n", "for k in keys.split('.'):\n", "if k in h and isinstance(h[k], dict):\n", "return h\n", "h = h[k]\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "For", "Condition", "Return'", "Assign'" ]
[ "def FUNC_15(self):...\n", "" ]
[ "def _listen(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "async def FUNC_8(self, VAR_24, VAR_21, VAR_26='table'):...\n", "VAR_42 = list(await self.execute(VAR_24,\n 'select sql from sqlite_master where name = :n and type=:t', {'n':\n VAR_21, 't': VAR_26}))\n", "if not VAR_42:\n", "return None\n", "return VAR_42[0][0]\n" ]
[ "async def get_table_definition(self, database_name, table, type_='table'):...\n", "table_definition_rows = list(await self.execute(database_name,\n 'select sql from sqlite_master where name = :n and type=:t', {'n':\n table, 't': type_}))\n", "if not table_definition_rows:\n", "return None\n", "return...
[ 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_22(VAR_30, VAR_3):...\n", "if not isinstance(VAR_30, _IOFile):\n", "return IOFile(VAR_30, VAR_16=self)\n", "return VAR_30.apply_wildcards(VAR_3, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n" ]
[ "def concretize_iofile(f, wildcards):...\n", "if not isinstance(f, _IOFile):\n", "return IOFile(f, rule=self)\n", "return f.apply_wildcards(wildcards, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_0(VAR_1):...\n", "return CLASS_0.all().filter('token =', VAR_1).get()\n" ]
[ "def check_token(token):...\n", "return Authorization.all().filter('token =', token).get()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_8):...\n", "self._idle = True\n", "self._loop = VAR_8\n", "self._idleSince = self._loop.time()\n" ]
[ "def __init__(self, loop):...\n", "self._idle = True\n", "self._loop = loop\n", "self._idleSince = self._loop.time()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_10(self):...\n", "self.loud_reply('TODO jupper {}'.format(self.vpath))\n" ]
[ "def tx_jupper(self):...\n", "self.loud_reply('TODO jupper {}'.format(self.vpath))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_3():...\n", "return '<input name=\"_csrftoken\" type=\"hidden\" value=\"%s\" />' % FUNC_1()\n" ]
[ "def field_token():...\n", "return '<input name=\"_csrftoken\" type=\"hidden\" value=\"%s\" />' % make_token()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@classmethod...\n", "assert engine\n", "VAR_9 = text(\n 'SELECT * FROM users WHERE username = :username AND expire_date is null')\n", "VAR_7 = engine.connect()\n", "VAR_10 = False if VAR_7.execute(VAR_9, VAR_1=username).fetchone(\n ) is None else True\n", "VAR_7.close()\n", "return VAR_10\n" ]
[ "@classmethod...\n", "assert engine\n", "s = text(\n 'SELECT * FROM users WHERE username = :username AND expire_date is null')\n", "connection = engine.connect()\n", "rc = False if connection.execute(s, username=username).fetchone(\n ) is None else True\n", "connection.close()\n", "return rc\n" ]
[ 0, 0, 0, 0, 4, 0, 0 ]
[ "Condition", "Assert'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "async def FUNC_10(VAR_6):...\n", "VAR_10 = {'Authorization': f'Bearer {VAR_1}'}\n", "VAR_8 = await VAR_6.get('/results?page=-1&count=2', VAR_10=headers)\n", "assert VAR_8.status == 400\n", "VAR_8 = await VAR_6.get('/results?page=1&count=0', VAR_10=headers)\n", "assert VAR_8.status == 400\n" ]
[ "async def test_negative_bad_paging(test_cli):...\n", "headers = {'Authorization': f'Bearer {access_token}'}\n", "resp = await test_cli.get('/results?page=-1&count=2', headers=headers)\n", "assert resp.status == 400\n", "resp = await test_cli.get('/results?page=1&count=0', headers=headers)\n", "assert res...
[ 0, 0, 4, 0, 4, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Assert'", "Assign'", "Assert'" ]
[ "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "from __future__ import division\n", "from django.conf.urls import patterns, url\n", "from apps.home.views import home_page, projects, project, project_clone\n", "VAR_0 = patterns('', url('^$', home_page, name='home_pa...
[ "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "from __future__ import division\n", "from django.conf.urls import patterns, url\n", "from apps.home.views import home_page, projects, project, project_clone\n", "urlpatterns = patterns('', url('^$', home_page, name='h...
[ 0, 0, 0, 0, 6, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'" ]
[ "def FUNC_5(self, VAR_13, VAR_14=1):...\n", "utils.check_ssh_injection(VAR_13)\n", "VAR_11 = ' '.join(VAR_13)\n", "if not self.sshpool:\n", "VAR_39 = self.configuration.san_password\n", "VAR_43 = VAR_14\n", "VAR_0.error(_('Error running SSH command: %s') % VAR_11)\n", "VAR_40 = self.configuration.san_...
[ "def _run_ssh(self, cmd_list, attempts=1):...\n", "utils.check_ssh_injection(cmd_list)\n", "command = ' '.join(cmd_list)\n", "if not self.sshpool:\n", "password = self.configuration.san_password\n", "total_attempts = attempts\n", "LOG.error(_('Error running SSH command: %s') % command)\n", "privatekey...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "AugAssign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_6(self, VAR_41):...\n", "if VAR_41:\n", "VAR_95 = Thing._by_fullname(VAR_41, False, data=True)\n", "abort(403, 'forbidden')\n", "if isinstance(VAR_95, Message):\n", "return VAR_95\n", "VAR_52 = VAR_95.subreddit_slow\n", "if VAR_101.user_is_loggedin and VAR_52.can_comment(VAR_101.user):\n", ...
[ "def run(self, fullname):...\n", "if fullname:\n", "parent = Thing._by_fullname(fullname, False, data=True)\n", "abort(403, 'forbidden')\n", "if isinstance(parent, Message):\n", "return parent\n", "sr = parent.subreddit_slow\n", "if c.user_is_loggedin and sr.can_comment(c.user):\n", "return parent\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Condition", "Return'", "Assign'", "Condition", "Return'" ]
[ "def __init__(self):...\n", "self.conn = MySQLdb.connect(*self.dsn)\n", "self.cur = self.conn.cursor()\n" ]
[ "def __init__(self):...\n", "self.conn = MySQLdb.connect(*self.dsn)\n", "self.cur = self.conn.cursor()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_3(self, VAR_9, VAR_10):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def create_export(self, context, volume):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_10():...\n", "return {'divider': True}\n" ]
[ "def divider_entry():...\n", "return {'divider': True}\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_10(self, VAR_10, VAR_13=True):...\n", "VAR_26 = 'string' % {'database': VAR_10}\n", "self.db.executescript(VAR_26)\n", "if VAR_13:\n", "self.db.commit()\n" ]
[ "def create_indexes(self, database, commit=True):...\n", "sqlstr = (\n \"\"\"\n CREATE INDEX IF NOT EXISTS %(database)s.phrases_index_p ON phrases\n (input_phrase, mlen ASC, freq DESC, id ASC);\n CREATE INDEX IF NOT EXISTS %(database)s.phrases_index_i ON phrases\n (p...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_7(VAR_18, VAR_16):...\n", "VAR_34 = renderers.JsonRenderer(missing_tags='ignore')\n", "return VAR_34.render(VAR_18, VAR_16)\n" ]
[ "def render_moustache(text, config):...\n", "r = renderers.JsonRenderer(missing_tags='ignore')\n", "return r.render(text, config)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_20(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.cursor.execute('select listid, listhash from lists')\n" ]
[ "def get_all_shoppinglists(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.cursor.execute('select listid, listhash from lists')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_3(self):...\n", "\"\"\"docstring\"\"\"\n", "GenericRequest._prepare(self)\n", "VAR_17 = os.path.join(self.submissions_path, self.task[1])\n", "VAR_18 = os.listdir(VAR_17)\n", "VAR_19 = random.choice(VAR_18)\n", "self.source_path = os.path.join(VAR_17, VAR_19)\n", "self.files = []\n", "if o...
[ "def _prepare(self):...\n", "\"\"\"docstring\"\"\"\n", "GenericRequest._prepare(self)\n", "task_path = os.path.join(self.submissions_path, self.task[1])\n", "sources = os.listdir(task_path)\n", "source = random.choice(sources)\n", "self.source_path = os.path.join(task_path, source)\n", "self.files = [...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_4(VAR_4, VAR_5):...\n", "VAR_11 = normalize_request(VAR_5)\n", "validate_request(VAR_11=request, VAR_4=schema)\n" ]
[ "def validate_api_request(schema, raw_request):...\n", "request = normalize_request(raw_request)\n", "validate_request(request=request, schema=schema)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_1(self, VAR_2, **VAR_1):...\n", "if VAR_2.GET.get('keyword'):\n", "VAR_4 = VAR_2.GET.get('keyword')\n", "VAR_3 = self.get_context_data()\n", "return HttpResponseRedirect(VAR_4)\n", "return self.render_to_response(VAR_3)\n" ]
[ "def get(self, request, **kwargs):...\n", "if request.GET.get('keyword'):\n", "ip = request.GET.get('keyword')\n", "context = self.get_context_data()\n", "return HttpResponseRedirect(ip)\n", "return self.render_to_response(context)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_1(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "if os.path.exists(VAR_0):\n", "shutil.rmtree(VAR_0, ignore_errors=True)\n" ]
[ "def remove_directory_tree(path):...\n", "\"\"\"docstring\"\"\"\n", "if os.path.exists(path):\n", "shutil.rmtree(path, ignore_errors=True)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'" ]
[ "def FUNC_4(self):...\n", "return format_html('<td>{}</td>', self.format(self.get_value()))\n" ]
[ "def render(self):...\n", "return format_html('<td>{}</td>', self.format(self.get_value()))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_26(*VAR_29, **VAR_30):...\n", "" ]
[ "def raiseOSError(*_a, **_k):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "\"\"\"Bot interface used in bot_config.py.\"\"\"\n", "import logging\n", "import os\n", "import threading\n", "import time\n", "import os_utilities\n", "from utils import zip_package\n", "VAR_0 = os.path.abspath(zip_package.get_main_script_path())\n", "def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4,...
[ "\"\"\"Bot interface used in bot_config.py.\"\"\"\n", "import logging\n", "import os\n", "import threading\n", "import time\n", "import os_utilities\n", "from utils import zip_package\n", "THIS_FILE = os.path.abspath(zip_package.get_main_script_path())\n", "def __init__(self, remote, attributes, ser...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Docstring", "Return'" ]
[ "@memoized_property...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = {self.dist.real_home: '/dev/null/remapped_by_pants/java_home/',\n get_buildroot(): '/dev/null/remapped_by_pants/buildroot/', self.\n _zinc_factory.get_options().pants_workdir:\n '/dev/null/remapped_by_pants/workdir/'}\n", "return '-rebas...
[ "@memoized_property...\n", "\"\"\"docstring\"\"\"\n", "rebases = {self.dist.real_home: '/dev/null/remapped_by_pants/java_home/',\n get_buildroot(): '/dev/null/remapped_by_pants/buildroot/', self.\n _zinc_factory.get_options().pants_workdir:\n '/dev/null/remapped_by_pants/workdir/'}\n", "return '-reba...
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_1, VAR_2=None, **VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = schema_validator(VAR_1, **kwargs)\n", "if VAR_2 is not None:\n", "validate_object(VAR_2, VAR_4=schema, **kwargs)\n" ]
[ "def validate(raw_schema, target=None, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "schema = schema_validator(raw_schema, **kwargs)\n", "if target is not None:\n", "validate_object(target, schema=schema, **kwargs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_10(self):...\n", "VAR_6 = ('\"normal_string\"', '\"string with spaces\"',\n '\"string with quotes\\\\\"a\"', '\"string with s-quotes\\'b\"', '\"bsn \\n A\"',\n '\"unrecognized \\\\q escape\"')\n", "for string, result in zip(self.test_strings, VAR_6):\n", "self.assertEqual(prepare_string_argume...
[ "def test_prepare_string_argument_sh(self):...\n", "expected_results = ('\"normal_string\"', '\"string with spaces\"',\n '\"string with quotes\\\\\"a\"', '\"string with s-quotes\\'b\"', '\"bsn \\n A\"',\n '\"unrecognized \\\\q escape\"')\n", "for string, result in zip(self.test_strings, expected_results):...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'" ]
[ "def FUNC_0(self):...\n", "return {'user_id': self.user_id, 'username': self.username}\n" ]
[ "def to_dict(self):...\n", "return {'user_id': self.user_id, 'username': self.username}\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_16(self, VAR_5, VAR_6, VAR_19, VAR_8, VAR_9, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_58 = FUNC_2(VAR_5, VAR_6, VAR_19, VAR_8, VAR_9, VAR_10)\n", "if self.execute('string', VAR_58):\n", "self.save()\n", "logging.info('Added job %s to history', VAR_5.final_name)\n" ]
[ "def add_history_db(self, nzo, storage, path, postproc_time, script_output,...\n", "\"\"\"docstring\"\"\"\n", "t = build_history_info(nzo, storage, path, postproc_time, script_output,\n script_line)\n", "if self.execute(\n", "self.save()\n", "logging.info('Added job %s to history', nzo.final_name)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "@VAR_1.route('/chartdemoORIG', methods=['GET'])...\n", "return render_template('chartdemoORIG.html')\n" ]
[ "@app.route('/chartdemoORIG', methods=['GET'])...\n", "return render_template('chartdemoORIG.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_3(self, VAR_3, VAR_11=None):...\n", "if super(CLASS_3, self).allowed(VAR_3, VAR_11):\n", "self.verbose_name = _('Create Key Pair')\n", "return True\n" ]
[ "def allowed(self, request, keypair=None):...\n", "if super(CreateKeyPair, self).allowed(request, keypair):\n", "self.verbose_name = _('Create Key Pair')\n", "return True\n" ]
[ 0, 5, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_6(self):...\n", "VAR_5 = [{'cloudProvider': 'gce', 'asgName': self.__server_group_name,\n 'serverGroupName': self.__server_group_name, 'region': self.TEST_REGION,\n 'zone': self.TEST_ZONE, 'type': 'disableServerGroup', 'regions': [self.\n TEST_REGION], 'zones': [self.TEST_ZONE], 'credentials': ...
[ "def disable_server_group(self):...\n", "job = [{'cloudProvider': 'gce', 'asgName': self.__server_group_name,\n 'serverGroupName': self.__server_group_name, 'region': self.TEST_REGION,\n 'zone': self.TEST_ZONE, 'type': 'disableServerGroup', 'regions': [self.\n TEST_REGION], 'zones': [self.TEST_ZONE], 'cr...
[ 0, 0, 0, 1, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "@template_utility...\n", "VAR_3 = VAR_3 or get_current_http_request()\n", "assert VAR_3._xsrf_token is not None\n", "return VAR_3._xsrf_token\n" ]
[ "@template_utility...\n", "request = request or get_current_http_request()\n", "assert request._xsrf_token is not None\n", "return request._xsrf_token\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assert'", "Return'" ]
[ "def FUNC_18(self, VAR_19, VAR_13):...\n", "VAR_46 = self.container.page_num(VAR_13)\n", "for VAR_24 in self.opened_databases:\n", "if VAR_24.window.container.page_num(VAR_24.parent_widget) == VAR_46:\n", "self.container.remove_page(VAR_46)\n", "self.opened_databases.remove(VAR_24)\n", "self.update_tab_...
[ "def on_tab_close_button_clicked(self, sender, widget):...\n", "page_num = self.container.page_num(widget)\n", "for db in self.opened_databases:\n", "if db.window.container.page_num(db.parent_widget) == page_num:\n", "self.container.remove_page(page_num)\n", "self.opened_databases.remove(db)\n", "self.u...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "from __future__ import unicode_literals\n", "from django.db import models, migrations\n", "VAR_0 = [('exercise', '0006_auto_20150625_1823'), ('userprofile',\n '0002_auto_20150427_1717')]\n", "VAR_1 = [migrations.CreateModel(name='DeadlineRuleDeviation', fields=[('id',\n models.AutoField(primary_key=Tru...
[ "from __future__ import unicode_literals\n", "from django.db import models, migrations\n", "dependencies = [('exercise', '0006_auto_20150625_1823'), ('userprofile',\n '0002_auto_20150427_1717')]\n", "state_operations = [migrations.CreateModel(name='DeadlineRuleDeviation',\n fields=[('id', models.AutoFie...
[ 0, 0, 0, 4, 0 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_5(self, VAR_14):...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = self.file_db\n", "VAR_26 = VAR_25.getFileList()\n", "for f in VAR_26:\n", "if not f in VAR_14:\n", "VAR_25.deleteFile(f)\n" ]
[ "def checkFilesForDeletion(self, files):...\n", "\"\"\"docstring\"\"\"\n", "file_db = self.file_db\n", "DB_files = file_db.getFileList()\n", "for f in DB_files:\n", "if not f in files:\n", "file_db.deleteFile(f)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Condition", "Expr'" ]
[ "def FUNC_1(self, VAR_8, VAR_9):...\n", "if not VAR_9:\n", "VAR_22 = self.output_path(self.create_filename(VAR_9))\n", "VAR_23 = Header.parse(VAR_22)\n", "return VAR_8.is_newer_than(VAR_23)\n" ]
[ "def _is_newer(self, header_source, hostname):...\n", "if not hostname:\n", "output_path = self.output_path(self.create_filename(hostname))\n", "old_header = Header.parse(output_path)\n", "return header_source.is_newer_than(old_header)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_4(VAR_1, VAR_2, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = frozenset(VAR_2)\n", "VAR_7 = VAR_1 - VAR_2\n", "if VAR_7:\n", "VAR_22 = ' missing: %s' % sorted(VAR_7) if VAR_7 else ''\n", "return 'Unexpected %s%s; did you make a typo?' % (VAR_3, VAR_22)\n" ]
[ "def has_missing_keys(minimum_keys, actual_keys, name):...\n", "\"\"\"docstring\"\"\"\n", "actual_keys = frozenset(actual_keys)\n", "missing = minimum_keys - actual_keys\n", "if missing:\n", "msg_missing = ' missing: %s' % sorted(missing) if missing else ''\n", "return 'Unexpected %s%s; did you make a t...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_11(self):...\n", "for string in self.test_strings:\n", "self.assertEqual(prepare_string_argument(string, 'WeIrD_O/S'), string)\n" ]
[ "def test_prepare_string_argument_unsupported(self):...\n", "for string in self.test_strings:\n", "self.assertEqual(prepare_string_argument(string, 'WeIrD_O/S'), string)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_2(self, VAR_1, VAR_2, *VAR_3, **VAR_4):...\n", "self.handled_resp = VAR_1\n", "self.handled_remote = VAR_2\n", "self.handled_args = VAR_3\n", "self.handled_kwargs = VAR_4\n", "return 'TEST'\n" ]
[ "def handler(self, resp, remote, *args, **kwargs):...\n", "self.handled_resp = resp\n", "self.handled_remote = remote\n", "self.handled_args = args\n", "self.handled_kwargs = kwargs\n", "return 'TEST'\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_12(VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = argparse.ArgumentParser()\n", "VAR_14.add_argument('message')\n", "return VAR_14.parse_args(VAR_3)\n" ]
[ "def parse_arguments(arguments):...\n", "\"\"\"docstring\"\"\"\n", "parser = argparse.ArgumentParser()\n", "parser.add_argument('message')\n", "return parser.parse_args(arguments)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_29(VAR_42):...\n", "\"\"\"docstring\"\"\"\n", "VAR_42 = str(VAR_42)\n", "if len(VAR_42) < 4:\n", "VAR_42 += '__'\n", "VAR_54 = VAR_42[0:3]\n", "VAR_55 = VAR_42[3].replace('_', '')\n", "VAR_56 = VAR_42[4].replace('_', '')\n", "return VAR_54, VAR_55, VAR_56\n" ]
[ "def _parse_marc_code(field):...\n", "\"\"\"docstring\"\"\"\n", "field = str(field)\n", "if len(field) < 4:\n", "field += '__'\n", "tag = field[0:3]\n", "ind1 = field[3].replace('_', '')\n", "ind2 = field[4].replace('_', '')\n", "return tag, ind1, ind2\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "if VAR_18._check_executable(VAR_0):\n", "if VAR_19 is None:\n", "return repr(VAR_0) + ' is not installed.'\n", "return True\n", "check_call(VAR_19, stdout=DEVNULL, stderr=DEVNULL)\n", "return VAR_20\n", "return True\n" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "if cls._check_executable(executable):\n", "if command is None:\n", "return repr(executable) + ' is not installed.'\n", "return True\n", "check_call(command, stdout=DEVNULL, stderr=DEVNULL)\n", "return fail_msg\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Condition", "Return'", "Return'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_8(self, VAR_12=False):...\n", "VAR_86 = self.rules\n", "if VAR_12:\n", "VAR_86 = filterfalse(Rule.has_wildcards, VAR_86)\n", "for VAR_13 in VAR_86:\n", "logger.rule_info(VAR_10=rule.name, docstring=rule.docstring)\n" ]
[ "def list_rules(self, only_targets=False):...\n", "rules = self.rules\n", "if only_targets:\n", "rules = filterfalse(Rule.has_wildcards, rules)\n", "for rule in rules:\n", "logger.rule_info(name=rule.name, docstring=rule.docstring)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "For", "Docstring" ]
[ "def FUNC_41(self):...\n", "\"\"\"docstring\"\"\"\n", "self.cursor.execute('create table t1(a int, b varchar(10))')\n", "VAR_28 = [(1, 'test')]\n", "self.cursor.executemany('insert into t1(a, b) values (?,?)', VAR_28)\n", "VAR_26 = self.cursor.execute('select count(*) from t1').fetchone()[0]\n", "self.a...
[ "def test_executemany_one(self):...\n", "\"\"\"docstring\"\"\"\n", "self.cursor.execute('create table t1(a int, b varchar(10))')\n", "params = [(1, 'test')]\n", "self.cursor.executemany('insert into t1(a, b) values (?,?)', params)\n", "count = self.cursor.execute('select count(*) from t1').fetchone()[0]\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "For", "Expr'", "Expr'" ]
[ "def FUNC_3(VAR_1, VAR_2, VAR_3='', VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "return FUNC_4(VAR_1, VAR_2['access_token'], VAR_6='', VAR_3=token_type,\n VAR_4=extra_data)\n" ]
[ "def oauth2_token_setter(remote, resp, token_type='', extra_data=None):...\n", "\"\"\"docstring\"\"\"\n", "return token_setter(remote, resp['access_token'], secret='', token_type=\n token_type, extra_data=extra_data)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_0(self, VAR_1):...\n", "VAR_4 = 'string' % (VAR_1, VAR_1, VAR_1)\n", "VAR_5 = sql.queryDB(self.conn, VAR_4)\n", "return VAR_5\n" ]
[ "def getAllPosts(self, userid):...\n", "sqlText = (\n 'select users.name,post.comment,post.postid,(select Count(*) from post_like where post.postid = post_like.postid) as like, (select Count(*) from post_like where post.postid =post_like.postid and post_like.useri...
[ 0, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_5(self, VAR_12, VAR_13):...\n", "super().validate(VAR_12, VAR_13)\n", "VAR_21 = {'cls': self.encoder} if self.encoder else {}\n", "json.dumps(VAR_12, **options)\n" ]
[ "def validate(self, value, model_instance):...\n", "super().validate(value, model_instance)\n", "options = {'cls': self.encoder} if self.encoder else {}\n", "json.dumps(value, **options)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'" ]
[ "from pykeg.core import models\n", "from django.core.urlresolvers import reverse\n", "from django.http import HttpResponse\n", "from django.http import HttpResponseRedirect\n", "from django.shortcuts import get_object_or_404\n", "def FUNC_0(self, VAR_0, VAR_1, VAR_2, VAR_3):...\n", "\"\"\"docstring\"\"\...
[ "from pykeg.core import models\n", "from django.core.urlresolvers import reverse\n", "from django.http import HttpResponse\n", "from django.http import HttpResponseRedirect\n", "from django.shortcuts import get_object_or_404\n", "def process_view(self, request, view_func, view_args, view_kwargs):...\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import os\n", "import sys\n", "import base64\n", "import json\n", "from collections import defaultdict\n", "from itertools import chain\...
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import os\n", "import sys\n", "import base64\n", "import json\n", "from collections import defaultdict\n", "from itertools import chain\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0 ]
[ "Assign'", "Assign'", "Assign'", "Assign'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_7, *VAR_15, **VAR_16):...\n", "CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n" ]
[ "def __init__(self, param, *a, **kw):...\n", "Validator.__init__(self, param, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def __init__(self, VAR_61=False, VAR_62=False, VAR_63='rate_', *VAR_15, **...\n", "self.rate_user = VAR_61\n", "self.rate_ip = VAR_62\n", "self.prefix = VAR_63\n", "CLASS_0.__init__(self, *VAR_15, **kw)\n" ]
[ "def __init__(self, rate_user=False, rate_ip=False, prefix='rate_', *a, **kw):...\n", "self.rate_user = rate_user\n", "self.rate_ip = rate_ip\n", "self.prefix = prefix\n", "Validator.__init__(self, *a, **kw)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_1, VAR_7, VAR_11, VAR_4=None):...\n", "GenericRequest.__init__(self, VAR_1, VAR_4)\n", "self.url = '%stasks/%s/submissions/%s/token' % (self.base_url, VAR_7[1], VAR_11\n )\n", "self.task = VAR_7\n", "self.submission_num = VAR_11\n", "self.data = {}\n" ]
[ "def __init__(self, browser, task, submission_num, base_url=None):...\n", "GenericRequest.__init__(self, browser, base_url)\n", "self.url = '%stasks/%s/submissions/%s/token' % (self.base_url, task[1],\n submission_num)\n", "self.task = task\n", "self.submission_num = submission_num\n", "self.data = {}\...
[ 0, 0, 5, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@integration_synonym_api...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'MCGREGOR', VAR_7='1')\n", "FUNC_5(VAR_4, VAR_5, VAR_11='MACGREGOR', VAR_10=[{'name': '----MACGREGOR'},\n {'name': 'MCGREGOR'}])\n" ]
[ "@integration_synonym_api...\n", "clean_database(solr)\n", "seed_database_with(solr, 'MCGREGOR', id='1')\n", "verify_results(client, jwt, query='MACGREGOR', expected=[{'name':\n '----MACGREGOR'}, {'name': 'MCGREGOR'}])\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "@staticmethod...\n", "def FUNC_13(self, *VAR_16, **VAR_10):...\n", "if not self.current_user or not self.current_user.admin:\n", "return VAR_7(self, *VAR_16, **kwargs)\n" ]
[ "@staticmethod...\n", "def wrapper(self, *args, **kwargs):...\n", "if not self.current_user or not self.current_user.admin:\n", "return method(self, *args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_6(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = self.redirect_url\n", "if is_authenticated(VAR_1.user):\n", "VAR_13 = import_from_settings('OIDC_OP_LOGOUT_URL_METHOD', '')\n", "return HttpResponseRedirect(VAR_12)\n", "if VAR_13:\n", "VAR_12 = import_string(VAR_13)()\n", "auth.l...
[ "def post(self, request):...\n", "\"\"\"docstring\"\"\"\n", "logout_url = self.redirect_url\n", "if is_authenticated(request.user):\n", "logout_from_op = import_from_settings('OIDC_OP_LOGOUT_URL_METHOD', '')\n", "return HttpResponseRedirect(logout_url)\n", "if logout_from_op:\n", "logout_url = import_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_29(self, VAR_77):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.priority = VAR_77\n", "return VAR_101\n" ]
[ "def priority(self, priority):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.priority = priority\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_11(self, VAR_18):...\n", "if type(VAR_18) == str:\n", "VAR_18 = self.locate(VAR_18)\n", "if not VAR_18:\n", "return False\n", "if not VAR_18.is_dir:\n", "VAR_18 = VAR_18.parent\n", "VAR_30, VAR_41, VAR_42, VAR_43, VAR_46, VAR_47 = self._sqlify_fsnode(VAR_18)\n", "if not VAR_18.is_dir:\n", ...
[ "def _update_in_db(self, item):...\n", "if type(item) == str:\n", "item = self.locate(item)\n", "if not item:\n", "return False\n", "if not item.is_dir:\n", "item = item.parent\n", "(n_uuid, n_file_name, n_owner, n_upload_time, n_sub_folders_str,\n n_sub_files_str) = self._sqlify_fsnode(item)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Expr'", "Return'" ]
[ "def FUNC_25(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 8}, 'CONFIDENCE': {'MEDIUM': 8}}\n", "self.check_example('os-exec.py', VAR_2)\n" ]
[ "def test_os_exec(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 8}, 'CONFIDENCE': {'MEDIUM': 8}}\n", "self.check_example('os-exec.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_15(self, VAR_14):...\n", "" ]
[ "def is_date(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_8(VAR_12):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = pyramid.request.Request({'HTTP_COOKIE': '{0}={1}'.format(VAR_5.\n registry.settings['session.cookie_name'], VAR_12)})\n", "VAR_20 = VAR_8(VAR_14)\n", "return VAR_20 and VAR_20.get('admin')\n" ]
[ "def authenticator(key):...\n", "\"\"\"docstring\"\"\"\n", "request = pyramid.request.Request({'HTTP_COOKIE': '{0}={1}'.format(config.\n registry.settings['session.cookie_name'], key)})\n", "session_data = session_factory(request)\n", "return session_data and session_data.get('admin')\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = [VAR_28.mtime for VAR_28 in self.expanded_output if VAR_28.exists]\n", "if self.benchmark and self.benchmark.exists:\n", "VAR_17.append(self.benchmark.mtime)\n", "if VAR_17:\n", "return min(VAR_17)\n", "return None\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "existing = [f.mtime for f in self.expanded_output if f.exists]\n", "if self.benchmark and self.benchmark.exists:\n", "existing.append(self.benchmark.mtime)\n", "if existing:\n", "return min(existing)\n", "return None\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Expr'", "Condition", "Return'", "Return'" ]
[ "def FUNC_25(self, VAR_14):...\n", "" ]
[ "def is_fk(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __gt__(self, VAR_16):...\n", "VAR_39 = self.workflow._ruleorder.compare(self, VAR_16)\n", "return VAR_39 > 0\n" ]
[ "def __gt__(self, rule):...\n", "comp = self.workflow._ruleorder.compare(self, rule)\n", "return comp > 0\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_1(VAR_2, VAR_3, VAR_4, VAR_5, VAR_1, VAR_6, VAR_7):...\n", "if ' ' in VAR_2:\n", "VAR_6('Invalid nick')\n", "VAR_14 = database.get(VAR_1, 'channels', 'votekick', 'chan', VAR_4)\n", "VAR_14 = 10\n", "VAR_15 = database.get(VAR_1, 'channels', 'voteban', 'chan', VAR_4)\n", "VAR_15 = 10\n", "if l...
[ "def process_vote(target, action, chan, mask, db, notice, conn):...\n", "if ' ' in target:\n", "notice('Invalid nick')\n", "votes2kick = database.get(db, 'channels', 'votekick', 'chan', chan)\n", "votes2kick = 10\n", "votes2ban = database.get(db, 'channels', 'voteban', 'chan', chan)\n", "votes2ban = 10\...
[ 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, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Expr'", "Condition", "Condition", "Return'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Conditi...
[ "def FUNC_1(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = 'string'.format(VAR_2)\n", "return FUNC_0(VAR_1)\n" ]
[ "def get_top_popular(top_num):...\n", "\"\"\"docstring\"\"\"\n", "cmd = (\n \"\"\"SELECT title, views FROM articles\n INNER JOIN (\n SELECT path, count(path) AS views\n FROM log GROUP BY log.path\n ) AS log\n ON log.path = '/article/' || articles.sl...
[ 0, 0, 4, 4 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_11(self):...\n", "self.cursor.execute('string', [self.campaign['id']])\n", "self.cursor.execute('string', [self.campaign['id']])\n", "self.cursor.execute(\n 'DELETE FROM log_injection WHERE result_id IN (SELECT id FROM log_result WHERE campaign_id=?)'\n , [self.campaign['id']])\n", "self.cur...
[ "def delete_results(self):...\n", "self.cursor.execute(\n 'DELETE FROM log_simics_memory_diff WHERE result_id IN (SELECT id FROM log_result WHERE campaign_id=?)'\n , [self.campaign['id']])\n", "self.cursor.execute(\n 'DELETE FROM log_simics_register_diff WHERE result_id IN (SELECT id FROM log_result WH...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_1(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_30 = list(VAR_1.router.match_routes)\n", "VAR_30.extend(v for k, v in VAR_1.router.build_routes.iteritems() if v not in\n VAR_1.router.match_routes)\n", "return [r for r in VAR_30 if issubclass(r.handler, CLASS_2)]\n" ]
[ "def get_authenticated_routes(app):...\n", "\"\"\"docstring\"\"\"\n", "routes = list(app.router.match_routes)\n", "routes.extend(v for k, v in app.router.build_routes.iteritems() if v not in\n app.router.match_routes)\n", "return [r for r in routes if issubclass(r.handler, AuthenticatingHandler)]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "import os\n", "from . import vcstool_clients\n", "def FUNC_0(VAR_0):...\n", "VAR_1 = []\n", "VAR_2 = FUNC_1(VAR_0)\n", "if VAR_2:\n", "VAR_1.append(VAR_2)\n", "VAR_3 = os.listdir(VAR_0)\n", "VAR_3 = []\n", "for name in VAR_3:\n", "return VAR_1\n", "VAR_4 = os.path.join(VAR_0, name)\n", "if ...
[ "import os\n", "from . import vcstool_clients\n", "def find_repositories(path):...\n", "repos = []\n", "client = get_vcs_client(path)\n", "if client:\n", "repos.append(client)\n", "listdir = os.listdir(path)\n", "listdir = []\n", "for name in listdir:\n", "return repos\n", "subpath = os.path.j...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1 ]
[ "Import'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "For", "Return'", "Assign'", "Condition", "AugAssign'" ]
[ "def __init__(self, VAR_18, VAR_35=200, **VAR_16):...\n", "CLASS_17.__init__(self, VAR_18, VAR_35=length, VAR_36=errors.NO_TITLE,\n VAR_37=errors.TITLE_TOO_LONG, **kw)\n" ]
[ "def __init__(self, item, length=200, **kw):...\n", "VLength.__init__(self, item, length=length, empty_error=errors.NO_TITLE,\n length_error=errors.TITLE_TOO_LONG, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def __call__(self):...\n", "return self\n" ]
[ "def __call__(self):...\n", "return self\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_4(self, VAR_12):...\n", "if VAR_12 is not None:\n", "return CLASS_0(VAR_12, VAR_2=self.encoder)\n", "return VAR_12\n" ]
[ "def get_prep_value(self, value):...\n", "if value is not None:\n", "return JsonAdapter(value, encoder=self.encoder)\n", "return value\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_11(self, VAR_14):...\n", "" ]
[ "def is_integer(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "import os\n", "from flask import Flask, g, url_for\n", "from flask_sqlalchemy import SQLAlchemy\n", "from flask_migrate import Migrate\n", "from flask_admin import Admin, helpers\n", "from flask_security import Security\n", "from flask_login import LoginManager\n", "from flask_uploads import patch_re...
[ "import os\n", "from flask import Flask, g, url_for\n", "from flask_sqlalchemy import SQLAlchemy\n", "from flask_migrate import Migrate\n", "from flask_admin import Admin, helpers\n", "from flask_security import Security\n", "from flask_login import LoginManager\n", "from flask_uploads import patch_re...
[ 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "...
[ "def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n", "CLASS_3.__init__(self, VAR_18, errors.NO_URL, *VAR_15, **kw)\n" ]
[ "def __init__(self, item, *a, **kw):...\n", "VRequired.__init__(self, item, errors.NO_URL, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@mock.patch('requests.post', FUNC_0)...\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_7 = {'image': 'autotest/example'}\n", "VAR_5 = self.cl...
[ "@mock.patch('requests.post', mock_import_repository_task)...\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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assi...
[ "import unittest\n", "import mock\n", "from nose.tools import eq_\n", "from opennode.oms.endpoint.ssh.protocol import OmsSshProtocol\n", "from opennode.oms.endpoint.ssh import cmd\n", "def FUNC_0(self):...\n", "self.oms_ssh = OmsSshProtocol()\n", "self.terminal = mock.Mock()\n", "self.oms_ssh.termin...
[ "import unittest\n", "import mock\n", "from nose.tools import eq_\n", "from opennode.oms.endpoint.ssh.protocol import OmsSshProtocol\n", "from opennode.oms.endpoint.ssh import cmd\n", "def setUp(self):...\n", "self.oms_ssh = OmsSshProtocol()\n", "self.terminal = mock.Mock()\n", "self.oms_ssh.termina...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "FunctionDef'", "For", "Expr'", "FunctionDef'", "Expr'", "Expr'", "Expr'", "FunctionDef'", "Expr'"...
[ "def FUNC_12(VAR_24):...\n", "VAR_38 = argparse.ArgumentParser(description=\n 'Reads and merges JSON configuration files specified by colon separated environment variable OS_CONFIG_FILES, unless overridden by command line option --metadata. If no files are specified this way, falls back to legacy behavior of s...
[ "def parse_opts(argv):...\n", "parser = argparse.ArgumentParser(description=\n 'Reads and merges JSON configuration files specified by colon separated environment variable OS_CONFIG_FILES, unless overridden by command line option --metadata. If no files are specified this way, falls back to legacy behavior of ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_22(self):...\n", "\"\"\"docstring\"\"\"\n", "if not self.name:\n", "set_new_name(self)\n", "if not self.creation:\n", "self.creation = self.modified = now()\n", "VAR_6 = self.get_valid_dict(VAR_13=True)\n", "self.created_by = self.modifield_by = VAR_54.session.user\n", "VAR_33 = list(VAR_6...
[ "def db_insert(self):...\n", "\"\"\"docstring\"\"\"\n", "if not self.name:\n", "set_new_name(self)\n", "if not self.creation:\n", "self.creation = self.modified = now()\n", "d = self.get_valid_dict(convert_dates_to_str=True)\n", "self.created_by = self.modifield_by = frappe.session.user\n", "columns...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Condition", "Condition", "Condition", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_5(self):...\n", "if not self._server_popen:\n", "return -1\n", "return self._server_popen.pid\n" ]
[ "def ServerPid(self):...\n", "if not self._server_popen:\n", "return -1\n", "return self._server_popen.pid\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_7(self, VAR_9, VAR_11=None):...\n", "get_and_check_project(VAR_9, VAR_11)\n", "VAR_25 = self.queryset.filter(VAR_1=project_pk)\n", "VAR_25 = filters.OrderingFilter().filter_queryset(self.request, VAR_25, self)\n", "VAR_26 = CLASS_1(VAR_25, many=True)\n", "return Response(VAR_26.data)\n" ]
[ "def list(self, request, project_pk=None):...\n", "get_and_check_project(request, project_pk)\n", "tasks = self.queryset.filter(project=project_pk)\n", "tasks = filters.OrderingFilter().filter_queryset(self.request, tasks, self)\n", "serializer = TaskSerializer(tasks, many=True)\n", "return Response(seria...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_1(VAR_1):...\n", "VAR_3 = [_('Employee') + ':Link/Employee:150', _('Employee Name') + '::200',\n _('Department') + '::150']\n", "for leave_type in VAR_1:\n", "VAR_3.append(_(leave_type) + ' ' + _('Opening') + ':Float:160')\n", "return VAR_3\n", "VAR_3.append(_(leave_type) + ' ' + _('Taken') +...
[ "def get_columns(leave_types):...\n", "columns = [_('Employee') + ':Link/Employee:150', _('Employee Name') +\n '::200', _('Department') + '::150']\n", "for leave_type in leave_types:\n", "columns.append(_(leave_type) + ' ' + _('Opening') + ':Float:160')\n", "return columns\n", "columns.append(_(leave_t...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_0, *VAR_2, **VAR_3):...\n", "VAR_11 = ShortUrlForm(VAR_0.POST or None)\n", "if VAR_11.is_valid():\n", "VAR_18 = VAR_11.cleaned_data['input_url']\n", "return render(VAR_0, 'home.html', {'form': VAR_11})\n", "VAR_19 = VAR_11.cleaned_data['category']\n", "VAR_20 = JustURL.objects.crea...
[ "def post(self, request, *args, **kwargs):...\n", "form = ShortUrlForm(request.POST or None)\n", "if form.is_valid():\n", "url = form.cleaned_data['input_url']\n", "return render(request, 'home.html', {'form': form})\n", "category = form.cleaned_data['category']\n", "created = JustURL.objects.create(inp...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Return'", "Return'" ]
[ "from flask import render_template, request, redirect, url_for\n", "from flask_login import login_user, logout_user\n", "from application import app, db\n", "from application.views import render_form\n", "from application.auth.models import User\n", "from application.auth.forms import LoginForm, RegisterF...
[ "from flask import render_template, request, redirect, url_for\n", "from flask_login import login_user, logout_user\n", "from application import app, db\n", "from application.views import render_form\n", "from application.auth.models import User\n", "from application.auth.forms import LoginForm, RegisterF...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_1(self, VAR_2):...\n", "self.read_xsrf_token(VAR_2.base_url)\n", "VAR_2.execute()\n" ]
[ "def login(self, login_request):...\n", "self.read_xsrf_token(login_request.base_url)\n", "login_request.execute()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "VAR_0 = ['', 'home', 'root']\n", "VAR_1 = []\n", "VAR_2 = []\n", "VAR_3 = [] or ['', 'home', 'root']\n", "def FUNC_0():...\n", "if VAR_9 in VAR_1:\n", "print('Directory already exist.')\n", "VAR_1.append(VAR_9)\n", "def FUNC_1():...\n", "VAR_2.append(VAR_9)\n", "if VAR_2 == VAR_0:\n", "VAR_2 ...
[ "root = ['', 'home', 'root']\n", "dirs = []\n", "path = []\n", "curr_path = [] or ['', 'home', 'root']\n", "def mkdir():...\n", "if dir in dirs:\n", "print('Directory already exist.')\n", "dirs.append(dir)\n", "def ls():...\n", "path.append(dir)\n", "if path == root:\n", "path = dirs\n", "pr...
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Expr'", "Expr'", "FunctionDef'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'", "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "FunctionDef'", "Expr'", ...
[ "def __setitem__(self, VAR_3, VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = self.url_to_path(VAR_3)\n", "VAR_7 = os.path.dirname(VAR_6)\n", "if not os.path.exists(VAR_7):\n", "os.makedirs(VAR_7)\n", "VAR_8 = pickle.dumps(VAR_4)\n", "if self.compress:\n", "logger.info('Saving...')\n", "fp.writ...
[ "def __setitem__(self, url, result):...\n", "\"\"\"docstring\"\"\"\n", "path = self.url_to_path(url)\n", "folder = os.path.dirname(path)\n", "if not os.path.exists(folder):\n", "os.makedirs(folder)\n", "data = pickle.dumps(result)\n", "if self.compress:\n", "logger.info('Saving...')\n", "fp.write(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_10(self):...\n", "self.run_test_case(self.scenario.create_load_balancer())\n" ]
[ "def test_a_create_load_balancer(self):...\n", "self.run_test_case(self.scenario.create_load_balancer())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.create_snapshot(VAR_9)\n", "self.common.client_logout()\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.create_snapshot(snapshot)\n", "self.common.client_logout()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_4(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n" ]
[ "def test_filters_2(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = VAR_19()\n", "VAR_6.subject = VAR_20.subject\n", "VAR_6.message = VAR_20.message\n", "VAR_6.from_user_id = VAR_20.from_user_id\n", "VAR_6.to_user_id = VAR_9\n", "VAR_6.project_id = VAR_20.project_id\n", "VAR_6.task_id = VAR_20.task_id\n", "i...
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "message = cls()\n", "message.subject = dto.subject\n", "message.message = dto.message\n", "message.from_user_id = dto.from_user_id\n", "message.to_user_id = to_user_id\n", "message.project_id = dto.project_id\n", "message.task_id = dto.task_id\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_19(VAR_8, **VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_8.format(**{wildcard: '{{{},{}}}'.format(wildcard, '|'.join(\n values)) for wildcard, values in wildcards.items()})\n" ]
[ "def limit(pattern, **wildcards):...\n", "\"\"\"docstring\"\"\"\n", "return pattern.format(**{wildcard: '{{{},{}}}'.format(wildcard, '|'.join(\n values)) for wildcard, values in wildcards.items()})\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]