lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_10(self, VAR_14):...\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.parser.parse(VAR_14, lexer=self.lexer)\n"
] | [
"def parse(self, expr):...\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.parser.parse(expr, lexer=self.lexer)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"if FUNC_12(VAR_16, 'temp'):\n",
"return VAR_19(VAR_16, 'protected')\n"
] | [
"def protected(value):...\n",
"\"\"\"docstring\"\"\"\n",
"if is_flagged(value, 'temp'):\n",
"return flag(value, 'protected')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'"
] |
[
"def __eq__(self, VAR_35):...\n",
"return self.__class__ == VAR_35.__class__ and self.flattened == VAR_35.flattened and self.type == VAR_35.type\n"
] | [
"def __eq__(self, other):...\n",
"return self.__class__ == other.__class__ and self.flattened == other.flattened and self.type == other.type\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_2=None, *VAR_3, **VAR_4):...\n",
"super(CLASS_1, self).__init__(*VAR_3, **kwargs)\n",
"self.body = VAR_2\n"
] | [
"def __init__(self, body=None, *args, **kwargs):...\n",
"super(HttpStatus, self).__init__(*args, **kwargs)\n",
"self.body = body\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"@require_http_methods(['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = BadRequestRateLimiter()\n",
"if VAR_16.is_rate_limit_exceeded(VAR_3):\n",
"VAR_0.warning('Password reset rate limit exceeded')\n",
"VAR_10 = VAR_3.user\n",
"return HttpResponseForbidden()\n",
"VAR_17 = VAR_10.email if VAR_10.... | [
"@require_http_methods(['POST'])...\n",
"\"\"\"docstring\"\"\"\n",
"limiter = BadRequestRateLimiter()\n",
"if limiter.is_rate_limit_exceeded(request):\n",
"AUDIT_LOG.warning('Password reset rate limit exceeded')\n",
"user = request.user\n",
"return HttpResponseForbidden()\n",
"email = user.email if us... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {}\n",
"for count in range(0, 50):\n",
"if kb.dbms == 'Oracle' and VAR_0.endswith(' FROM DUAL'):\n",
"return None\n",
"VAR_0 = VAR_0[:-len(' FROM DUAL')]\n",
"if count:\n",
"VAR_0 += ', NULL'\n",
"if kb.dbms == 'Oracle':\n",
"... | [
"def __effectiveUnionTest(query, comment):...\n",
"\"\"\"docstring\"\"\"\n",
"resultDict = {}\n",
"for count in range(0, 50):\n",
"if kb.dbms == 'Oracle' and query.endswith(' FROM DUAL'):\n",
"return None\n",
"query = query[:-len(' FROM DUAL')]\n",
"if count:\n",
"query += ', NULL'\n",
"if kb.dbms... | [
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
2,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Condition",
"Assign'",
"Condition"... |
[
"def FUNC_5():...\n",
"self.set_status(404, 'Not Found')\n",
"self._headers = tornado.httputil.HTTPHeaders()\n",
"self.add_header('Content-Length', '0')\n",
"self.flush()\n",
"return\n"
] | [
"def invoke_404():...\n",
"self.set_status(404, 'Not Found')\n",
"self._headers = tornado.httputil.HTTPHeaders()\n",
"self.add_header('Content-Length', '0')\n",
"self.flush()\n",
"return\n"
] | [
0,
0,
0,
0,
0,
4
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"import datetime\n",
"import MySQLdb\n",
"from backend.SQLConnector import SQLConnector\n",
"VAR_0 = 'transactions'\n",
"def __init__(self, VAR_1, VAR_2, VAR_3):...\n",
"self.project_id = VAR_1\n",
"self.user_id = VAR_2\n",
"self.money = VAR_3\n",
"self.time = datetime.datetime.now().isoformat(' ')\... | [
"import datetime\n",
"import MySQLdb\n",
"from backend.SQLConnector import SQLConnector\n",
"TABLE_NAME = 'transactions'\n",
"def __init__(self, project_id, user_id, money):...\n",
"self.project_id = project_id\n",
"self.user_id = user_id\n",
"self.money = money\n",
"self.time = datetime.datetime.no... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, *VAR_4, **VAR_5):...\n",
"return self._run_ssh(VAR_4, VAR_14=self.configuration.eqlx_cli_max_retries)\n"
] | [
"def _eql_execute(self, *args, **kwargs):...\n",
"return self._run_ssh(args, attempts=self.configuration.eqlx_cli_max_retries)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_23(self, VAR_29):...\n",
""
] | [
"def is_localhost(self, hostname):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_9(self):...\n",
"return self.graded\n"
] | [
"def is_graded(self):...\n",
"return self.graded\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_6, VAR_9):...\n",
"VAR_10 = get_executing_test()\n",
"VAR_15 = selenium.webdriver.DesiredCapabilities.INTERNETEXPLORER\n",
"VAR_10.webdriver = selenium.webdriver.Remote(VAR_9, desired_capabilities=\n capabilities)\n",
"VAR_10.webdriver.get(VAR_6)\n",
"while VAR_10.webdriver:\n",
"time... | [
"def start_remote_browser(url, command_executor):...\n",
"test = get_executing_test()\n",
"capabilities = selenium.webdriver.DesiredCapabilities.INTERNETEXPLORER\n",
"test.webdriver = selenium.webdriver.Remote(command_executor,\n desired_capabilities=capabilities)\n",
"test.webdriver.get(url)\n",
"whil... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"return False\n"
] | [
"def _do_search_default_automaton(self):...\n",
"return False\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_16(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"for o in self.products:\n",
"if o.match(VAR_15):\n",
"return False\n",
"return True\n"
] | [
"def is_producer(self, requested_output):...\n",
"\"\"\"docstring\"\"\"\n",
"for o in self.products:\n",
"if o.match(requested_output):\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_0):...\n",
"self.doctype = VAR_0\n",
"self.tables = []\n",
"self.conditions = []\n",
"self.or_conditions = []\n",
"self.fields = None\n",
"self.user = None\n",
"self.ignore_ifnull = False\n",
"self.flags = frappe._dict()\n"
] | [
"def __init__(self, doctype):...\n",
"self.doctype = doctype\n",
"self.tables = []\n",
"self.conditions = []\n",
"self.or_conditions = []\n",
"self.fields = None\n",
"self.user = None\n",
"self.ignore_ifnull = False\n",
"self.flags = frappe._dict()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_7):...\n",
"VAR_8 = self.content\n",
"while VAR_8:\n",
"yield VAR_8[:VAR_7]\n",
"VAR_8 = VAR_8[VAR_7:]\n"
] | [
"def iter_content(self, chunk_size):...\n",
"c = self.content\n",
"while c:\n",
"yield c[:chunk_size]\n",
"c = c[chunk_size:]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"@VAR_11.event...\n",
"print(VAR_0 + 'Bot logged in!')\n"
] | [
"@bot.event...\n",
"print(DISCORD_PREFIX + 'Bot logged in!')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_2(self, VAR_7, VAR_8=None, VAR_9=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = Database().view_submit(VAR_7)\n",
"VAR_15, VAR_16 = [], []\n",
"for VAR_6 in VAR_2.data['data']:\n",
"if VAR_6['type'] == 'file':\n",
"return {'files': VAR_15, 'path': VAR_2.tmp_path}\n",
"VAR_22 = Storage.ge... | [
"def get_files(self, submit_id, password=None, astree=False):...\n",
"\"\"\"docstring\"\"\"\n",
"submit = Database().view_submit(submit_id)\n",
"files, duplicates = [], []\n",
"for data in submit.data['data']:\n",
"if data['type'] == 'file':\n",
"return {'files': files, 'path': submit.tmp_path}\n",
"f... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
1,
0,
1,
1,
0,
1,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.output = VAR_69, VAR_70\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.output = paths, kwpaths\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_5):...\n",
"VAR_5.setResponseCode(OK)\n",
"return self._render_template(VAR_5)\n"
] | [
"def render_GET(self, request):...\n",
"request.setResponseCode(OK)\n",
"return self._render_template(request)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_12(VAR_35, VAR_27):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_52 = ''\n",
"for result in VAR_35:\n",
"VAR_80 = VAR_35[result]\n",
"VAR_52 += '\\n--\\n{0}'.format(FUNC_21())\n",
"if VAR_80:\n",
"return VAR_52\n",
"VAR_89 = sorted(VAR_80, key=lambda x: list_result[x], reverse=True)\n",
"VAR_5... | [
"def _output_text(complete_output, categories):...\n",
"\"\"\"docstring\"\"\"\n",
"output = ''\n",
"for result in complete_output:\n",
"list_result = complete_output[result]\n",
"output += '\\n--\\n{0}'.format(_signature())\n",
"if list_result:\n",
"return output\n",
"list_result_sorted = sorted(lis... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"AugAssign'",
"Condition",
"Return'",
"Assign'",
"AugAssign'",
"For",
"AugAssign'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"VAR_25 = self._create_host(VAR_7, VAR_10)\n",
"VAR_26 = self.common.create_vlun(VAR_7, VAR_25)\n",
"self.common.client_logout()\n",
"VAR_27 = self._get_iscsi_ip(VAR_25['name'])\n",
"VAR_28 = ... | [
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"host = self._create_host(volume, connector)\n",
"vlun = self.common.create_vlun(volume, host)\n",
"self.common.client_logout()\n",
"iscsi_ip = self._get_iscsi_ip(host['name'])\n",
"iscsi_ip_p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_4):...\n",
"for VAR_6 in self.actors.keys():\n",
"if 'User Controlled' in self.actors[VAR_6].name:\n",
"self.actors[VAR_6].readKeys(VAR_4)\n"
] | [
"def readKeys(self, keys):...\n",
"for ID in self.actors.keys():\n",
"if 'User Controlled' in self.actors[ID].name:\n",
"self.actors[ID].readKeys(keys)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_2(VAR_4, VAR_5):...\n",
"def __init__(self, VAR_13):...\n",
"self.filters = VAR_13\n",
"VAR_8 = CLASS_0(VAR_13=[directory_filter, file_filter])\n",
"VAR_9 = FUNC_1(VAR_1)\n",
"VAR_10 = FileWalker(VAR_8, VAR_1, VAR_9=walk_fn)\n",
"return [f for f in VAR_10.walk()]\n"
] | [
"def _walk(directory_filter, file_filter):...\n",
"def __init__(self, filters):...\n",
"self.filters = filters\n",
"loader = MockLoader(filters=[directory_filter, file_filter])\n",
"walk_fn = create_mock_os_walk(MOCK_START_PATH)\n",
"walker = FileWalker(loader, MOCK_START_PATH, walk_fn=walk_fn)\n",
"ret... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"VAR_1 = list(self.uut.process_output([\n \"Random line that shouldn't be captured\\n\", '*************\\n'],\n 'a/file.py', ['original_file_lines_placeholder']))\n",
"self.assertEqual(len(VAR_1), 0)\n"
] | [
"def test_valid_output(self):...\n",
"out = list(self.uut.process_output([\n \"Random line that shouldn't be captured\\n\", '*************\\n'],\n 'a/file.py', ['original_file_lines_placeholder']))\n",
"self.assertEqual(len(out), 0)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_21, VAR_22):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_55 = VAR_21.rstrip('/').split('/')\n",
"if len(VAR_55[0]):\n",
"VAR_22 = [x for x in VAR_22.split('/') if len(x) and x is not None]\n",
"VAR_22, VAR_55 = [], VAR_55[1:]\n",
"VAR_21 = VAR_21[1:]\n",
"VAR_56 = []\n",
"def FUNC_3... | [
"def resolve_path_wc(self, path, cwd):...\n",
"\"\"\"docstring\"\"\"\n",
"pieces = path.rstrip('/').split('/')\n",
"if len(pieces[0]):\n",
"cwd = [x for x in cwd.split('/') if len(x) and x is not None]\n",
"cwd, pieces = [], pieces[1:]\n",
"path = path[1:]\n",
"found = []\n",
"def foo(p, cwd):...\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_26(self, VAR_22):...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_22 in self.sos_info['enabled']\n"
] | [
"def _check_enabled(self, plugin):...\n",
"\"\"\"docstring\"\"\"\n",
"return plugin in self.sos_info['enabled']\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_25(self):...\n",
"VAR_31 = json.loads(get_user_settings(self.doctype))\n",
"if hasattr(self, 'user_settings'):\n",
"VAR_31.update(self.user_settings)\n",
"if self.save_user_settings_fields:\n",
"VAR_31['fields'] = self.user_settings_fields\n",
"FUNC_25(self.doctype, VAR_31)\n"
] | [
"def update_user_settings(self):...\n",
"user_settings = json.loads(get_user_settings(self.doctype))\n",
"if hasattr(self, 'user_settings'):\n",
"user_settings.update(self.user_settings)\n",
"if self.save_user_settings_fields:\n",
"user_settings['fields'] = self.user_settings_fields\n",
"update_user_set... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"self._omnicomp.OnFileReadyToParse(None)\n",
"if not self._IsServerAlive():\n",
"self._NotifyUserIfServerCrashed()\n",
"VAR_5 = {}\n",
"self._AddTagsFilesIfNeeded(VAR_5)\n",
"self._AddSyntaxDataIfNeeded(VAR_5)\n",
"self._AddExtraConfDataIfNeeded(VAR_5)\n",
"self._latest_fi... | [
"def OnFileReadyToParse(self):...\n",
"self._omnicomp.OnFileReadyToParse(None)\n",
"if not self._IsServerAlive():\n",
"self._NotifyUserIfServerCrashed()\n",
"extra_data = {}\n",
"self._AddTagsFilesIfNeeded(extra_data)\n",
"self._AddSyntaxDataIfNeeded(extra_data)\n",
"self._AddExtraConfDataIfNeeded(ext... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@wraps(VAR_7)...\n",
"if not app.config.get('USE_AUTH'):\n",
"return VAR_7(*VAR_9, **kwargs)\n",
"VAR_17 = FUNC_8()\n",
"logging.warning('Invalid token version used.')\n",
"if VAR_17:\n",
"return abort(403)\n",
"VAR_2 = 'user'\n",
"if VAR_17['user_type'] not in app.config['KMS_AUTH_USER_TYPES']:\n"... | [
"@wraps(f)...\n",
"if not app.config.get('USE_AUTH'):\n",
"return f(*args, **kwargs)\n",
"kms_auth_data = _get_kms_auth_data()\n",
"logging.warning('Invalid token version used.')\n",
"if kms_auth_data:\n",
"return abort(403)\n",
"user_type = 'user'\n",
"if kms_auth_data['user_type'] not in app.confi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Expr'",
... |
[
"def __str__(self):...\n",
"return '|%s|' % self.content\n"
] | [
"def __str__(self):...\n",
"return '|%s|' % self.content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"return combine_vars(self.vars, self.get_magic_vars())\n"
] | [
"def get_vars(self):...\n",
"return combine_vars(self.vars, self.get_magic_vars())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import codecs\n",
"import datetime\n",
"import io\n",
"import os\n",
"import sys\n",
"import time\n",
"import traceback\n",
"import urllib\n",
"import requests\n... | [
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import codecs\n",
"import datetime\n",
"import io\n",
"import os\n",
"import sys\n",
"import time\n",
"import traceback\n",
"import urllib\n",
"import requests\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"For",
"Condition",
"FunctionDef'",
"Assign'",
"Expr... |
[
"def FUNC_30(self):...\n",
"VAR_2 = FUNC_0(self.file\n ).st_mode & ~stat.S_IWUSR & ~stat.S_IWGRP & ~stat.S_IWOTH\n",
"if os.path.isdir(self.file):\n",
"for root, dirs, VAR_6 in os.walk(self.file):\n",
"FUNC_2(self.file, VAR_2)\n",
"for d in dirs:\n",
"FUNC_2(os.path.join(self.file, d), VAR_2)\n",
"... | [
"def protect(self):...\n",
"mode = lstat(self.file).st_mode & ~stat.S_IWUSR & ~stat.S_IWGRP & ~stat.S_IWOTH\n",
"if os.path.isdir(self.file):\n",
"for root, dirs, files in os.walk(self.file):\n",
"lchmod(self.file, mode)\n",
"for d in dirs:\n",
"lchmod(os.path.join(self.file, d), mode)\n",
"for f in f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"For",
"Expr'",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_7(VAR_3):...\n",
"if os.path.exists(VAR_3):\n",
"if os.path.isdir(VAR_3):\n",
"os.remove(VAR_3)\n",
"os.removedirs(VAR_3)\n"
] | [
"def remove(file):...\n",
"if os.path.exists(file):\n",
"if os.path.isdir(file):\n",
"os.remove(file)\n",
"os.removedirs(file)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_17(VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"return bytes(VAR_13, 'iso-8859-1').decode('utf-8')\n"
] | [
"def utf8_escape(input_string):...\n",
"\"\"\"docstring\"\"\"\n",
"return bytes(input_string, 'iso-8859-1').decode('utf-8')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __init__(self):...\n",
"self.content = VAR_2\n"
] | [
"def __init__(self):...\n",
"self.content = content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_16(self, VAR_35=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.match_filters = []\n",
"self.match_conditions = []\n",
"VAR_54 = False\n",
"if not self.user:\n",
"self.user = frappe.session.user\n",
"if not self.tables:\n",
"self.extract_tables()\n",
"VAR_1 = frappe.get_meta(self.doctype)... | [
"def build_match_conditions(self, as_condition=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.match_filters = []\n",
"self.match_conditions = []\n",
"only_if_shared = False\n",
"if not self.user:\n",
"self.user = frappe.session.user\n",
"if not self.tables:\n",
"self.extract_tables()\n",
"meta = f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Assig... |
[
"def FUNC_5(VAR_4):...\n",
"if isinstance(VAR_4, six.binary_type):\n",
"VAR_4 = six.text_type(VAR_4, 'utf-8', 'ignore')\n",
"VAR_4 = VAR_4.strip()\n",
"VAR_22 = bool(VAR_3.match(VAR_4))\n",
"if VAR_22 and VAR_7.match(VAR_4[-1]):\n",
"return False\n",
"return VAR_22\n"
] | [
"def isSimpleTerm(term):...\n",
"if isinstance(term, six.binary_type):\n",
"term = six.text_type(term, 'utf-8', 'ignore')\n",
"term = term.strip()\n",
"simple = bool(simpleTerm.match(term))\n",
"if simple and is_digit.match(term[-1]):\n",
"return False\n",
"return simple\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(self, VAR_0):...\n",
"VAR_7 = 'Blog: ' + VAR_0\n",
"VAR_8 = ContentConverter.getRenderedBody(VAR_0)\n",
"if not VAR_8:\n",
"VAR_8 = \"<p>The post under '{}' does not exist.</p>\".format(VAR_0)\n",
"self.render('templates/BlogPost.html', title=contentTitle, postBody=\n renderedBody)\n"
] | [
"def get(self, request):...\n",
"contentTitle = 'Blog: ' + request\n",
"renderedBody = ContentConverter.getRenderedBody(request)\n",
"if not renderedBody:\n",
"renderedBody = \"<p>The post under '{}' does not exist.</p>\".format(request)\n",
"self.render('templates/BlogPost.html', title=contentTitle, post... | [
0,
5,
5,
0,
5,
5
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"@auth.public...\n",
""
] | [
"@auth.public...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_15(self):...\n",
"self.run_test_case(self.scenario.register_load_balancer_instances())\n"
] | [
"def test_c_register_load_balancer_instances(self):...\n",
"self.run_test_case(self.scenario.register_load_balancer_instances())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"VAR_1 = 'cmd'\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\has-a-weird-shell.txt',\n VAR_1), '\"C:\\\\Windows\\\\has-a-weird-shell.txt\"')\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\lolrofl\\\\dirs\\\\', VAR_1\n ), '\"C:\\\\Windows\\\\lolrofl\... | [
"def test_escape_path_argument_cmd(self):...\n",
"_type = 'cmd'\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\has-a-weird-shell.txt',\n _type), '\"C:\\\\Windows\\\\has-a-weird-shell.txt\"')\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\lolrofl\\\\dirs\\\\', _type\n ), '\"C:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __hash__(self):...\n",
"return self._file.__hash__()\n"
] | [
"def __hash__(self):...\n",
"return self._file.__hash__()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"return self.name\n"
] | [
"def get_name(self):...\n",
"return self.name\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_42():...\n",
"print('PAGE {}'.format(VAR_100))\n",
"VAR_117 = 'string'.format(VAR_100)\n",
"VAR_41 = get(VAR_117)\n",
"VAR_6 = VAR_41.text\n",
"VAR_46 = BeautifulSoup(VAR_6, 'html.parser')\n",
"VAR_118 = 'singles' if VAR_32 else 'doubles'\n",
"VAR_104 = VAR_46.find_all('a')\n",
"for link i... | [
"def iterate():...\n",
"print('PAGE {}'.format(page))\n",
"results_url = (\n 'https://smash.gg/tournaments?per_page=30&filter=%7B%22upcoming%22%3Afalse%2C%22videogameIds%22%3A4%2C%22past%22%3Atrue%7D&page={}'\n .format(page))\n",
"r = get(results_url)\n",
"data = r.text\n",
"soup = BeautifulSoup(dat... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"For",
"For",
"Return'",
"Return'"
] |
[
"from collections import defaultdict\n",
"from typing import Dict, Iterator, TypeVar\n",
"from .interface import ISpy\n",
"VAR_0 = TypeVar('T', bound=ISpy)\n",
"selected_fields: Dict[str, ISpy]\n",
"is_subquery: bool\n",
"def __init__(self):...\n",
"self.selected_fields = defaultdict(self.__class__)\n... | [
"from collections import defaultdict\n",
"from typing import Dict, Iterator, TypeVar\n",
"from .interface import ISpy\n",
"T = TypeVar('T', bound=ISpy)\n",
"selected_fields: Dict[str, ISpy]\n",
"is_subquery: bool\n",
"def __init__(self):...\n",
"self.selected_fields = defaultdict(self.__class__)\n",
... | [
0,
4,
4,
0,
0,
0,
0,
4,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"AnnAssign'",
"AnnAssign'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_3):...\n",
"return ((65535 & VAR_3) << 16) + ((4294901760 & VAR_3) >> 16)\n"
] | [
"def hash(n):...\n",
"return ((65535 & n) << 16) + ((4294901760 & n) >> 16)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_22(VAR_2, VAR_18, VAR_19):...\n",
"if VAR_18.provider.id == '8.9.10.11':\n"
] | [
"def _validate(cluster_api, endpoint, conn):...\n",
"if endpoint.provider.id == '8.9.10.11':\n"
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.NO_USER, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.NO_USER, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_21(self, VAR_2, VAR_3, VAR_4, *VAR_6):...\n",
"VAR_46 = self.pool.get('res.request')\n",
"VAR_47 = self.browse(VAR_2, VAR_3, VAR_4)\n",
"for VAR_23 in VAR_47:\n",
"VAR_51 = VAR_23.project_id\n",
"return True\n",
"if VAR_51:\n",
"if VAR_51.warn_manager and VAR_51.manager and VAR_51.manager.id... | [
"def do_close(self, cr, uid, ids, *args):...\n",
"request = self.pool.get('res.request')\n",
"tasks = self.browse(cr, uid, ids)\n",
"for task in tasks:\n",
"project = task.project_id\n",
"return True\n",
"if project:\n",
"if project.warn_manager and project.manager and project.manager.id != uid:\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0 = Client()\n",
"VAR_1 = VAR_2.environ['PHOBOS_DSS_connect_string']\n",
"VAR_2.environ['PHOBOS_DSS_connect_string'\n ] = \"dbname='tata', user='titi', password='toto'\"\n",
"self.assertRaises(EnvironmentError, VAR_0.connect)\n",
"VAR_2.enviro... | [
"def test_client_connect_refused(self):...\n",
"\"\"\"docstring\"\"\"\n",
"cli = Client()\n",
"environ_save = os.environ['PHOBOS_DSS_connect_string']\n",
"os.environ['PHOBOS_DSS_connect_string'\n ] = \"dbname='tata', user='titi', password='toto'\"\n",
"self.assertRaises(EnvironmentError, cli.connect)\n... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"__author__ = 'Kyle Chesney'\n",
"from flask import *\n",
"from flask_login import LoginManager\n",
"import sqlite3\n",
"from datetime import datetime as dt\n",
"VAR_0 = Flask(__name__)\n",
"VAR_1 = LoginManager(VAR_0)\n",
"@VAR_0.route('/')...\n",
"return render_template('login.html')\n"
] | [
"__author__ = 'Kyle Chesney'\n",
"from flask import *\n",
"from flask_login import LoginManager\n",
"import sqlite3\n",
"from datetime import datetime as dt\n",
"app = Flask(__name__)\n",
"login = LoginManager(app)\n",
"@app.route('/')...\n",
"return render_template('login.html')\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"@require_POST...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_51 = datetime.datetime.now()\n",
"VAR_52 = VAR_0.POST.copy()\n",
"VAR_1 = VAR_52.get('content_type')\n",
"VAR_53 = VAR_52.get('value_type', 'str')\n",
"VAR_54 = VAR_52.get('object_pk')\n",
"VAR_55 = VAR_52.get('field')\n",
"VAR_45 = VAR_52.get('v... | [
"@require_POST...\n",
"\"\"\"docstring\"\"\"\n",
"now = datetime.datetime.now()\n",
"data = request.POST.copy()\n",
"ctype = data.get('content_type')\n",
"vtype = data.get('value_type', 'str')\n",
"object_pk_str = data.get('object_pk')\n",
"field = data.get('field')\n",
"value = data.get('value')\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Cond... |
[
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._zinc_factory._compiler_bridge(self._products)\n"
] | [
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._zinc_factory._compiler_bridge(self._products)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"VAR_0.full_clean()\n",
"VAR_8 = CLASS_3(VAR_0)\n",
"VAR_9 = [('%s %s %s' % (VAR_11, VAR_11.name, VAR_8.depth)) for VAR_11 in VAR_8]\n",
"self.assertListEqual(['on_enter: ', 'on_enter: level2', 'on_exit: level2',\n 'on_enter: level2s[a]', 'on_exit: level2s[a]', 'on_enter: level2... | [
"def test_structure(self):...\n",
"TEST_STRUCTURE.full_clean()\n",
"resource_iter = TestResourceTraversalIterator(TEST_STRUCTURE)\n",
"resources = [('%s %s %s' % (r, r.name, resource_iter.depth)) for r in\n resource_iter]\n",
"self.assertListEqual(['on_enter: ', 'on_enter: level2', 'on_exit: level2',\n ... | [
0,
0,
0,
0,
1,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@Json...\n",
"if VAR_2._chk_error(errors.NO_TITLE):\n",
"VAR_2._chk_error(errors.TITLE_TOO_LONG)\n",
"VAR_2._chk_errors((errors.NO_LOCATION, errors.NO_DESCRIPTION, errors.\n INVALID_DATE, errors.NO_DATE))\n",
"VAR_2._focus('title')\n",
"if VAR_2.error:\n",
"return\n",
"VAR_0 = Meetup(author_id=c.u... | [
"@Json...\n",
"if res._chk_error(errors.NO_TITLE):\n",
"res._chk_error(errors.TITLE_TOO_LONG)\n",
"res._chk_errors((errors.NO_LOCATION, errors.NO_DESCRIPTION, errors.\n INVALID_DATE, errors.NO_DATE))\n",
"res._focus('title')\n",
"if res.error:\n",
"return\n",
"meetup = Meetup(author_id=c.user._id, ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_10(self):...\n",
"from invenio.modules.oauthclient.models import RemoteAccount\n",
"RemoteAccount.create(1, 'testid', None)\n",
"self.assert401(self.client.get(url_for('oauthclient_settings.index'),\n follow_redirects=True))\n",
"self.login('admin', '')\n",
"VAR_10 = self.client.get(url_for('... | [
"def test_settings_view(self):...\n",
"from invenio.modules.oauthclient.models import RemoteAccount\n",
"RemoteAccount.create(1, 'testid', None)\n",
"self.assert401(self.client.get(url_for('oauthclient_settings.index'),\n follow_redirects=True))\n",
"self.login('admin', '')\n",
"res = self.client.get(u... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assert'",
"Assert'",
"Assert'",
"Assert'"
] |
[
"def FUNC_13(self):...\n",
"return any([FiletypeCompleterExistsForFiletype(x) for x in vimsupport.\n CurrentFiletypes()])\n"
] | [
"def NativeFiletypeCompletionAvailable(self):...\n",
"return any([FiletypeCompleterExistsForFiletype(x) for x in vimsupport.\n CurrentFiletypes()])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._device_class\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._device_class\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"VAR_91 = Subreddit._by_fullname(VAR_102.post.keys())\n",
"return VAR_91.values()\n"
] | [
"def run(self):...\n",
"subreddits = Subreddit._by_fullname(request.post.keys())\n",
"return subreddits.values()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"VAR_5 = models.Session.create()\n",
"VAR_3 = models.Session.query().count()\n",
"self.assertTrue(VAR_3 == 1)\n",
"VAR_2 = EngineAuthRequest.blank('/auth/google')\n",
"VAR_2.cookies['_eauth'] = VAR_5.serialize()\n",
"VAR_9 = VAR_2.get_response(VAR_0)\n",
"VAR_9.request = VAR_... | [
"def test_save_session(self):...\n",
"s = models.Session.create()\n",
"s_count = models.Session.query().count()\n",
"self.assertTrue(s_count == 1)\n",
"req = EngineAuthRequest.blank('/auth/google')\n",
"req.cookies['_eauth'] = s.serialize()\n",
"resp = req.get_response(app)\n",
"resp.request = req\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_42(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.cursor.execute('create table t1(a int, b varchar(10))')\n",
"VAR_28 = [(1, 'good'), ('error', 'not an int'), (3, 'good')]\n",
"self.assertRaises(pyodbc.Error, self.cursor.executemany,\n 'insert into t1(a, b) value (?, ?)', VAR_28)\n"
] | [
"def test_executemany_failure(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.cursor.execute('create table t1(a int, b varchar(10))')\n",
"params = [(1, 'good'), ('error', 'not an int'), (3, 'good')]\n",
"self.assertRaises(pyodbc.Error, self.cursor.executemany,\n 'insert into t1(a, b) value (?, ?)', param... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self, VAR_7, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = None\n",
"VAR_11 = self.common._safe_hostname(VAR_10['host'])\n",
"VAR_33 = self.common.get_cpg(VAR_7, allowSnap=True)\n",
"VAR_13 = self.common.get_domain(VAR_33)\n",
"VAR_25 = self.common._get_3par_host(VAR_11)\n",
"VAR_1... | [
"def _create_host(self, volume, connector):...\n",
"\"\"\"docstring\"\"\"\n",
"host = None\n",
"hostname = self.common._safe_hostname(connector['host'])\n",
"cpg = self.common.get_cpg(volume, allowSnap=True)\n",
"domain = self.common.get_domain(cpg)\n",
"host = self.common._get_3par_host(hostname)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5():...\n",
"self.set_status(404, 'Not Found')\n",
"self._headers = tornado.httputil.HTTPHeaders()\n",
"self.add_header('Content-Length', '0')\n",
"self.flush()\n",
"return\n"
] | [
"def invoke_404():...\n",
"self.set_status(404, 'Not Found')\n",
"self._headers = tornado.httputil.HTTPHeaders()\n",
"self.add_header('Content-Length', '0')\n",
"self.flush()\n",
"return\n"
] | [
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@FUNC_7...\n",
"\"\"\"docstring\"\"\"\n",
"FUNC_1(VAR_1, VAR_2)\n",
"return redirect('/')\n"
] | [
"@oauth_error_handler...\n",
"\"\"\"docstring\"\"\"\n",
"response_token_setter(remote, resp)\n",
"return redirect('/')\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Return'"
] |
[
"import datetime\n",
"VAR_0 = [('This is the first post.', datetime.datetime.now())]\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"return reversed(VAR_0)\n"
] | [
"import datetime\n",
"POSTS = [('This is the first post.', datetime.datetime.now())]\n",
"def get_posts():...\n",
"\"\"\"docstring\"\"\"\n",
"return reversed(POSTS)\n"
] | [
0,
4,
0,
0,
4
] | [
"Import'",
"Assign'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"VAR_2 = 'response'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 500, 'error message',\n None, None))\n",
"time.sleep(mox.IgnoreArg())\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.Igno... | [
"def testUrlOpenHTTPErrorWithRetry(self):...\n",
"response = 'response'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 500, 'error message',\n None, None))\n",
"time.sleep(mox.IgnoreArg())\n",
"url_helper.urllib2.urlopen(... | [
0,
0,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"import geopandas as gpd\n",
"import numpy as np\n",
"VAR_49 = gpd.read_file(self.subdomains_fn)\n",
"VAR_50 = VAR_49.groupby(self.id_field)\n",
"VAR_29 = self.rasterio_raster.height, self.rasterio_raster.width\n",
"VAR_30 = self.rasterio_raster.aff... | [
"def _rasterize_subdomains(self):...\n",
"\"\"\"docstring\"\"\"\n",
"import geopandas as gpd\n",
"import numpy as np\n",
"gdf = gpd.read_file(self.subdomains_fn)\n",
"id_groups = gdf.groupby(self.id_field)\n",
"out_shape = self.rasterio_raster.height, self.rasterio_raster.width\n",
"out_transform = se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@property...\n",
"return self._params\n"
] | [
"@property...\n",
"return self._params\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(self, VAR_1):...\n",
"VAR_1.seek(0, 2)\n",
"VAR_5 = VAR_1.tell()\n",
"VAR_1.seek(0)\n",
"return VAR_5\n"
] | [
"def get_filesize(self, file):...\n",
"file.seek(0, 2)\n",
"size = file.tell()\n",
"file.seek(0)\n",
"return size\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"super(CLASS_0, self).setUp()\n",
"self.shard = os.environ.get('SHARD')\n",
"self.env_var_override = EnvironmentVarGuard()\n"
] | [
"def setUp(self):...\n",
"super(TestPaverBokChoyCmd, self).setUp()\n",
"self.shard = os.environ.get('SHARD')\n",
"self.env_var_override = EnvironmentVarGuard()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(VAR_3, VAR_2=None, VAR_4=True, VAR_5=True):...\n",
"\"\"\"docstring\"\"\"\n",
"assert isinstance(VAR_3, dict)\n",
"if VAR_5:\n",
"VAR_3 = VAR_3.copy()\n",
"if VAR_2:\n",
"VAR_39 = None\n",
"VAR_40 = VAR_3.pop(VAR_0, None)\n",
"if isinstance(VAR_2, (tuple, list)):\n",
"if not VAR_40:\n"... | [
"def create_resource_from_dict(d, resource=None, full_clean=True, copy_dict=True...\n",
"\"\"\"docstring\"\"\"\n",
"assert isinstance(d, dict)\n",
"if copy_dict:\n",
"d = d.copy()\n",
"if resource:\n",
"resource_type = None\n",
"document_resource_name = d.pop(DEFAULT_TYPE_FIELD, None)\n",
"if isinst... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Assert'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Con... |
[
"@rt.switch_runtime(fixtures.TEST_SITE_CONFIG, 'sys0')...\n",
"VAR_32 = CLASS_3.find_check\n",
"VAR_31 = CLASS_3.num_deps\n",
"VAR_0 = self.loader.load_all()\n",
"VAR_37 = VAR_32('Test0', VAR_0)\n",
"VAR_38 = VAR_32('Test1_default', VAR_0)\n",
"VAR_38.depends_on('Test0', rfm.DEPEND_EXACT, {'eX': ['e0']}... | [
"@rt.switch_runtime(fixtures.TEST_SITE_CONFIG, 'sys0')...\n",
"find_check = TestDependencies.find_check\n",
"num_deps = TestDependencies.num_deps\n",
"checks = self.loader.load_all()\n",
"test0 = find_check('Test0', checks)\n",
"test1 = find_check('Test1_default', checks)\n",
"test1.depends_on('Test0', ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assert'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1.name not in VAR_13:\n",
"if not callable(VAR_13[VAR_1.name]):\n",
"return VAR_13[VAR_1.name]\n",
"VAR_36 = [(VAR_15.val if isinstance(VAR_15, Variable) else VAR_15) for\n VAR_15 in VAR_1.params]\n",
"return VAR_13[VAR_1.name](*VAR_36)\n"
] | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if A.name not in operator_map:\n",
"if not callable(operator_map[A.name]):\n",
"return operator_map[A.name]\n",
"p = [(x.val if isinstance(x, Variable) else x) for x in A.params]\n",
"return operator_map[A.name](*p)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_10='main'):...\n",
"VAR_26 = 'string' % {'database': VAR_10}\n",
"self.db.executescript(VAR_26)\n",
"self.db.executescript('VACUUM;')\n",
"self.db.commit()\n"
] | [
"def optimize_database(self, database='main'):...\n",
"sqlstr = (\n \"\"\"\n CREATE TABLE tmp AS SELECT * FROM %(database)s.phrases;\n DELETE FROM %(database)s.phrases;\n INSERT INTO %(database)s.phrases SELECT * FROM tmp ORDER BY\n input_phrase, mlen ASC, user_freq ... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.fileExists(VAR_8):\n",
"VAR_7 = \"SELECT mod_time FROM {0} WHERE path='{1}';\".format(VAR_2, VAR_8)\n",
"print(\"getModTime: File doesn't exist\")\n",
"VAR_16 = self._run_command(VAR_7)\n",
"VAR_16 = None\n",
"VAR_16 = VAR_16[0][0]\n... | [
"def getModTime(self, pth):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.fileExists(pth):\n",
"command = \"SELECT mod_time FROM {0} WHERE path='{1}';\".format(TABLE_NAME, pth)\n",
"print(\"getModTime: File doesn't exist\")\n",
"result = self._run_command(command)\n",
"result = None\n",
"result = result[... | [
0,
0,
0,
4,
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self, VAR_15, VAR_8):...\n",
"VAR_27, VAR_28 = super().as_sql(VAR_15, VAR_8)\n",
"VAR_27 = '%s::%s' % (VAR_27, self.lhs.output_field.db_type(VAR_8))\n",
"return VAR_27, VAR_28\n"
] | [
"def as_sql(self, qn, connection):...\n",
"sql, params = super().as_sql(qn, connection)\n",
"sql = '%s::%s' % (sql, self.lhs.output_field.db_type(connection))\n",
"return sql, params\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"self.run_test_case(self.scenario.upsert_load_balancer(VAR_5=True))\n"
] | [
"def test_b_upsert_load_balancer_vpc(self):...\n",
"self.run_test_case(self.scenario.upsert_load_balancer(use_vpc=True))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"VAR_4 = HttpResponse(VT().getPcap(VAR_1), content_type=\n 'application/vnd.tcpdump.pcap')\n",
"VAR_4['Content-Disposition'] = 'filename=%s.pcap' % VAR_1\n",
"return VAR_4\n"
] | [
"def getpcap(request, pk):...\n",
"response = HttpResponse(VT().getPcap(pk), content_type=\n 'application/vnd.tcpdump.pcap')\n",
"response['Content-Disposition'] = 'filename=%s.pcap' % pk\n",
"return response\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_7 = argparse.ArgumentParser()\n",
"VAR_7.add_argument('content_src_dir', help=\n 'Source directory containing content to be intalled.')\n",
"VAR_7.add_argument('content_dst_dir', help=\n 'Name of directory under <WWW-ROOT> for content to be located.')\n",
"VAR_7.add_arg... | [
"def parse_args(argv):...\n",
"parser = argparse.ArgumentParser()\n",
"parser.add_argument('content_src_dir', help=\n 'Source directory containing content to be intalled.')\n",
"parser.add_argument('content_dst_dir', help=\n 'Name of directory under <WWW-ROOT> for content to be located.')\n",
"parser.... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_17):...\n",
"self.json = VAR_17\n"
] | [
"def __init__(self, json):...\n",
"self.json = json\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_3(self):...\n",
"VAR_5 = [{'application': self.TEST_APP, 'stack': self.TEST_STACK,\n 'credentials': self.bindings['GCE_CREDENTIALS'], 'zone': self.TEST_ZONE,\n 'network': 'default', 'targetSize': 1, 'capacity': {'min': 1, 'max': 1,\n 'desired': 1}, 'availabilityZones': {self.TEST_REGION: [self.... | [
"def create_instances(self):...\n",
"job = [{'application': self.TEST_APP, 'stack': self.TEST_STACK,\n 'credentials': self.bindings['GCE_CREDENTIALS'], 'zone': self.TEST_ZONE,\n 'network': 'default', 'targetSize': 1, 'capacity': {'min': 1, 'max': 1,\n 'desired': 1}, 'availabilityZones': {self.TEST_REGION... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_1, VAR_2, VAR_5, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"VAR_30 = VAR_4.get('states', [])\n",
"VAR_31 = VAR_4.get('what', ())\n",
"if not VAR_5:\n",
"VAR_5 = self.search(VAR_1, VAR_2, [])\n",
"VAR_29 = {}.fromkeys(VAR_5, 0.0)\n",
... | [
"def get_product_available(self, cr, uid, ids, context=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if context is None:\n",
"context = {}\n",
"states = context.get('states', [])\n",
"what = context.get('what', ())\n",
"if not ids:\n",
"ids = self.search(cr, uid, [])\n",
"res = {}.fromkeys(ids, 0.0)\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
0,
4,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition"... |
[
"@classmethod...\n",
"VAR_17 = str(VAR_12)\n",
"VAR_18 = \"UPPER(tag.name) LIKE UPPER('%%%s%%')\" % VAR_17\n",
"return self.select(VAR_18)\n"
] | [
"@classmethod...\n",
"text_query_str = str(text_query)\n",
"sql_query = \"UPPER(tag.name) LIKE UPPER('%%%s%%')\" % text_query_str\n",
"return self.select(sql_query)\n"
] | [
0,
4,
4,
4
] | [
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_17(VAR_4, VAR_1):...\n",
"VAR_38 = 5\n",
"if VAR_4 == 'country_ru' or VAR_4 == 'country_en':\n",
"VAR_52 = users.find_one(VAR_1).language + VAR_4\n",
"VAR_52 = VAR_4\n",
"VAR_39 = VAR_14 + timedelta(minutes=cache_time) < datetime.now(\n ) if VAR_14 else True\n",
"if not VAR_15.get(VAR_52, N... | [
"def function_launcher(item_type, message):...\n",
"cache_time = 5\n",
"if item_type == 'country_ru' or item_type == 'country_en':\n",
"result_id = users.find_one(message).language + item_type\n",
"result_id = item_type\n",
"high_time = when_was_called + timedelta(minutes=cache_time) < datetime.now(\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7, VAR_8 = self.lineBuffer[0:self.lineBufferIndex], self.lineBuffer[self\n .lineBufferIndex:]\n",
"self.lineBuffer = VAR_7 + VAR_1 + VAR_8\n",
"self.lineBufferIndex += len(VAR_1)\n"
] | [
"def insert_buffer(self, buf):...\n",
"\"\"\"docstring\"\"\"\n",
"lead, rest = self.lineBuffer[0:self.lineBufferIndex], self.lineBuffer[self.\n lineBufferIndex:]\n",
"self.lineBuffer = lead + buf + rest\n",
"self.lineBufferIndex += len(buf)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"AugAssign'"
] |
[
"def FUNC_17(self, VAR_10='_cores _nodes'.split()):...\n",
"VAR_23 = {name: res for name, res in self.resources.items() if name not in\n VAR_10}\n",
"VAR_24 = {name: value for name, value in self.params.items()}\n",
"VAR_25 = {'rule': self.rule.name, 'local': self.dag.workflow.is_local(self.\n rule), 'i... | [
"def properties(self, omit_resources='_cores _nodes'.split()):...\n",
"resources = {name: res for name, res in self.resources.items() if name not in\n omit_resources}\n",
"params = {name: value for name, value in self.params.items()}\n",
"properties = {'rule': self.rule.name, 'local': self.dag.workflow.is_... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_1, VAR_2, VAR_8=None, VAR_9='form', VAR_4=None, VAR_14...\n",
"VAR_29 = super(CLASS_0, self).fields_view_get(VAR_1, VAR_2, VAR_8, VAR_9,\n VAR_4, VAR_14=toolbar, VAR_15=submenu)\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"if 'location' in VAR_4 and VAR_4['location']:\n",
"VAR_51 =... | [
"def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=...\n",
"res = super(product_product, self).fields_view_get(cr, uid, view_id,\n view_type, context, toolbar=toolbar, submenu=submenu)\n",
"if context is None:\n",
"context = {}\n",
"if 'location' in context and context['location'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"For",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition... |
[
"@receiver(VAR_5, **decorator_kwargs)...\n",
"if settings.SUSPEND_SIGNALS:\n",
"return\n",
"return VAR_17(VAR_23, **kwargs)\n"
] | [
"@receiver(signal, **decorator_kwargs)...\n",
"if settings.SUSPEND_SIGNALS:\n",
"return\n",
"return func(sender, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_24(self, *VAR_71, **VAR_72):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.params = VAR_71, VAR_72\n",
"return VAR_101\n"
] | [
"def params(self, *params, **kwparams):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.params = params, kwparams\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self, VAR_21, VAR_11, **VAR_6):...\n",
"if CLASS_28.has_unaccent is None:\n",
"VAR_45 = VAR_11.cursor()\n",
"if CLASS_28.has_unaccent:\n",
"VAR_45.execute(\n \"SELECT COUNT(proname) FROM pg_proc WHERE proname = 'f_unaccent';\")\n",
"CLASS_28.function = 'F_UNACCENT'\n",
"return super().as... | [
"def as_sql(self, compiler, connection, **kwargs):...\n",
"if CustomUnaccent.has_unaccent is None:\n",
"cursor = connection.cursor()\n",
"if CustomUnaccent.has_unaccent:\n",
"cursor.execute(\n \"SELECT COUNT(proname) FROM pg_proc WHERE proname = 'f_unaccent';\")\n",
"CustomUnaccent.function = 'F_UNACCE... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Assign'"
] |
[
"@wraps(VAR_3)...\n",
"VAR_6 = VAR_5.headers.get(VAR_1)\n",
"VAR_11 = VAR_5.session.get_csrf_token()\n",
"if VAR_6 == VAR_11:\n",
"return VAR_3(VAR_9, VAR_5)\n"
] | [
"@wraps(fn)...\n",
"token = request.headers.get(HEADER_NAME)\n",
"session_token = request.session.get_csrf_token()\n",
"if token == session_token:\n",
"return fn(context, request)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_57():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"VAR_38 = set(['a'])\n",
"self.cursor.execute('insert into t1 (word) VALUES (?)', [VAR_38])\n"
] | [
"def f():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"words = set(['a'])\n",
"self.cursor.execute('insert into t1 (word) VALUES (?)', [words])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_11(self):...\n",
"return '{} {}'.format(FUNC_0(self.name), self.type.for_schema())\n"
] | [
"def for_schema(self):...\n",
"return '{} {}'.format(escape_col(self.name), self.type.for_schema())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(self, VAR_6):...\n",
"if 'doctype' in VAR_6:\n",
"self.set('doctype', VAR_6.get('doctype'))\n",
"for VAR_7 in default_fields:\n",
"if VAR_7 in VAR_6:\n",
"for VAR_7, VAR_9 in iteritems(VAR_6):\n",
"self.set(VAR_7, VAR_6.get(VAR_7))\n",
"self.set(VAR_7, VAR_9)\n",
"return self\n"
] | [
"def update(self, d):...\n",
"if 'doctype' in d:\n",
"self.set('doctype', d.get('doctype'))\n",
"for key in default_fields:\n",
"if key in d:\n",
"for key, value in iteritems(d):\n",
"self.set(key, d.get(key))\n",
"self.set(key, value)\n",
"return self\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"For",
"Condition",
"For",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self, VAR_8, VAR_9, VAR_10=None, VAR_11=None, VAR_12=(...\n",
"get_and_check_project(VAR_9, VAR_11, VAR_12)\n",
"VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n",
"VAR_28.pending_action = VAR_8\n",
"VAR_28.last_error = None\n",
"VAR_28.save()\n",
"scheduler.process_pending_tasks(ba... | [
"def set_pending_action(self, pending_action, request, pk=None, project_pk=...\n",
"get_and_check_project(request, project_pk, perms)\n",
"task = self.queryset.get(pk=pk, project=project_pk)\n",
"task.pending_action = pending_action\n",
"task.last_error = None\n",
"task.save()\n",
"scheduler.process_pen... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self, VAR_5):...\n",
"self.common = self._init_common()\n",
"self._check_flags()\n",
"self.common.do_setup(VAR_5)\n"
] | [
"def do_setup(self, context):...\n",
"self.common = self._init_common()\n",
"self._check_flags()\n",
"self.common.do_setup(context)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"self.common.terminate_connection(VAR_6, VAR_9['host'], VAR_9['wwpns'])\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"self.common.terminate_connection(volume, connector['host'], connector['wwpns'])\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Expr'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.