lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_6(self, VAR_33):...\n", "VAR_78 = []\n", "for v in self.splitter.split(VAR_33):\n", "VAR_21 = self.id_re.match(v)\n", "return VAR_78\n", "if VAR_21:\n", "VAR_108 = CLASS_5(None, False).run(VAR_21.group(1))\n", "if VAR_108:\n", "VAR_78.append(VAR_108)\n" ]
[ "def run(self, val):...\n", "res = []\n", "for v in self.splitter.split(val):\n", "link_id = self.id_re.match(v)\n", "return res\n", "if link_id:\n", "l = VLink(None, False).run(link_id.group(1))\n", "if l:\n", "res.append(l)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_0(VAR_2):...\n", "if VAR_2.user.is_authenticated():\n", "VAR_33 = VAR_2.GET.get('next', reverse('home'))\n", "VAR_1.error('login() - got anonymous user: %s' % VAR_2.META)\n", "return HttpResponseRedirect(VAR_33)\n", "return HttpResponseServerError(\n 'Internet Server error. Please contact %s ...
[ "def login(request):...\n", "if request.user.is_authenticated():\n", "next_url = request.GET.get('next', reverse('home'))\n", "logger.error('login() - got anonymous user: %s' % request.META)\n", "return HttpResponseRedirect(next_url)\n", "return HttpResponseServerError(\n 'Internet Server error. Please...
[ 0, 0, 6, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_2(self):...\n", "return sqlite\n" ]
[ "def dbapiModule(self):...\n", "return sqlite\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_11(self, VAR_9, *VAR_13, **VAR_14):...\n", "VAR_14['partial'] = True\n", "return self.update(VAR_9, *VAR_13, **kwargs)\n" ]
[ "def partial_update(self, request, *args, **kwargs):...\n", "kwargs['partial'] = True\n", "return self.update(request, *args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_25=settings.CLICKHOUSE_SERVER.split(':')[0], VAR_26=...\n", "self.host = VAR_25\n", "self.port = VAR_26\n", "self.connect_timeout = VAR_27\n", "self.send_receive_timeout = VAR_28\n", "self.client_settings = VAR_30\n", "self.metrics = VAR_31\n", "self.pool = queue.LifoQueue(VAR_...
[ "def __init__(self, host=settings.CLICKHOUSE_SERVER.split(':')[0], port=int(...\n", "self.host = host\n", "self.port = port\n", "self.connect_timeout = connect_timeout\n", "self.send_receive_timeout = send_receive_timeout\n", "self.client_settings = client_settings\n", "self.metrics = metrics\n", "sel...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'" ]
[ "def FUNC_13(self, *VAR_13, **VAR_14):...\n", "for VAR_9 in VAR_13:\n", "self._set_log_item(VAR_9)\n", "for VAR_10, VAR_9 in VAR_14.items():\n", "self._set_log_item(VAR_9, VAR_10=name)\n" ]
[ "def set_log(self, *logs, **kwlogs):...\n", "for item in logs:\n", "self._set_log_item(item)\n", "for name, item in kwlogs.items():\n", "self._set_log_item(item, name=name)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "For", "Expr'" ]
[ "def FUNC_8(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n", "self._mox.ReplayAll()\n", "self.assertIsNone(url_helper.UrlOpen('url', max_tries=1))\n", "self._mox.VerifyAll()\n" ]
[ "def testUrlOpenFailure(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n", "self._mox.ReplayAll()\n", "self.assertIsNone(url_helper.UrlOpen('url', max_tries=1))\n", "self._mox.VerifyAll()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "super(CLASS_0, self).__init__()\n", "os.makedirs(path.join(VAR_1, DATABASES_FOLDER_NAME), exist_ok=True)\n", "self.filename = path.join(VAR_1, DATABASES_FOLDER_NAME, VAR_3 + '.db')\n", "self.lock = Lock()\n", "VAR_13 = {'type': 0, 'meta': 's...
[ "def __init__(self, filename):...\n", "\"\"\"docstring\"\"\"\n", "super(FileDB, self).__init__()\n", "os.makedirs(path.join(SCRIPT_FOLDER, DATABASES_FOLDER_NAME), exist_ok=True)\n", "self.filename = path.join(SCRIPT_FOLDER, DATABASES_FOLDER_NAME, filename +\n '.db')\n", "self.lock = Lock()\n", "initi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "For", "Expr'", "Expr'" ]
[ "def FUNC_11(VAR_16, VAR_17, VAR_18=True):...\n", "if isinstance(VAR_16, CLASS_1):\n", "VAR_16.flags[VAR_17] = VAR_18\n", "if FUNC_10(VAR_16):\n", "return VAR_16\n", "VAR_16 = CLASS_1(VAR_16)\n", "return [VAR_19(v, VAR_17, VAR_18=flag_value) for v in VAR_16]\n", "VAR_16.flags[VAR_17] = VAR_18\n", "r...
[ "def flag(value, flag_type, flag_value=True):...\n", "if isinstance(value, AnnotatedString):\n", "value.flags[flag_type] = flag_value\n", "if not_iterable(value):\n", "return value\n", "value = AnnotatedString(value)\n", "return [flag(v, flag_type, flag_value=flag_value) for v in value]\n", "value.fla...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Return'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_7, VAR_57, VAR_58=True, **VAR_16):...\n", "self.nav = VAR_57\n", "self.remember = VAR_58\n", "VAR_7 = VAR_57.get_param, VAR_7\n", "CLASS_0.__init__(self, VAR_7, **kw)\n" ]
[ "def __init__(self, param, menu_cls, remember=True, **kw):...\n", "self.nav = menu_cls\n", "self.remember = remember\n", "param = menu_cls.get_param, param\n", "Validator.__init__(self, param, **kw)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_10, VAR_9):...\n", "VAR_0.info('Updating table c{} in the MySQL database'.format(VAR_9))\n", "VAR_0.info('Requesting for MySQL connection')\n", "VAR_11 = self.get_connection()\n", "VAR_18 = VAR_11.cursor()\n", "for l in VAR_10:\n", "if not isinstance(l, Listing):\n", "return 0\n"...
[ "def update_table(self, listings, cat_id):...\n", "logger.info('Updating table c{} in the MySQL database'.format(cat_id))\n", "logger.info('Requesting for MySQL connection')\n", "db = self.get_connection()\n", "cursor = db.cursor()\n", "for l in listings:\n", "if not isinstance(l, Listing):\n", "retur...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Assign'", "Assign'", "For", "Condition", "Return'", "Expr'", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_8(VAR_13, VAR_16):...\n", "VAR_35 = subprocess.Popen([VAR_13], stdin=subprocess.PIPE, VAR_36=\n subprocess.PIPE, VAR_37=subprocess.PIPE)\n", "VAR_36, VAR_37 = VAR_35.communicate(json.dumps(VAR_16))\n", "VAR_35.wait()\n", "if VAR_35.returncode != 0:\n", "return VAR_36\n" ]
[ "def render_executable(path, config):...\n", "p = subprocess.Popen([path], stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n", "stdout, stderr = p.communicate(json.dumps(config))\n", "p.wait()\n", "if p.returncode != 0:\n", "return stdout\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Condition", "Return'" ]
[ "def FUNC_20():...\n", "VAR_61 = Popen(['git', 'ls-tree', '-r', '--name-only', 'HEAD'], stdout=PIPE,\n VAR_37=env)\n", "VAR_62 = VAR_61.communicate()[0]\n", "if VAR_61.returncode != 0 or not VAR_62.strip():\n", "return None\n", "return [e.strip() for e in VAR_62.splitlines() if os.path.exists(e)]\n" ]
[ "def tracked_files():...\n", "p = Popen(['git', 'ls-tree', '-r', '--name-only', 'HEAD'], stdout=PIPE, env=env\n )\n", "out = p.communicate()[0]\n", "if p.returncode != 0 or not out.strip():\n", "return None\n", "return [e.strip() for e in out.splitlines() if os.path.exists(e)]\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def __init__(VAR_39, VAR_40, VAR_41, VAR_42, VAR_48, VAR_43, VAR_44, VAR_45,...\n", "VAR_39.returncode = None\n", "VAR_39._out_file = VAR_7.path.join(self.root_dir, 'work',\n 'task_runner_out.json')\n", "VAR_6 = [sys.executable, bot_main.THIS_FILE, 'task_runner',\n '--swarming-server', VAR_3, '--in-fil...
[ "def __init__(self2, cmd, detached, cwd, env, stdout, stderr, stdin, close_fds):...\n", "self2.returncode = None\n", "self2._out_file = os.path.join(self.root_dir, 'work', 'task_runner_out.json')\n", "expected = [sys.executable, bot_main.THIS_FILE, 'task_runner',\n '--swarming-server', url, '--in-file', os...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_6(self):...\n", "return True\n" ]
[ "def Done(self):...\n", "return True\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_40(self):...\n", "" ]
[ "def _update_sortkey(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(VAR_3):...\n", "if not VAR_3:\n", "return VAR_3\n", "if VAR_1.match(VAR_3):\n", "return VAR_3\n", "return u'{}`{}`'.format(*VAR_2.match(VAR_3).groups())\n" ]
[ "def escape_col(col):...\n", "if not col:\n", "return col\n", "if ESCAPE_RE.match(col):\n", "return col\n", "return u'{}`{}`'.format(*NEGATE_RE.match(col).groups())\n" ]
[ 0, 0, 0, 4, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(VAR_0=None, VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_0 is None:\n", "VAR_0 = active_view()\n", "if not get_settings(VAR_0, 'anaconda_go_linting', True):\n", "return\n", "if VAR_0.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n", "anaconda_sublime.erase_lint_marks(VAR_...
[ "def fast_linters(view=None, hook=None):...\n", "\"\"\"docstring\"\"\"\n", "if view is None:\n", "view = active_view()\n", "if not get_settings(view, 'anaconda_go_linting', True):\n", "return\n", "if view.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n", "anaconda_sublime.erase_lint_marks(view...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Return'", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_6(self):...\n", "if not (VAR_101.user_is_loggedin and VAR_101.site.is_moderator(VAR_101.user\n", "abort(403, 'forbidden')\n" ]
[ "def run(self):...\n", "if not (c.user_is_loggedin and c.site.is_moderator(c.user) or c.user_is_admin):\n", "abort(403, 'forbidden')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'" ]
[ "def FUNC_17(self, VAR_14):...\n", "" ]
[ "def is_relation(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __str__(self):...\n", "VAR_23 = '{type}: {from_to_url}'\n", "if self.redirect_type in ['prefix', 'page', 'exact']:\n", "return VAR_23.format(type=self.get_redirect_type_display(), from_to_url=\n self.get_from_to_url_display())\n", "return ugettext('Redirect: {}'.format(self.get_redirect_type_display...
[ "def __str__(self):...\n", "redirect_text = '{type}: {from_to_url}'\n", "if self.redirect_type in ['prefix', 'page', 'exact']:\n", "return redirect_text.format(type=self.get_redirect_type_display(),\n from_to_url=self.get_from_to_url_display())\n", "return ugettext('Redirect: {}'.format(self.get_redirect...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_0(self, VAR_25, VAR_26):...\n", "self._logger.info('Got Tribler core error: %s' % VAR_25)\n", "if VAR_25 == QNetworkReply.ConnectionRefusedError:\n", "if self.failed_attempts == 40:\n", "self.failed_attempts += 1\n", "if VAR_26:\n", "self.connect_timer = QTimer()\n", "self.connect_timer.setS...
[ "def on_error(self, error, reschedule_on_err):...\n", "self._logger.info('Got Tribler core error: %s' % error)\n", "if error == QNetworkReply.ConnectionRefusedError:\n", "if self.failed_attempts == 40:\n", "self.failed_attempts += 1\n", "if reschedule_on_err:\n", "self.connect_timer = QTimer()\n", "se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Condition", "AugAssign'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_38(VAR_65, VAR_66):...\n", "VAR_79 = ElementTree.parse(VAR_66).getroot()\n", "if VAR_79.tag != 'plugin':\n", "return VAR_79.find('name').text\n" ]
[ "def process_info_file(cp_elem, info_file):...\n", "plugin_info = ElementTree.parse(info_file).getroot()\n", "if plugin_info.tag != 'plugin':\n", "return plugin_info.find('name').text\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_4(self):...\n", "if self.redirected_to is None:\n", "return None\n", "VAR_14 = self.redirected_to.split('?')\n", "if len(VAR_14) != 2:\n", "VAR_0.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n", "VAR_20 = decrypt_number(VAR_14[-1])\n", "VAR_0.warning(\"Unable to de...
[ "def get_submission_id(self):...\n", "if self.redirected_to is None:\n", "return None\n", "p = self.redirected_to.split('?')\n", "if len(p) != 2:\n", "logger.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n", "submission_id = decrypt_number(p[-1])\n", "logger.warning(\"Unable ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Return'", "Return'", "Return'" ]
[ "async def FUNC_2():...\n", "" ]
[ "async def is_connect_db():...\n", "" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Condition" ]
[ "def FUNC_2(VAR_15, VAR_2, VAR_3='text', VAR_4=bconfig....\n", "\"\"\"docstring\"\"\"\n", "VAR_43 = reader.get_cache(VAR_2)\n", "if not VAR_43:\n", "reader.set_cache(VAR_2, reader.get_regular_expressions(VAR_2, rebuild=\n rebuild_cache, VAR_7=no_cache))\n", "VAR_44 = VAR_43[0]\n", "VAR_43 = reader.ge...
[ "def get_keywords_from_text(text_lines, taxonomy_name, output_mode='text',...\n", "\"\"\"docstring\"\"\"\n", "cache = reader.get_cache(taxonomy_name)\n", "if not cache:\n", "reader.set_cache(taxonomy_name, reader.get_regular_expressions(\n taxonomy_name, rebuild=rebuild_cache, no_cache=no_cache))\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assi...
[ "def FUNC_20(self, VAR_16):...\n", "return self.meta.get_field(VAR_16).options\n" ]
[ "def get_table_field_doctype(self, fieldname):...\n", "return self.meta.get_field(fieldname).options\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "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_2(self):...\n", "VAR_14 = utils.GetUnusedLocalhostPort()\n", "self._temp_options_filename = options_file.name\n", "json.dump(dict(self._user_options), options_file)\n", "options_file.flush()\n", "VAR_21 = [utils.PathToPythonInterpreter(), FUNC_0(), '--port={0}'.format(\n VAR_14), '--options_f...
[ "def _SetupServer(self):...\n", "server_port = utils.GetUnusedLocalhostPort()\n", "self._temp_options_filename = options_file.name\n", "json.dump(dict(self._user_options), options_file)\n", "options_file.flush()\n", "args = [utils.PathToPythonInterpreter(), _PathToServerScript(),\n '--port={0}'.format(...
[ 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_7(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_6 = self.client.get('/api/apps/{}/perms'.format(VAR_8), content_type=\n 'application/json')\n", "self.assert...
[ "def test_list_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", "response = self.client.get('/api/apps/{}/perms'.format(app_id),\n content_type='application...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_32(self, VAR_81):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.shellcmd = VAR_81\n", "return VAR_101\n" ]
[ "def shellcmd(self, cmd):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.shellcmd = cmd\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_1(self):...\n", "VAR_4 = CLASS_2(id=0)\n", "VAR_5 = EntityCache(entities=[])\n", "VAR_5.add(VAR_4)\n", "self.assert_true(VAR_5.get_by_id(VAR_4.id) is VAR_4)\n", "self.assert_true(VAR_5.has_id(VAR_4.id))\n", "self.assert_true(VAR_5.get_by_slug(VAR_4.slug) is VAR_4)\n", "self.assert_true(VAR_5...
[ "def test_basics(self):...\n", "ent = MyEntity(id=0)\n", "cache = EntityCache(entities=[])\n", "cache.add(ent)\n", "self.assert_true(cache.get_by_id(ent.id) is ent)\n", "self.assert_true(cache.has_id(ent.id))\n", "self.assert_true(cache.get_by_slug(ent.slug) is ent)\n", "self.assert_true(cache.has_slu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_12(VAR_24):...\n", "for user, VAR_20, id1, id2 in VAR_23.findall(VAR_24):\n", "VAR_21 = id1 + id2\n", "FUNC_9(VAR_20, VAR_21, user)\n" ]
[ "def rtfu(urls):...\n", "for user, domain, id1, id2 in r_di.findall(urls):\n", "id_ = id1 + id2\n", "remove_target(domain, id_, user)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Assign'", "Expr'" ]
[ "def FUNC_0(self, VAR_0='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n" ]
[ "def connect(self, database='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = self.bindings\n", "VAR_7 = VAR_1['TEST_APP_COMPONENT_NAME']\n", "VAR_15 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n", "VAR_8 = VAR_1['TEST_AWS_REGION']\n", "VAR_9 = [VAR_8 + 'a', VAR_8 + 'b']\n", "...
[ "def create_server_group(self):...\n", "\"\"\"docstring\"\"\"\n", "bindings = self.bindings\n", "load_balancer_name = bindings['TEST_APP_COMPONENT_NAME']\n", "group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n", "region = bindings['TEST_AWS_REGION']\n", "av...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "from os.path import join\n", "from datetime import datetime\n", "from flask import request, redirect, url_for, render_template, flash, g, current_app\n", "from werkzeug.utils import secure_filename\n", "from flask_security import login_required, current_user\n", "from benwaonline.database import db\n", ...
[ "from os.path import join\n", "from datetime import datetime\n", "from flask import request, redirect, url_for, render_template, flash, g, current_app\n", "from werkzeug.utils import secure_filename\n", "from flask_security import login_required, current_user\n", "from benwaonline.database import db\n", ...
[ 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'", "For", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "For", "Assign'", "Expr'" ]
[ "@VAR_0.route('/list')...\n", "if VAR_3 is None:\n", "VAR_3 = request.args.get('start', None, float)\n", "if VAR_4 is None:\n", "VAR_4 = request.args.get('end', None, float)\n", "if VAR_5 is None:\n", "VAR_5 = request.args.get('limit', 100, int)\n", "if VAR_6 is None:\n", "VAR_6 = request.args.get('...
[ "@FirstZeros.route('/list')...\n", "if start is None:\n", "start = request.args.get('start', None, float)\n", "if end is None:\n", "end = request.args.get('end', None, float)\n", "if limit is None:\n", "limit = request.args.get('limit', 100, int)\n", "if fmt is None:\n", "fmt = request.args.get('for...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 0, 4, 0, 0, 4, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'...
[ "def FUNC_5(self):...\n", "self._check_duplicate_key(VAR_0)\n" ]
[ "def test_rsa_duplicate_key(self):...\n", "self._check_duplicate_key(RSA_PUBKEY)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_33(VAR_57, VAR_22):...\n", "if not len(VAR_57):\n", "VAR_56.append('/%s' % ('/'.join(VAR_22),))\n", "if VAR_57[0] == '.':\n", "FUNC_33(VAR_57[1:], VAR_22)\n", "if VAR_57[0] == '..':\n", "FUNC_33(VAR_57[1:], VAR_22[:-1])\n", "VAR_65 = [x[VAR_1] for x in self.get_path('/'.join(VAR_22))]\n", ...
[ "def foo(p, cwd):...\n", "if not len(p):\n", "found.append('/%s' % ('/'.join(cwd),))\n", "if p[0] == '.':\n", "foo(p[1:], cwd)\n", "if p[0] == '..':\n", "foo(p[1:], cwd[:-1])\n", "names = [x[A_NAME] for x in self.get_path('/'.join(cwd))]\n", "matches = [x for x in names if fnmatch.fnmatchcase(x, p[0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "For", "Expr'" ]
[ "def FUNC_13(self):...\n", "VAR_4 = CachedContent(self.course_instance)\n", "def FUNC_17(VAR_5):...\n", "VAR_11 = VAR_5['children']\n", "if VAR_11:\n", "return itertools.chain.from_iterable([FUNC_17(child) for child in VAR_11])\n", "return VAR_5['id'],\n" ]
[ "def __get_exercises(self):...\n", "content = CachedContent(self.course_instance)\n", "def get_descendant_ids(node):...\n", "children = node['children']\n", "if children:\n", "return itertools.chain.from_iterable([get_descendant_ids(child) for child in\n children])\n", "return node['id'],\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_3(self, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = self._cliq_get_cluster_info(VAR_8)\n", "VAR_20 = []\n", "for vip in VAR_19.findall('response/cluster/vip'):\n", "VAR_20.append(vip.attrib.get('ipAddress'))\n", "if len(VAR_20) == 1:\n", "return VAR_20[0]\n", "VAR_21 = etree.tostri...
[ "def _cliq_get_cluster_vip(self, cluster_name):...\n", "\"\"\"docstring\"\"\"\n", "cluster_xml = self._cliq_get_cluster_info(cluster_name)\n", "vips = []\n", "for vip in cluster_xml.findall('response/cluster/vip'):\n", "vips.append(vip.attrib.get('ipAddress'))\n", "if len(vips) == 1:\n", "return vips[...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Expr'", "Condition", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_24(self, VAR_25):...\n", "for VAR_24 in self.databases_to_save:\n", "VAR_24.database_manager.save_database()\n", "self.quit_dialog.destroy()\n", "self.application.quit()\n" ]
[ "def on_quit_button_clicked(self, button):...\n", "for db in self.databases_to_save:\n", "db.database_manager.save_database()\n", "self.quit_dialog.destroy()\n", "self.application.quit()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_0(self):...\n", "VAR_1, VAR_2 = 'firstuser', 'password'\n", "VAR_3 = 'autotest@deis.io'\n", "VAR_4 = {'username': VAR_1, 'password': VAR_2, 'email': VAR_3}\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...
[ "def test_first_signup(self):...\n", "username, password = 'firstuser', 'password'\n", "email = 'autotest@deis.io'\n", "submit = {'username': username, 'password': password, 'email': email}\n", "url = '/api/auth/register'\n", "response = self.client.post(url, json.dumps(submit), content_type=\n 'applic...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_7=True, VAR_8=False):...\n", "\"\"\"docstring\"\"\"\n", "super().__init__(description='ParlAI parser.', allow_abbrev=False,\n conflict_handler='resolve')\n", "self.register('type', 'bool', FUNC_0)\n", "self.register('type', 'class', FUNC_1)\n", "self.parlai_home = VAR_20.path.di...
[ "def __init__(self, add_parlai_args=True, add_model_args=False):...\n", "\"\"\"docstring\"\"\"\n", "super().__init__(description='ParlAI parser.', allow_abbrev=False,\n conflict_handler='resolve')\n", "self.register('type', 'bool', str2bool)\n", "self.register('type', 'class', str2class)\n", "self.parl...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_22(self, VAR_28):...\n", "\"\"\"docstring\"\"\"\n", "VAR_58 = VAR_28,\n", "VAR_36 = ''\n", "if self.execute('SELECT name FROM history WHERE nzo_id=?', VAR_58):\n", "return VAR_36\n", "VAR_36 = self.c.fetchone().get('name')\n" ]
[ "def get_name(self, nzo_id):...\n", "\"\"\"docstring\"\"\"\n", "t = nzo_id,\n", "name = ''\n", "if self.execute('SELECT name FROM history WHERE nzo_id=?', t):\n", "return name\n", "name = self.c.fetchone().get('name')\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Return'", "Assign'" ]
[ "def FUNC_13(self, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "self._check_volume(VAR_16)\n", "VAR_0.warn(_('Volume %s was not found while trying to delete it'), VAR_16[\n 'name'])\n", "self._eql_execute('volume', 'select', VAR_16['name'], 'offline')\n", "VAR_0.error(_('Failed to delete volume %s'), VA...
[ "def delete_volume(self, volume):...\n", "\"\"\"docstring\"\"\"\n", "self._check_volume(volume)\n", "LOG.warn(_('Volume %s was not found while trying to delete it'), volume['name']\n )\n", "self._eql_execute('volume', 'select', volume['name'], 'offline')\n", "LOG.error(_('Failed to delete volume %s'), ...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = set()\n", "for VAR_28, VAR_27 in zip(self.output, self.rule.output):\n", "if VAR_28 in self.dynamic_output:\n", "VAR_16 = defaultdict(list)\n", "for VAR_28, w in self.expand_dynamic(VAR_27, VAR_13=self.wildcards, VAR_14=\n", "for combination in VA...
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "combinations = set()\n", "for f, f_ in zip(self.output, self.rule.output):\n", "if f in self.dynamic_output:\n", "wildcards = defaultdict(list)\n", "for f, w in self.expand_dynamic(f_, restriction=self.wildcards, omit_value=\n", "for combination in combina...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "For", "Condition", "Assign'", "For", "For", "Expr'", "For", "Return'", "Expr'" ]
[ "def FUNC_19(self, VAR_38):...\n", "\"\"\"docstring\"\"\"\n", "return self._parse_conditions(self.OR_CONDITION, VAR_38)\n" ]
[ "def _parse_or(self, data):...\n", "\"\"\"docstring\"\"\"\n", "return self._parse_conditions(self.OR_CONDITION, data)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_42(self):...\n", "self.cursor.execute('create table t1(c1 int identity(1, 1), c2 varchar(50))')\n", "for i in range(3):\n", "self.cursor.execute('insert into t1(c2) values (?)', 'string%s' % i)\n", "self.cursor.execute('create view t2 as select * from t1')\n", "self.cursor.execute('select * from...
[ "def test_view_select(self):...\n", "self.cursor.execute('create table t1(c1 int identity(1, 1), c2 varchar(50))')\n", "for i in range(3):\n", "self.cursor.execute('insert into t1(c2) values (?)', 'string%s' % i)\n", "self.cursor.execute('create view t2 as select * from t1')\n", "self.cursor.execute('sele...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "For", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_18(self):...\n", "self.run_test_case(self.scenario.delete_load_balancer())\n" ]
[ "def test_z_delete_load_balancer(self):...\n", "self.run_test_case(self.scenario.delete_load_balancer())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@VAR_0.route('/upload', methods=['POST'])...\n", "VAR_8 = request.files['file']\n", "VAR_9 = MySQL.get_connection(VAR_3)\n", "if VAR_8:\n", "VAR_16 = os.path.splitext(VAR_8.filename)[0] + str(int(time.time())) + '.log'\n", "VAR_9.close()\n", "VAR_17 = logging.FileHandler(os.path.join(VAR_1, VAR_16), 'w...
[ "@app.route('/upload', methods=['POST'])...\n", "datafile = request.files['file']\n", "c = MySQL.get_connection(DATABASE)\n", "if datafile:\n", "logfile = os.path.splitext(datafile.filename)[0] + str(int(time.time())\n ) + '.log'\n", "c.close()\n", "f = logging.FileHandler(os.path.join(LOG_DIR, logfi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def __bool__(self):...\n", "return False\n" ]
[ "def __bool__(self):...\n", "return False\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0=None):...\n", "VAR_1 = FUNC_1()\n", "VAR_2 = FUNC_2(VAR_0)\n", "return VAR_1, VAR_2\n" ]
[ "def execute(filters=None):...\n", "columns = get_columns()\n", "data = get_data(filters)\n", "return columns, data\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'cert_chain')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'cert_chain')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_1(self, VAR_0):...\n", "VAR_19 = dict(self.query_params).copy()\n", "for VAR_26, VAR_4 in VAR_19.items():\n", "if type(VAR_4) == list:\n", "VAR_19.update(VAR_0)\n", "VAR_19[VAR_26] = VAR_4[0]\n", "for VAR_26, VAR_4 in VAR_19.copy().items():\n", "if VAR_4 is None:\n", "return '?{}'.format(u...
[ "def get_url_with_query_params(self, new_query_dict):...\n", "query = dict(self.query_params).copy()\n", "for key, value in query.items():\n", "if type(value) == list:\n", "query.update(new_query_dict)\n", "query[key] = value[0]\n", "for key, value in query.copy().items():\n", "if value is None:\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Expr'", "Assign'", "For", "Condition", "Return'" ]
[ "def __init__(self):...\n", "self.__cache_map = defaultdict(CLASS_0)\n" ]
[ "def __init__(self):...\n", "self.__cache_map = defaultdict(EntityCache)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_0(self):...\n", "\"\"\"docstring\"\"\"\n", "\"\"\"string\"\"\"\n", "VAR_6 = request.args.get('username')\n", "VAR_9 = request.args.get('password')\n", "if VAR_6.isalnum():\n", "VAR_16 = db_interac.authenticate(VAR_6, VAR_9)\n", "VAR_4['error'] = 'username must be alphanumeric'\n", "VAR_4 =...
[ "def get(self):...\n", "\"\"\"docstring\"\"\"\n", "\"\"\"\n # Check the request comes from appropriate location.\n if not utils.validate_ip(request.remote_addr)\n return {}, 403\n \"\"\"\n", "username = request.args.get('username')\n", "password = request.args.get('password')...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Return'", "Assign'", "Return'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "return bool(self.wildcard_names)\n" ]
[ "def has_wildcards(self):...\n", "\"\"\"docstring\"\"\"\n", "return bool(self.wildcard_names)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_2(self):...\n", "return self.best_submission\n" ]
[ "def get_best_submission(self):...\n", "return self.best_submission\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n", "self.check_image_exists()\n", "if not self.security_groups:\n", "self.security_groups[self.tenant_id] = self.verify(25, self.\n _create_security_group, 1, 'Security group can not be created.',\n 'security group creation', self.compute_client)\n", ...
[ "def test_004_create_servers(self):...\n", "\"\"\"docstring\"\"\"\n", "self.check_image_exists()\n", "if not self.security_groups:\n", "self.security_groups[self.tenant_id] = self.verify(25, self.\n _create_security_group, 1, 'Security group can not be created.',\n 'security group creation', self.comp...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_6(self, VAR_18):...\n", "if not VAR_18:\n", "self.error()\n", "return VAR_18\n" ]
[ "def run(self, item):...\n", "if not item:\n", "self.error()\n", "return item\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'" ]
[ "@classmethod...\n", "super(CLASS_0, VAR_0).setUpTestData()\n", "VAR_0.user = UserFactory(email='user+1@example.com')\n", "VAR_0.user.set_password('testing')\n", "VAR_0.user.save()\n" ]
[ "@classmethod...\n", "super(TestNavigation, cls).setUpTestData()\n", "cls.user = UserFactory(email='user+1@example.com')\n", "cls.user.set_password('testing')\n", "cls.user.save()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_11(self):...\n", "self.assertRaises(frappe.DataError, DatabaseQuery('DocType').execute,\n fields=['name', 'issingle, version()'], limit_start=0, limit_page_length=1)\n", "self.assertRaises(frappe.DataError, DatabaseQuery('DocType').execute,\n fields=['name',\n 'issingle, IF(issingle=1, (selec...
[ "def test_query_fields_sanitizer(self):...\n", "self.assertRaises(frappe.DataError, DatabaseQuery('DocType').execute,\n fields=['name', 'issingle, version()'], limit_start=0, limit_page_length=1)\n", "self.assertRaises(frappe.DataError, DatabaseQuery('DocType').execute,\n fields=['name',\n 'issingle, I...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "@inlineCallbacks...\n", "" ]
[ "@inlineCallbacks...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "@VAR_0.route('/login', methods=['POST'])...\n", "VAR_19 = CLASS_0.query.get(request.form['email'])\n", "if VAR_19:\n", "if request.form['password'] == VAR_19.pwd:\n", "return render_template('unsuccessful-login.html')\n", "VAR_19.authenticated = True\n", "VAR_2.session.add(VAR_19)\n", "VAR_2.session....
[ "@app.route('/login', methods=['POST'])...\n", "user = User.query.get(request.form['email'])\n", "if user:\n", "if request.form['password'] == user.pwd:\n", "return render_template('unsuccessful-login.html')\n", "user.authenticated = True\n", "db.session.add(user)\n", "db.session.commit()\n", "login...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "For", "Return'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "@decorators.require_cronjob...\n", "VAR_25 = utils.utcnow() - on_error.ERROR_TIME_TO_LIVE\n", "VAR_18 = models.Error.query(models.Error.created_ts < VAR_25,\n default_options=ndb.QueryOptions(keys_only=True))\n", "VAR_26 = len(ndb.delete_multi(VAR_18))\n", "self.response.headers['Content-Type'] = 'text/...
[ "@decorators.require_cronjob...\n", "old_cutoff = utils.utcnow() - on_error.ERROR_TIME_TO_LIVE\n", "items = models.Error.query(models.Error.created_ts < old_cutoff,\n default_options=ndb.QueryOptions(keys_only=True))\n", "out = len(ndb.delete_multi(items))\n", "self.response.headers['Content-Type'] = 'te...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_17(self, VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "self._eql_execute('volume', 'select', VAR_18['volume_name'], 'snapshot',\n 'delete', VAR_18['name'])\n", "VAR_0.error(_('Failed to delete snapshot %(snap)s of volume %(vol)s'), {\n 'snap': VAR_18['name'], 'vol': VAR_18['volume_name']})\n" ]
[ "def delete_snapshot(self, snapshot):...\n", "\"\"\"docstring\"\"\"\n", "self._eql_execute('volume', 'select', snapshot['volume_name'], 'snapshot',\n 'delete', snapshot['name'])\n", "LOG.error(_('Failed to delete snapshot %(snap)s of volume %(vol)s'), {\n 'snap': snapshot['name'], 'vol': snapshot['volum...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'" ]
[ "def FUNC_11(self):...\n", "VAR_3 = 5\n", "for i in range(VAR_3):\n", "VAR_11 = urllib.urlencode({url_helper.swarm_constants.COUNT_KEY: i})\n", "self._mox.ReplayAll()\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), VAR_11, timeout=mox.IgnoreArg()\n ).AndRaise(urllib2.URLError('url'))\n", "self.asser...
[ "def testEnsureCountKeyIncludedInOpen(self):...\n", "attempts = 5\n", "for i in range(attempts):\n", "encoded_data = urllib.urlencode({url_helper.swarm_constants.COUNT_KEY: i})\n", "self._mox.ReplayAll()\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), encoded_data, timeout=mox.\n IgnoreArg()).AndRaise...
[ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_16(self, VAR_9, VAR_7):...\n", "VAR_18 = threading.Thread(target=self.__execute_interactive, kwargs={\n 'command': command, 'job_id': job_id})\n", "VAR_18.daemon = True\n", "VAR_18.start()\n" ]
[ "def _execute_interactive(self, command, job_id):...\n", "thread = threading.Thread(target=self.__execute_interactive, kwargs={\n 'command': command, 'job_id': job_id})\n", "thread.daemon = True\n", "thread.start()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "from django import template\n", "from django.utils import timezone\n", "from lib.errors import TagUsageError\n", "from ..cache import CachedNews\n", "from ..models import News\n", "VAR_0 = template.Library()\n", "@VAR_0.inclusion_tag('news/user_news.html', takes_context=True)...\n", "if not 'instance...
[ "from django import template\n", "from django.utils import timezone\n", "from lib.errors import TagUsageError\n", "from ..cache import CachedNews\n", "from ..models import News\n", "register = template.Library()\n", "@register.inclusion_tag('news/user_news.html', takes_context=True)...\n", "if not 'in...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "For", "AugAssign'", "Return'", "Assign'", "...
[ "def FUNC_4(self):...\n", "assert self.initialised, 'Initialise the map from a file first!'\n", "for VAR_23 in range(self.mapHeight):\n", "for VAR_22 in range(self.mapWidth):\n", "if self.stateMap[VAR_22][VAR_23].isTraversable():\n", "self.stateMap[VAR_22][VAR_23].setTurningNeighbours(self.nearestNodes(VA...
[ "def genConnections(self):...\n", "assert self.initialised, 'Initialise the map from a file first!'\n", "for row in range(self.mapHeight):\n", "for col in range(self.mapWidth):\n", "if self.stateMap[col][row].isTraversable():\n", "self.stateMap[col][row].setTurningNeighbours(self.nearestNodes(col, row))\n...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "For", "For", "Condition", "Expr'" ]
[ "def FUNC_3(VAR_5, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = {}\n", "VAR_15['new_status'] = 'active' if VAR_6 == 'unfreeze' else 'inactive'\n", "VAR_16 = 'inactive' if VAR_6 == 'unfreeze' else 'active'\n", "VAR_15['fields'] = pickle.dumps({'scope': VAR_5.key(), 'status': VAR_16})\n", "for patt...
[ "def _processProgramFreezing(program_entity, mode):...\n", "\"\"\"docstring\"\"\"\n", "new_context = {}\n", "new_context['new_status'] = 'active' if mode == 'unfreeze' else 'inactive'\n", "old_status = 'inactive' if mode == 'unfreeze' else 'active'\n", "new_context['fields'] = pickle.dumps({'scope': progr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_10(self, VAR_18):...\n", "VAR_30 = VAR_18.uuid\n", "VAR_41 = VAR_18.file_name\n", "VAR_42 = VAR_18.owner\n", "VAR_43 = VAR_18.upload_time\n", "VAR_44 = list()\n", "VAR_45 = list()\n", "for VAR_65 in VAR_18.sub_items:\n", "if VAR_65.is_dir:\n", "VAR_46 = \"'{\" + ', '.join(i for i in VAR_...
[ "def _sqlify_fsnode(self, item):...\n", "n_uuid = item.uuid\n", "n_file_name = item.file_name\n", "n_owner = item.owner\n", "n_upload_time = item.upload_time\n", "n_sub_folders = list()\n", "n_sub_files = list()\n", "for i_sub in item.sub_items:\n", "if i_sub.is_dir:\n", "n_sub_folders_str = \"'{\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_21(self):...\n", "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ "def test_with_timeout(self):...\n", "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_0(self, VAR_5):...\n", "VAR_14 = 'string'.format(VAR_5)\n", "self.cur.execute(VAR_14)\n", "return self.cur.fetchall()\n" ]
[ "def get_roster(self, server_id):...\n", "sql = (\n \"\"\"SELECT username, role\n FROM roles\n WHERE roles.server_id = {0};\n \"\"\"\n .format(server_id))\n", "self.cur.execute(sql)\n", "return self.cur.fetchall()\n" ]
[ 0, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "@property...\n", "return hasattr(self, 'extractedtext')\n" ]
[ "@property...\n", "return hasattr(self, 'extractedtext')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_22(self, VAR_21, VAR_40):...\n", "\"\"\"docstring\"\"\"\n", "VAR_57 = self.getfile(VAR_21)\n", "if VAR_57 == False:\n", "VAR_57[VAR_6] = FUNC_30.S_IFMT(VAR_57[VAR_6]) | VAR_40\n" ]
[ "def chmod(self, path, perm):...\n", "\"\"\"docstring\"\"\"\n", "p = self.getfile(path)\n", "if p == False:\n", "p[A_MODE] = stat.S_IFMT(p[A_MODE]) | perm\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_1(VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = 'df -i'\n", "if VAR_1 is not None:\n", "VAR_4 = VAR_4 + ' -' + VAR_1\n", "VAR_2 = {}\n", "VAR_3 = __salt__['cmd.run'](VAR_4).splitlines()\n", "for line in VAR_3:\n", "if line.startswith('Filesystem'):\n", "return VAR_2\n", "VAR_...
[ "def inodeusage(args=None):...\n", "\"\"\"docstring\"\"\"\n", "cmd = 'df -i'\n", "if args is not None:\n", "cmd = cmd + ' -' + args\n", "ret = {}\n", "out = __salt__['cmd.run'](cmd).splitlines()\n", "for line in out:\n", "if line.startswith('Filesystem'):\n", "return ret\n", "comps = line.split(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_13(self, VAR_22):...\n", "\"\"\"docstring\"\"\"\n", "logging.warning(\"\"\"Authorization error.\n%s\nPeer: %s\nIP: %s\"\"\", VAR_22, api.\n get_peer_identity().to_bytes(), self.request.remote_addr)\n", "self.abort(403, detail=str(error))\n" ]
[ "def authorization_error(self, error):...\n", "\"\"\"docstring\"\"\"\n", "logging.warning(\"\"\"Authorization error.\n%s\nPeer: %s\nIP: %s\"\"\", error, api.\n get_peer_identity().to_bytes(), self.request.remote_addr)\n", "self.abort(403, detail=str(error))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'" ]
[ "def FUNC_0(VAR_0=None):...\n", "VAR_1 = FUNC_1()\n", "VAR_2 = FUNC_2(VAR_0)\n", "return VAR_1, VAR_2\n" ]
[ "def execute(filters=None):...\n", "columns = get_columns()\n", "data = get_data(filters)\n", "return columns, data\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_1):...\n", "VAR_6 = FUNC_3(VAR_1)\n", "VAR_7 = VAR_6.cursor(MySQLdb.cursors.DictCursor)\n", "VAR_8 = (\n \"SELECT * FROM questions WHERE status='not-started' OR status='in-progress' ORDER BY ts DESC;\"\n )\n", "VAR_7.execute(VAR_8)\n", "VAR_9 = []\n", "while True:\n", "VAR_10 = V...
[ "def makeQuestionSelect(database):...\n", "conn = dbConnect(database)\n", "curs = conn.cursor(MySQLdb.cursors.DictCursor)\n", "statement = (\n \"SELECT * FROM questions WHERE status='not-started' OR status='in-progress' ORDER BY ts DESC;\"\n )\n", "curs.execute(statement)\n", "lines = []\n", "whil...
[ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Return'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = self.parse_body()\n", "VAR_9 = VAR_4.get('version', None)\n", "VAR_24 = VAR_4.get('dimensions', {})\n", "VAR_25 = VAR_4.get('state', {})\n", "VAR_14 = None\n", "if VAR_24.get('id'):\n", "VAR_52 = VAR_24['id']\n", "if bool(VAR_24.get('qu...
[ "def _process(self):...\n", "\"\"\"docstring\"\"\"\n", "request = self.parse_body()\n", "version = request.get('version', None)\n", "dimensions = request.get('dimensions', {})\n", "state = request.get('state', {})\n", "bot_id = None\n", "if dimensions.get('id'):\n", "dimension_id = dimensions['id']\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Assign'", "For", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Con...
[ "def FUNC_12(self, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "VAR_24 = self.getfile(VAR_21)\n", "return False\n", "return VAR_24[VAR_2] == VAR_11\n" ]
[ "def islink(self, path):...\n", "\"\"\"docstring\"\"\"\n", "f = self.getfile(path)\n", "return False\n", "return f[A_TYPE] == T_LINK\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'", "Return'" ]
[ "def FUNC_0(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = json.dumps(VAR_1)\n", "VAR_11 = json.dumps(fix_unicode_dict(VAR_1))\n", "if len(self.events_requests) == 0:\n", "return\n", "[VAR_9.write(VAR_11 + '\\n') for VAR_9 in self.events_requests]\n" ]
[ "def write_data(self, message):...\n", "\"\"\"docstring\"\"\"\n", "message_str = json.dumps(message)\n", "message_str = json.dumps(fix_unicode_dict(message))\n", "if len(self.events_requests) == 0:\n", "return\n", "[request.write(message_str + '\\n') for request in self.events_requests]\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Return'", "Expr'" ]
[ "def __unicode__(self):...\n", "return unicode(self.nickname())\n" ]
[ "def __unicode__(self):...\n", "return unicode(self.nickname())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_29(self):...\n", "if VAR_54.flags.in_import:\n", "return\n", "for VAR_25 in self.meta.get_select_fields():\n", "if VAR_25.fieldname == 'naming_series' or not (self.get(VAR_25.fieldname) and\n", "VAR_56 = (VAR_25.options or '').split('\\n')\n", "if not filter(None, VAR_56):\n", "self.set(VAR_...
[ "def _validate_selects(self):...\n", "if frappe.flags.in_import:\n", "return\n", "for df in self.meta.get_select_fields():\n", "if df.fieldname == 'naming_series' or not (self.get(df.fieldname) and df.\n", "options = (df.options or '').split('\\n')\n", "if not filter(None, options):\n", "self.set(df.f...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "For", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_9(self, VAR_13, VAR_14='result'):...\n", "self.cursor.execute('SELECT COUNT(*) FROM log_' + VAR_13 + ' WHERE ' +\n VAR_14 + '_id=?', [getattr(self, VAR_14)['id']])\n", "return self.cursor.fetchone()['COUNT(*)']\n" ]
[ "def get_count(self, item, item_from='result'):...\n", "self.cursor.execute('SELECT COUNT(*) FROM log_' + item + ' WHERE ' +\n item_from + '_id=?', [getattr(self, item_from)['id']])\n", "return self.cursor.fetchone()['COUNT(*)']\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_5(*VAR_12):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = np.asarray(VAR_12)\n", "return VAR_22 / np.linalg.norm(VAR_22)\n" ]
[ "def ket(*args):...\n", "\"\"\"docstring\"\"\"\n", "state = np.asarray(args)\n", "return state / np.linalg.norm(state)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.delete_snapshot(VAR_9)\n", "self.common.client_logout()\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.delete_snapshot(snapshot)\n", "self.common.client_logout()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_11(VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = False\n", "VAR_11 = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "VAR_11.execute('SELECT type FROM achievement_definitions WHERE id = %s', VAR_1)\n", "VAR_9 = VAR_11.fetchone()\n", "if VAR_9['type'] != 'STANDARD':\n", "...
[ "def unlock_achievement(achievement_id, player_id):...\n", "\"\"\"docstring\"\"\"\n", "newly_unlocked = False\n", "cursor = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "cursor.execute('SELECT type FROM achievement_definitions WHERE id = %s',\n achievement_id)\n", "achievement = cursor.fetch...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_8(self, VAR_43):...\n", "VAR_82 = self.divex.match(VAR_43)\n", "if VAR_82 is None:\n", "VAR_83 = VAR_82.group(1)\n", "VAR_84 = VAR_82.group(2)\n", "VAR_85 = 'mod'\n", "VAR_86 = int(VAR_82.group(3))\n", "VAR_41 = VAR_82.group(4)\n", "VAR_87 = self._parse_poly(VAR_83, VAR_41)\n", "VAR_88 =...
[ "def _parse_instruction(self, s):...\n", "match = self.divex.match(s)\n", "if match is None:\n", "poly1 = match.group(1)\n", "poly2 = match.group(2)\n", "instruction = 'mod'\n", "p = int(match.group(3))\n", "var = match.group(4)\n", "cs1 = self._parse_poly(poly1, var)\n", "cs2 = self._parse_poly(p...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def __str__(self):...\n", "return self.name\n" ]
[ "def __str__(self):...\n", "return self.name\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_17(self, VAR_50, **VAR_18):...\n", "VAR_57 = getattr(self._record, VAR_50.lower())\n", "VAR_57.assert_called_once_with(**kwargs)\n" ]
[ "def assert_called_once(self, verb, **kwargs):...\n", "mock_call = getattr(self._record, verb.lower())\n", "mock_call.assert_called_once_with(**kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_39(VAR_62):...\n", "return json.loads(VAR_62) if VAR_21 else VAR_62\n" ]
[ "def get_str(_str):...\n", "return json.loads(_str) if as_json else _str\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(VAR_1, VAR_2=False, VAR_3=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = {}\n", "if VAR_2 and VAR_3:\n", "VAR_0.error(e)\n", "return VAR_7\n", "for VAR_11 in FUNC_3(VAR_1):\n", "if not VAR_2:\n", "VAR_7[VAR_11.username] = VAR_11.signed\n", "if VAR_3:\n", "for VAR_11 in FUNC_4(VAR...
[ "def get_signed_packets(member, intro=False, onfloor=False):...\n", "\"\"\"docstring\"\"\"\n", "signed_packets = {}\n", "if intro and onfloor:\n", "LOGGER.error(e)\n", "return signed_packets\n", "for signature in query_signed_intromember(member):\n", "if not intro:\n", "signed_packets[signature.user...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Return'", "For", "Condition", "Assign'", "Condition", "For", "For", "Assign'", "Assign'" ]
[ "def FUNC_22(self, VAR_21=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = {}\n", "self.clean_fields(VAR_21)\n", "VAR_22 = e.update_error_dict(VAR_22)\n", "self.clean()\n", "VAR_22 = e.update_error_dict(VAR_22)\n", "if VAR_22:\n" ]
[ "def full_clean(self, exclude=None):...\n", "\"\"\"docstring\"\"\"\n", "errors = {}\n", "self.clean_fields(exclude)\n", "errors = e.update_error_dict(errors)\n", "self.clean()\n", "errors = e.update_error_dict(errors)\n", "if errors:\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Condition" ]
[ "def FUNC_61():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "VAR_39 = set(['a'])\n", "self.cursor.executemany('insert into t1 (word) values (?)', [VAR_39])\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'" ]
[ "@staticmethod...\n", "if VAR_5 == 'north':\n", "return 'east'\n", "if VAR_5 == 'east':\n", "return 'north'\n", "if VAR_5 == 'south':\n", "return 'west'\n", "if VAR_5 == 'west':\n", "return 'south'\n" ]
[ "@staticmethod...\n", "if direction == 'north':\n", "return 'east'\n", "if direction == 'east':\n", "return 'north'\n", "if direction == 'south':\n", "return 'west'\n", "if direction == 'west':\n", "return 'south'\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'" ]
[ "def FUNC_2(self, VAR_6, VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "self._logger.error('Error with job %d: %s', VAR_6, VAR_7)\n", "self.put('worker/%s' % VAR_6, data={'log': message, 'returncode': 1, 'host':\n socket.gethostbyaddr(socket.getfqdn())})\n", "self._logger.exception('Error trying to PUT back ...
[ "def _abort(self, job_id, message):...\n", "\"\"\"docstring\"\"\"\n", "self._logger.error('Error with job %d: %s', job_id, message)\n", "self.put('worker/%s' % job_id, data={'log': message, 'returncode': 1,\n 'host': socket.gethostbyaddr(socket.getfqdn())})\n", "self._logger.exception('Error trying to PU...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'" ]
[ "@view_config(route_name='new-note', permission='edit', renderer=...\n", "VAR_2 = db.note.Note(None, user_id=request.user.user_id, content=request.\n params.get('note', ''))\n", "if VAR_0.method == 'POST':\n", "FUNC_5(VAR_2, VAR_0)\n", "return dict(title='Ny anteckning', VAR_2=note)\n", "return HTTPFou...
[ "@view_config(route_name='new-note', permission='edit', renderer=...\n", "note = db.note.Note(None, user_id=request.user.user_id, content=request.\n params.get('note', ''))\n", "if request.method == 'POST':\n", "_save_or_create_note(note, request)\n", "return dict(title='Ny anteckning', note=note)\n", ...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Expr'", "Return'", "Return'" ]