lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2():...\n",
"VAR_30 = VAR_10.find(' ')\n",
"VAR_24 = VAR_10[:VAR_30]\n",
"VAR_42 = ''\n",
"VAR_12 = VAR_10[VAR_30 + 1:]\n",
"self.emph = 1 if VAR_24.find('*') > -1 else 0\n",
"self.uncover = 2 if VAR_24.find('+') > -1 else 0\n",
"self.kind = 0\n",
"self.resume = False\n",
"if VAR_24.find... | [
"def innerFunc():...\n",
"i = txt.find(' ')\n",
"marker = txt[:i]\n",
"describee = ''\n",
"content = txt[i + 1:]\n",
"self.emph = 1 if marker.find('*') > -1 else 0\n",
"self.uncover = 2 if marker.find('+') > -1 else 0\n",
"self.kind = 0\n",
"self.resume = False\n",
"if marker.find('.') > -1:\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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Ass... |
[
"def FUNC_0(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1.user.is_authenticated():\n",
"VAR_5 = VAR_1.POST.get(REDIRECT_FIELD_NAME, VAR_1.GET.get(\n REDIRECT_FIELD_NAME, ''))\n",
"return django_login(VAR_1, VAR_4='userprofile/login.html', extra_context={\n 'shibboleth_login': 'shibboleth_login' ... | [
"def login(request):...\n",
"\"\"\"docstring\"\"\"\n",
"if request.user.is_authenticated():\n",
"redirect_to = request.POST.get(REDIRECT_FIELD_NAME, request.GET.get(\n REDIRECT_FIELD_NAME, ''))\n",
"return django_login(request, template_name='userprofile/login.html',\n extra_context={'shibboleth_login... | [
0,
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self, VAR_9, VAR_10, VAR_11, VAR_16={}):...\n",
"get_and_check_project(VAR_9, VAR_11)\n",
"VAR_28 = self.queryset.annotate(**annotate).get(VAR_10=pk, VAR_1=project_pk)\n",
"return VAR_28\n"
] | [
"def get_and_check_task(self, request, pk, project_pk, annotate={}):...\n",
"get_and_check_project(request, project_pk)\n",
"task = self.queryset.annotate(**annotate).get(pk=pk, project=project_pk)\n",
"return task\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"if VAR_0 and PasswordManager.verify(self.get_argument('password')):\n",
"VAR_21 = random.SystemRandom()\n",
"print(\"Refused user {} (password doesn't match any in database)\".format(\n self.get_argument('name')))\n",
"VAR_22 = str(VAR_21.getrandbits(128))\n",
"self.redirect... | [
"def post(self):...\n",
"if enable_authentication and PasswordManager.verify(self.get_argument(\n",
"randomGenerator = random.SystemRandom()\n",
"print(\"Refused user {} (password doesn't match any in database)\".format(\n self.get_argument('name')))\n",
"cookieSecret = str(randomGenerator.getrandbits(12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"import binascii\n",
"import time\n",
"from datetime import datetime\n",
"from ipaddress import ip_address\n",
"import flask\n",
"from nyaa import email, forms, models\n",
"from nyaa.extensions import db\n",
"from nyaa.utils import sha1_hash\n",
"from nyaa.views.users import get_activation_link, get... | [
"import binascii\n",
"import time\n",
"from datetime import datetime\n",
"from ipaddress import ip_address\n",
"import flask\n",
"from nyaa import email, forms, models\n",
"from nyaa.extensions import db\n",
"from nyaa.utils import sha1_hash\n",
"from nyaa.views.users import get_activation_link, get... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
... |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.shutting_down:\n",
"return\n",
"self._logger.warning('Events connection dropped, attempting to reconnect')\n",
"self.failed_attempts = 0\n",
"self.connect_timer = QTimer()\n",
"self.connect_timer.setSingleShot(True)\n",
"self.connect_time... | [
"def on_finished(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.shutting_down:\n",
"return\n",
"self._logger.warning('Events connection dropped, attempting to reconnect')\n",
"self.failed_attempts = 0\n",
"self.connect_timer = QTimer()\n",
"self.connect_timer.setSingleShot(True)\n",
"self.connect... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_43(self, VAR_41, VAR_43):...\n",
"self[VAR_41:VAR_41 + 1] = VAR_43\n",
"VAR_55 = len(VAR_43) - 1\n",
"for VAR_40, (i, j) in self._names.items():\n",
"if i > VAR_41:\n",
"self._names[VAR_40] = i + VAR_55, j + VAR_55\n",
"if i == VAR_41:\n",
"self.set_name(VAR_40, i, VAR_42=i + len(items))\n"
... | [
"def insert_items(self, index, items):...\n",
"self[index:index + 1] = items\n",
"add = len(items) - 1\n",
"for name, (i, j) in self._names.items():\n",
"if i > index:\n",
"self._names[name] = i + add, j + add\n",
"if i == index:\n",
"self.set_name(name, i, end=i + len(items))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Condition",
"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_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return True\n"
] | [
"def is_missing_default_route(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return True\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self, VAR_18, VAR_15=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_15:\n",
"VAR_15 = self.uid\n",
"self._client.write(json.dumps({'cmd': VAR_18, 'uid': VAR_15}).encode('utf8'\n ) + b'\\n')\n",
"self._client.flush()\n",
"return self._client.readline()\n"
] | [
"def _cmd(self, command, uid=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not uid:\n",
"uid = self.uid\n",
"self._client.write(json.dumps({'cmd': command, 'uid': uid}).encode('utf8') +\n b'\\n')\n",
"self._client.flush()\n",
"return self._client.readline()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __init__(self):...\n",
""
] | [
"def __init__(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@property...\n",
"return self._subworkflows.values()\n"
] | [
"@property...\n",
"return self._subworkflows.values()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self):...\n",
"assert not app.config['USE_AUTH']\n"
] | [
"def __init__(self):...\n",
"assert not app.config['USE_AUTH']\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assert'"
] |
[
"def __init__(self, VAR_16):...\n",
"self.flags = dict()\n"
] | [
"def __init__(self, value):...\n",
"self.flags = dict()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_21(self):...\n",
"return Java.global_javac_classpath(self.context.products)\n"
] | [
"def javac_classpath(self):...\n",
"return Java.global_javac_classpath(self.context.products)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = CLASS_1.get_user_by_id(VAR_3)\n",
"VAR_22.accept_license_terms(VAR_21)\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"user = UserService.get_user_by_id(user_id)\n",
"user.accept_license_terms(license_id)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_21.USE_OPENID:\n",
"VAR_52 = FUNC_3\n",
"VAR_52 = FUNC_2\n",
"return FUNC_4, VAR_52, FUNC_5\n"
] | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if conf.USE_OPENID:\n",
"cookie_auth = openid_cookie_authentication\n",
"cookie_auth = gae_cookie_authentication\n",
"return oauth_authentication, cookie_auth, service_to_service_authentication\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_18, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"self.auth = VAR_18\n",
"self.data = None\n",
"self.station_data = None\n",
"self.station = VAR_19\n"
] | [
"def __init__(self, auth, station):...\n",
"\"\"\"docstring\"\"\"\n",
"self.auth = auth\n",
"self.data = None\n",
"self.station_data = None\n",
"self.station = station\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_30(VAR_6):...\n",
"return FUNC_7(VAR_6, 'Referrer-Policy', 'no-referrer')\n"
] | [
"def validate_no_referrer_policy(page):...\n",
"return validate_security_header(page, 'Referrer-Policy', 'no-referrer')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"set_temp_root(self._ray_params.temp_dir)\n",
"VAR_0.info('Process STDOUT and STDERR is being redirected to {}.'.format(\n get_logs_dir_path()))\n",
"if self._redis_address is None:\n",
"self.start_redis()\n",
"self.start_plasma_store()\n",
"sel... | [
"def start_ray_processes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"set_temp_root(self._ray_params.temp_dir)\n",
"logger.info('Process STDOUT and STDERR is being redirected to {}.'.format(\n get_logs_dir_path()))\n",
"if self._redis_address is None:\n",
"self.start_redis()\n",
"self.start_plasma_store... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_15(VAR_28, VAR_29):...\n",
"VAR_29.setFormatter(logging.Formatter(VAR_26, datefmt=DATE_FORMAT))\n",
"VAR_28.addHandler(VAR_29)\n"
] | [
"def add_handler(logger, handler):...\n",
"handler.setFormatter(logging.Formatter(LOG_FORMAT, datefmt=DATE_FORMAT))\n",
"logger.addHandler(handler)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_6):...\n",
"if isinstance(VAR_6, str):\n",
"VAR_6 = json.loads(VAR_6)\n",
"return VAR_6\n"
] | [
"def to_python(self, value):...\n",
"if isinstance(value, str):\n",
"value = json.loads(value)\n",
"return value\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"@classmethod...\n",
"if isinstance(VAR_2, CLASS_1):\n",
"return VAR_2\n",
"if isinstance(VAR_2, six.string_types):\n",
"return VAR_1(*[FUNC_0(a) for a in VAR_2.split('.')])\n"
] | [
"@classmethod...\n",
"if isinstance(path, TraversalPath):\n",
"return path\n",
"if isinstance(path, six.string_types):\n",
"return cls(*[_split_atom(a) for a in path.split('.')])\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.netatmo_data.update()\n",
"VAR_13 = self.netatmo_data.data.get(self.module_name)\n",
"if VAR_13 is None:\n",
"VAR_0.warning('No data found for %s', self.module_name)\n",
"if self.type == 'temperature':\n",
"self._state = STATE_UNKNOWN\n",
"s... | [
"def update(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.netatmo_data.update()\n",
"data = self.netatmo_data.data.get(self.module_name)\n",
"if data is None:\n",
"_LOGGER.warning('No data found for %s', self.module_name)\n",
"if self.type == 'temperature':\n",
"self._state = STATE_UNKNOWN\n",
"sel... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition"... |
[
"def __bool__(self):...\n",
"return bool(self._r_item_)\n"
] | [
"def __bool__(self):...\n",
"return bool(self._r_item_)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from base import Field\n",
"VAR_0 = 'id'\n",
"VAR_1 = 'INT'\n",
"def __init__(self, VAR_0=None, *VAR_2, **VAR_3):...\n",
"super(CLASS_0, self).__init__(*VAR_2, **kwargs)\n",
"def FUNC_0(self, VAR_0):...\n",
"VAR_5 = 'id SERIAL PRIMARY KEY'\n",
"return VAR_5\n"
] | [
"from base import Field\n",
"name = 'id'\n",
"TYPE = 'INT'\n",
"def __init__(self, name=None, *args, **kwargs):...\n",
"super(PrimaryKeyField, self).__init__(*args, **kwargs)\n",
"def create_field(self, name):...\n",
"field_string = 'id SERIAL PRIMARY KEY'\n",
"return field_string\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@api.require(lambda : True)...\n",
""
] | [
"@api.require(lambda : True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"@cached_property...\n",
"return {VAR_46.attname: VAR_46 for VAR_46 in self.element_fields}\n"
] | [
"@cached_property...\n",
"return {f.attname: f for f in self.element_fields}\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_7(VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_4:\n",
"return\n",
"VAR_1.info('Setting up admin users')\n",
"VAR_14 = CONFIG_FILE\n",
"if os.path.exists(VAR_14):\n",
"VAR_15 = yaml.load(f)\n",
"VAR_15 = {}\n",
"VAR_15['users'] = VAR_15.get('users', {})\n",
"VAR_15['users']['ad... | [
"def ensure_admins(admins):...\n",
"\"\"\"docstring\"\"\"\n",
"if not admins:\n",
"return\n",
"logger.info('Setting up admin users')\n",
"config_path = CONFIG_FILE\n",
"if os.path.exists(config_path):\n",
"config = yaml.load(f)\n",
"config = {}\n",
"config['users'] = config.get('users', {})\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_17(self):...\n",
"self.first.wait()\n",
"self.second.wait()\n"
] | [
"def wait(self):...\n",
"self.first.wait()\n",
"self.second.wait()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11():...\n",
"from core.boot import settings\n",
"VAR_39 = lambda VAR_50: _stderr(VAR_50\n ) if settings.DEBUG_MODE is True else lambda VAR_50: None\n",
"return VAR_39\n"
] | [
"def _stddebug_():...\n",
"from core.boot import settings\n",
"_stddebug = lambda x: _stderr(x\n ) if settings.DEBUG_MODE is True else lambda x: None\n",
"return _stddebug\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return os.path.realpath(self.home)\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return os.path.realpath(self.home)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_28(self, VAR_5):...\n",
"if not self._user_options['seed_identifiers_with_syntax']:\n",
"return\n",
"VAR_18 = vimsupport.CurrentFiletypes()[0]\n",
"if VAR_18 in self._filetypes_with_keywords_loaded:\n",
"return\n",
"self._filetypes_with_keywords_loaded.add(VAR_18)\n",
"VAR_5['syntax_keywords... | [
"def _AddSyntaxDataIfNeeded(self, extra_data):...\n",
"if not self._user_options['seed_identifiers_with_syntax']:\n",
"return\n",
"filetype = vimsupport.CurrentFiletypes()[0]\n",
"if filetype in self._filetypes_with_keywords_loaded:\n",
"return\n",
"self._filetypes_with_keywords_loaded.add(filetype)\n",... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Assign'"
] |
[
"def FUNC_0(VAR_3):...\n",
"VAR_6 = 0\n",
"VAR_14, VAR_15 = getopt.getopt(VAR_3, 'b:t:o:', ['backdoor=', 'target=',\n 'outfile='])\n",
"print('USAGE:\\tajar.py -b <backdoor.java> -t <target.jar> [-o <outfile.jar>]')\n",
"for opt, arg in VAR_14:\n",
"sys.exit(2)\n",
"if opt == '-h':\n",
"if (VAR_0 !... | [
"def main(argv):...\n",
"help = 0\n",
"opts, args = getopt.getopt(argv, 'b:t:o:', ['backdoor=', 'target=', 'outfile=']\n )\n",
"print('USAGE:\\tajar.py -b <backdoor.java> -t <target.jar> [-o <outfile.jar>]')\n",
"for opt, arg in opts:\n",
"sys.exit(2)\n",
"if opt == '-h':\n",
"if (backdoor != None)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"For",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_4(self, VAR_5):...\n",
"for oldg in VAR_5.get_ancestors():\n",
"if oldg not in self.groups:\n",
"if VAR_5 not in self.groups:\n",
"self.add_group(oldg)\n",
"self.groups.append(VAR_5)\n"
] | [
"def add_group(self, group):...\n",
"for oldg in group.get_ancestors():\n",
"if oldg not in self.groups:\n",
"if group not in self.groups:\n",
"self.add_group(oldg)\n",
"self.groups.append(group)\n"
] | [
0,
0,
0,
0,
1,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.abspath + '.original'\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.abspath + '.original'\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_27(VAR_21):...\n",
"if VAR_21.type != 'response':\n",
"return False\n",
"VAR_33['msg'] = VAR_21\n",
"return VAR_21.request_seq == VAR_13\n"
] | [
"def match(msg):...\n",
"if msg.type != 'response':\n",
"return False\n",
"result['msg'] = msg\n",
"return msg.request_seq == seq\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_5, VAR_6, VAR_24, VAR_27=0, VAR_26=None, VAR_28=None,...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_13 is None:\n",
"VAR_13 = {}\n",
"VAR_39 = []\n",
"VAR_58 = super(CLASS_0, self).search(VAR_5, VAR_6, VAR_24, VAR_27, VAR_26,\n VAR_28, VAR_13, VAR_29)\n",
"if VAR_13.get('budget_id')... | [
"def search(self, cr, uid, args, offset=0, limit=None, order=None, context=...\n",
"\"\"\"docstring\"\"\"\n",
"if context is None:\n",
"context = {}\n",
"result = []\n",
"parent_result = super(budget_item, self).search(cr, uid, args, offset,\n limit, order, context, count)\n",
"if context.get('budget... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = self.bindings\n",
"VAR_6 = VAR_1['TEST_APP_COMPONENT_NAME']\n",
"VAR_7 = '{0}/targetPools/{1}-tp'.format(VAR_1['TEST_GCE_REGION'], VAR_6)\n",
"VAR_8 = {'checkIntervalSec': 9, 'healthyThreshold': 3, 'unhealthyThreshold':\n 5, 'timeoutSec': 2,... | [
"def upsert_load_balancer(self):...\n",
"\"\"\"docstring\"\"\"\n",
"bindings = self.bindings\n",
"load_balancer_name = bindings['TEST_APP_COMPONENT_NAME']\n",
"target_pool_name = '{0}/targetPools/{1}-tp'.format(bindings[\n 'TEST_GCE_REGION'], load_balancer_name)\n",
"spec = {'checkIntervalSec': 9, 'hea... | [
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __gt__(self, VAR_16):...\n",
"VAR_39 = self.workflow._ruleorder.compare(self, VAR_16)\n",
"return VAR_39 > 0\n"
] | [
"def __gt__(self, rule):...\n",
"comp = self.workflow._ruleorder.compare(self, rule)\n",
"return comp > 0\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self, VAR_1):...\n",
"VAR_23 = self._validated_binaries.get(VAR_1)\n",
"if not VAR_23:\n",
"VAR_23 = self._validate_executable(VAR_1)\n",
"return VAR_23\n",
"self._validated_binaries[VAR_1] = VAR_23\n"
] | [
"def _validated_executable(self, name):...\n",
"exe = self._validated_binaries.get(name)\n",
"if not exe:\n",
"exe = self._validate_executable(name)\n",
"return exe\n",
"self._validated_binaries[name] = exe\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_2(VAR_1, VAR_2):...\n",
""
] | [
"def queryAll(cursor, reqString):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_4(self):...\n",
"return VAR_15['user']\n"
] | [
"def current_user(self):...\n",
"return session['user']\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_20(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = VAR_21.rstrip('/')\n",
"VAR_60 = os.path.basename(VAR_21)\n",
"VAR_61 = os.path.dirname(VAR_21)\n",
"VAR_58 = self.getfile(VAR_21, VAR_23=False)\n",
"if VAR_58 == False:\n",
"if VAR_58[VAR_2] != VAR_12:\n",
"if len(self.get_path... | [
"def rmdir(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"path = path.rstrip('/')\n",
"name = os.path.basename(path)\n",
"parent = os.path.dirname(path)\n",
"dir = self.getfile(path, follow_symlinks=False)\n",
"if dir == False:\n",
"if dir[A_TYPE] != T_DIR:\n",
"if len(self.get_path(path)) > 0:\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self, VAR_2, *VAR_3, **VAR_4):...\n",
"self.storage.clear_passphrases()\n",
"return super().get(VAR_2, *VAR_3, **kwargs)\n"
] | [
"def get(self, request, *args, **kwargs):...\n",
"self.storage.clear_passphrases()\n",
"return super().get(request, *args, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_11(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.closed:\n",
"if self._adapter is not None:\n",
"assert self._session is None\n",
"self._adapter = DebugAdapter.start(VAR_9, VAR_2=self._port)\n",
"return self._adapter\n"
] | [
"def start_detached(self, argv):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.closed:\n",
"if self._adapter is not None:\n",
"assert self._session is None\n",
"self._adapter = DebugAdapter.start(argv, port=self._port)\n",
"return self._adapter\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Assert'",
"Assign'",
"Return'"
] |
[
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = self.get_binary_path_from_tgz(VAR_10=self._relpath, VAR_6=self.\n version, VAR_11='node.tar.gz', VAR_12='node')\n",
"VAR_0.debug('Node path: %s', VAR_21)\n",
"return VAR_21\n"
] | [
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"node_path = self.get_binary_path_from_tgz(supportdir=self._relpath, version\n =self.version, filename='node.tar.gz', inpackage_path='node')\n",
"logger.debug('Node path: %s', node_path)\n",
"return node_path\n"
] | [
2,
0,
2,
2,
2
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"if len(self.written):\n",
"return self.written[0]\n"
] | [
"def getWrittenData(self):...\n",
"if len(self.written):\n",
"return self.written[0]\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"async def FUNC_5(self):...\n",
"for key in (VAR_2, VAR_1):\n",
"await FUNC_5(key % self.post_id)\n"
] | [
"async def clear_mc(self):...\n",
"for key in (MC_KEY_N_COMMENTS, MC_KEY_COMMENT_LIST):\n",
"await clear_mc(key % self.post_id)\n"
] | [
0,
0,
0
] | [
"AsyncFunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_11(self, VAR_9, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = None\n",
"def FUNC_15():...\n",
"if VAR_14 not in self._timers:\n",
"return\n",
"self._timers.remove(VAR_14)\n",
"VAR_10()\n",
"logging.exception('Timer callback failed')\n",
"if not self._timers_dying:\n",
"VAR_14 = ... | [
"def call_later(self, delay_sec, callback):...\n",
"\"\"\"docstring\"\"\"\n",
"timer = None\n",
"def call_wrapper():...\n",
"if timer not in self._timers:\n",
"return\n",
"self._timers.remove(timer)\n",
"callback()\n",
"logging.exception('Timer callback failed')\n",
"if not self._timers_dying:\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_31(VAR_1, VAR_16):...\n",
"VAR_30 = VAR_1.xsrf_token_data == {'some': 'data'}\n",
"VAR_12.append((VAR_16, VAR_30))\n"
] | [
"def record(request_handler, method):...\n",
"is_valid = request_handler.xsrf_token_data == {'some': 'data'}\n",
"calls.append((method, is_valid))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_3 = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n",
"self.driver._eql_execute('volume', 'select', VAR_3['volume_name'],\n 'snapshot', 'delete', VAR_3['name'])\n",
"self.mox.ReplayAll()\... | [
"def test_delete_snapshot(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n",
"self.driver._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'delete', snapshot['name'])\n",
... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_read_json(%s, %s)', VAR_3[:500], str(VAR_6)[:500])\n",
"if not self._requests:\n",
"return None\n",
"VAR_6.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == VAR_3:\n",
"self.fail('Unknown request %s' % VAR_3)\n"... | [
"def _url_read_json(self, url, **kwargs):...\n",
"logging.warn('url_read_json(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_3(self, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6, VAR_7, VAR_8 = self.redis_client.hmget(VAR_2, ['driver_id',\n 'function', 'run_on_other_drivers'])\n",
"if utils.decode(VAR_8\n",
"return\n",
"VAR_10 = pickle.loads(VAR_7)\n",
"VAR_11 = traceback.format_exc()\n",
"VAR_10({'worker':... | [
"def fetch_and_execute_function_to_run(self, key):...\n",
"\"\"\"docstring\"\"\"\n",
"driver_id, serialized_function, run_on_other_drivers = self.redis_client.hmget(\n key, ['driver_id', 'function', 'run_on_other_drivers'])\n",
"if utils.decode(run_on_other_drivers\n",
"return\n",
"function = pickle.lo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __init__(self):...\n",
"super(CLASS_0, self).__init__()\n"
] | [
"def __init__(self):...\n",
"super(Code, self).__init__()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(self, VAR_13):...\n",
"if not VAR_13:\n"
] | [
"def p_error(self, p):...\n",
"if not p:\n"
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(VAR_5, VAR_6):...\n",
"return db.fetchone(VAR_5, CLASS_0,\n f'SELECT note_id, user_id, content, created_at, updated_at FROM note WHERE note_id = {VAR_6}'\n , ())\n"
] | [
"def _find_note(cur, note_id):...\n",
"return db.fetchone(cur, Note,\n f'SELECT note_id, user_id, content, created_at, updated_at FROM note WHERE note_id = {note_id}'\n , ())\n"
] | [
0,
4
] | [
"FunctionDef'",
"Return'"
] |
[
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"await self.simple_embed('string', VAR_2=\n 'If you get a red screen trying to open the Homebrew Launcher')\n"
] | [
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"await self.simple_embed(\n \"\"\"A red screen indicates that there is no boot.3dsx on root.\nIf you have a starter folder on root, place the contents of the starter folder on root.\nIf not, redownload the [Homebrew Starter Kit](https://smealum.github.io... | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'"
] |
[
"def FUNC_4(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_open(%s, %s)', VAR_3[:500], str(VAR_6)[:500])\n",
"if not self._requests:\n",
"return None\n",
"VAR_6.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == VAR_3:\n",
"self.fail('Unknown request %s' % VAR_3)\n",
"... | [
"def _url_open(self, url, **kwargs):...\n",
"logging.warn('url_open(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)\n",
"da... | [
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self, VAR_1, VAR_9, VAR_11=None):...\n",
"VAR_11 = deepcopy(self.content.data)\n",
"VAR_19 = VAR_11['module_index']\n",
"VAR_20 = VAR_11['exercise_index']\n",
"VAR_21 = VAR_11['modules']\n",
"VAR_22 = VAR_11['categories']\n",
"VAR_23 = VAR_11['total']\n",
"def FUNC_7(VAR_24):...\n",
"for... | [
"def _generate_data(self, instance, user, data=None):...\n",
"data = deepcopy(self.content.data)\n",
"module_index = data['module_index']\n",
"exercise_index = data['exercise_index']\n",
"modules = data['modules']\n",
"categories = data['categories']\n",
"total = data['total']\n",
"def r_augment(child... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"For",
"Condition",
"For",
"Expr'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"FunctionDef'",
"For",
"For",
"Assign'",
"Assign'",
"Ass... |
[
"def FUNC_4(self):...\n",
"self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n"
] | [
"def test_filters_2(self):...\n",
"self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@renderer...\n",
"if self._error_msg is not None:\n",
"return VAR_8(self._error_msg)\n",
"return VAR_8('')\n"
] | [
"@renderer...\n",
"if self._error_msg is not None:\n",
"return tag(self._error_msg)\n",
"return tag('')\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_3(VAR_6):...\n",
"for settings_key in VAR_12:\n",
"assert VAR_5.registry.settings.get(settings_key)\n"
] | [
"def assert_settings_keys(keys):...\n",
"for settings_key in key:\n",
"assert config.registry.settings.get(settings_key)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assert'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._name\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._name\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_22(self, VAR_29, VAR_12):...\n",
"return self.account_for(VAR_12).mail_store.add_mail('INBOX', VAR_29.raw)\n"
] | [
"def add_mail_to_user_inbox(self, input_mail, username):...\n",
"return self.account_for(username).mail_store.add_mail('INBOX', input_mail.raw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_33):...\n",
"self.literal = VAR_33\n"
] | [
"def __init__(self, literal):...\n",
"self.literal = literal\n"
] | [
0,
4
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_15(VAR_28, VAR_29):...\n",
"VAR_29.setFormatter(logging.Formatter(VAR_26, datefmt=DATE_FORMAT))\n",
"VAR_28.addHandler(VAR_29)\n"
] | [
"def add_handler(logger, handler):...\n",
"handler.setFormatter(logging.Formatter(LOG_FORMAT, datefmt=DATE_FORMAT))\n",
"logger.addHandler(handler)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertTrue(self.client.login(username='autotest2', password='password'))\n",
"VAR_4 = 'autotest'\n",
"VAR_2 = '/api/apps'\n",
"VAR_5 = {'id': VAR_4}\n",
"VAR_3 = self.client.post(VAR_2, json.dumps(VAR_5), content_type=\n 'application/json')\n... | [
"def test_admin_can_manage_other_apps(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertTrue(self.client.login(username='autotest2', password='password'))\n",
"app_id = 'autotest'\n",
"url = '/api/apps'\n",
"body = {'id': app_id}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n... | [
0,
0,
5,
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'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(**VAR_6):...\n",
"VAR_30 = 1\n",
"VAR_30 = VAR_6.get('level')\n",
"if not FUNC_6(VAR_29=give_level):\n",
"print(\n '<center><h3 style=\"color: red\">How did you get here?! O_o You do not have need permissions</h>'\n )\n",
"print('<meta http-equiv=\"refresh\" content=\"5; url=/\">')\n",
... | [
"def page_for_admin(**kwargs):...\n",
"give_level = 1\n",
"give_level = kwargs.get('level')\n",
"if not is_admin(level=give_level):\n",
"print(\n '<center><h3 style=\"color: red\">How did you get here?! O_o You do not have need permissions</h>'\n )\n",
"print('<meta http-equiv=\"refresh\" content=\"... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Import'",
"Expr'"
] |
[
"@web.authenticated...\n",
"self.get(VAR_1, VAR_2=False)\n"
] | [
"@web.authenticated...\n",
"self.get(path, include_body=False)\n"
] | [
0,
5
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_1, VAR_2=None):...\n",
"return CLASS_3(VAR_1, VAR_2=_raise)\n"
] | [
"def r(item, _raise=None):...\n",
"return Roamer(item, _raise=_raise)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_24(VAR_25, VAR_23, *VAR_24):...\n",
"if VAR_23 == 'on_after_task':\n",
"VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n",
"self.assertEqual(False, VAR_50)\n",
"self.assertEqual(True, VAR_51)\n",
"self.assertEqual({'pool': 'default'}, VAR_5)\n",
"self.assertEqual({}, VAR_52)\n"
] | [
"def call_hook(_botobj, name, *args):...\n",
"if name == 'on_after_task':\n",
"failure, internal_failure, dimensions, summary = args\n",
"self.assertEqual(False, failure)\n",
"self.assertEqual(True, internal_failure)\n",
"self.assertEqual({'pool': 'default'}, dimensions)\n",
"self.assertEqual({}, summar... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"if self.column.render_function:\n",
"return self.column.render_function(self.object)\n",
"VAR_10 = getattr(self.object, self.column.field_name\n ) if self.column.field_name else None\n",
"if type(self.object) == dict:\n",
"VAR_4 = self.object.get(self.column.field_name)\n",
... | [
"def get_value(self):...\n",
"if self.column.render_function:\n",
"return self.column.render_function(self.object)\n",
"field = getattr(self.object, self.column.field_name\n ) if self.column.field_name else None\n",
"if type(self.object) == dict:\n",
"value = self.object.get(self.column.field_name)\n",... | [
0,
0,
3,
0,
3,
0,
0,
3,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@classmethod...\n",
"if VAR_3 is None:\n",
"VAR_3 = VAR_2.HOST, VAR_2.PORT\n",
"VAR_12 = CLASS_0.create_client(VAR_3, VAR_6=kwargs.get('timeout'))\n",
"return VAR_2(VAR_12, VAR_15=True, **kwargs)\n"
] | [
"@classmethod...\n",
"if addr is None:\n",
"addr = cls.HOST, cls.PORT\n",
"conn = DebugSessionConnection.create_client(addr, timeout=kwargs.get('timeout')\n )\n",
"return cls(conn, owned=True, **kwargs)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_1, VAR_2, *VAR_3, **VAR_4):...\n",
"self.handled_resp = VAR_1\n",
"self.handled_remote = VAR_2\n",
"self.handled_args = VAR_3\n",
"self.handled_kwargs = VAR_4\n",
"return 'TEST'\n"
] | [
"def handler(self, resp, remote, *args, **kwargs):...\n",
"self.handled_resp = resp\n",
"self.handled_remote = remote\n",
"self.handled_args = args\n",
"self.handled_kwargs = kwargs\n",
"return 'TEST'\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return {'name': self.name, 'id': self.id}\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return {'name': self.name, 'id': self.id}\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_4 = '/api/apps/{app_id}/containers'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, ... | [
"def test_container_scale_errors(self):...\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/containers'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assert... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
... |
[
"def FUNC_1(VAR_1):...\n",
"return str(VAR_1).translate(None, ',')\n"
] | [
"def remove_commas_from_string(input_string):...\n",
"return str(input_string).translate(None, ',')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"VAR_18 = \"\"\"\n from crm_phonecall c\n \"\"\"\n",
"return VAR_18\n"
] | [
"def _from(self):...\n",
"from_str = \"\"\"\n from crm_phonecall c\n \"\"\"\n",
"return from_str\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_3, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = VAR_4.get_all_permissions()\n",
"VAR_18 = VAR_3.get_all_permissions()\n",
"VAR_19 = []\n",
"for VAR_6 in settings.CONCEPTS:\n",
"VAR_29 = VAR_6.replace('.', '.add_')\n",
"return VAR_19\n",
"VAR_30 = apps.get_model(VAR_6)\n",
"i... | [
"def get_available_concepts(employee, transaction):...\n",
"\"\"\"docstring\"\"\"\n",
"concepts_permitted_by_transaction = transaction.get_all_permissions()\n",
"concepts_permitted_by_employee = employee.get_all_permissions()\n",
"available_concepts = []\n",
"for concept in settings.CONCEPTS:\n",
"permi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.eng:\n",
"self.eng.reset()\n",
"self.eng, VAR_12 = sf.Engine(self.wires, VAR_11=self.hbar)\n",
"self.reset()\n",
"for operation in self._queue:\n",
"if operation.name not in VAR_0:\n",
"self.state = self.eng.run('gaussian')\n",
"VAR_16 ... | [
"def execute(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.eng:\n",
"self.eng.reset()\n",
"self.eng, q = sf.Engine(self.wires, hbar=self.hbar)\n",
"self.reset()\n",
"for operation in self._queue:\n",
"if operation.name not in operator_map:\n",
"self.state = self.eng.run('gaussian')\n",
"p = [(... | [
0,
0,
0,
0,
0,
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",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Conditi... |
[
"def FUNC_0(self, VAR_11=None, VAR_12=None):...\n",
"\"\"\"docstring\"\"\"\n",
"assert self.use_stdin and VAR_12 is not None or not self.use_stdin and VAR_11 is not None\n",
"VAR_21 = self.generate_config_file()\n",
"self.command = self._create_command(VAR_11=filename, VAR_21=config_file)\n",
"VAR_22 = ''... | [
"def lint(self, filename=None, file=None):...\n",
"\"\"\"docstring\"\"\"\n",
"assert self.use_stdin and file is not None or not self.use_stdin and filename is not None\n",
"config_file = self.generate_config_file()\n",
"self.command = self._create_command(filename=filename, config_file=config_file)\n",
"s... | [
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assert'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_33(VAR_39):...\n",
"return True\n"
] | [
"def acquire(self2):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"if self.options['inference']:\n",
"self._run_pre_inference(self.target_graph)\n",
"VAR_16 = find_shapes(self.shacl_graph)\n",
"VAR_17 = {}\n",
"for VAR_21 in VAR_16:\n",
"VAR_20 = VAR_21.validate(self.target_graph)\n",
"return VAR_17\n",
"VAR_17[VAR_21.node] = VAR_20\n"
] | [
"def run(self):...\n",
"if self.options['inference']:\n",
"self._run_pre_inference(self.target_graph)\n",
"shapes = find_shapes(self.shacl_graph)\n",
"results = {}\n",
"for s in shapes:\n",
"r = s.validate(self.target_graph)\n",
"return results\n",
"results[s.node] = r\n"
] | [
0,
1,
0,
0,
1,
0,
1,
1,
1
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_19(self, VAR_27):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_65 = 0\n",
"VAR_61 = self.execute(\n \"select count(*) from History WHERE md5sum = ? AND STATUS != 'Failed'\",\n (VAR_27,))\n",
"if VAR_61:\n",
"return VAR_65 > 0\n",
"VAR_65 = self.c.fetchone().get('count(*)')\n"
] | [
"def have_md5sum(self, md5sum):...\n",
"\"\"\"docstring\"\"\"\n",
"total = 0\n",
"res = self.execute(\n \"select count(*) from History WHERE md5sum = ? AND STATUS != 'Failed'\",\n (md5sum,))\n",
"if res:\n",
"return total > 0\n",
"total = self.c.fetchone().get('count(*)')\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_5(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'"
] |
[
"def __init__(self, VAR_7, **VAR_8):...\n",
"VAR_8['backend'] = 'Simulator'\n",
"super().__init__(VAR_7, **kwargs)\n"
] | [
"def __init__(self, wires, **kwargs):...\n",
"kwargs['backend'] = 'Simulator'\n",
"super().__init__(wires, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_8):...\n",
"if not self.current_user:\n",
"return False\n",
"if self.current_user.admin:\n",
"return True\n",
"VAR_8 = GroupList.check(self.current_user.key, VAR_8, self.sql_session)\n",
"return bool(VAR_8)\n"
] | [
"def is_group_user(self, group):...\n",
"if not self.current_user:\n",
"return False\n",
"if self.current_user.admin:\n",
"return True\n",
"group = GroupList.check(self.current_user.key, group, self.sql_session)\n",
"return bool(group)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"self.wz_sock.connect(self.wz_addr)\n"
] | [
"def wz_connect(self):...\n",
"self.wz_sock.connect(self.wz_addr)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(VAR_3, VAR_6):...\n",
"VAR_8 = VAR_3.cursor()\n",
"VAR_10 = VAR_8.execute(VAR_6)\n",
"VAR_3.commit()\n",
"print('delete data successfull')\n",
"return VAR_10\n"
] | [
"def deleteDB(conn, sql_delete):...\n",
"cur = conn.cursor()\n",
"result = cur.execute(sql_delete)\n",
"conn.commit()\n",
"print('delete data successfull')\n",
"return result\n"
] | [
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_19(self):...\n",
"self._diag_interface.OnCursorMoved()\n"
] | [
"def OnCursorMoved(self):...\n",
"self._diag_interface.OnCursorMoved()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@mock.patch('requests.post', FUNC_0)...\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_4 = '/api/apps/{app_id}/containers'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(V... | [
"@mock.patch('requests.post', mock_import_repository_task)...\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/containers'.format(**locals())\n",
"response = self.client.get(url)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assi... |
[
"@VAR_0.route('/', methods=['GET', 'POST'])...\n",
"VAR_13 = ''\n",
"if request.method == 'POST':\n",
"return render_template('index.html', VAR_13=error)\n",
"return render_template('index.html', VAR_13=error)\n",
"VAR_16 = request.form['username']\n",
"VAR_17 = request.form['password']\n",
"VAR_14 = ... | [
"@app.route('/', methods=['GET', 'POST'])...\n",
"error = ''\n",
"if request.method == 'POST':\n",
"return render_template('index.html', error=error)\n",
"return render_template('index.html', error=error)\n",
"username = request.form['username']\n",
"password = request.form['password']\n",
"data = use... | [
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_4 = '/api/apps/{app_id}/config'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertE... | [
"def test_config_hook(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/config'.format(**locals())\n",
"response = self.client.get(url)\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'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_5 = set(bot_main.get_dimensions(None))\n",
"VAR_5.discard('hidpi')\n",
"VAR_5.discard('zone')\n",
"VAR_6 = {'cores', 'cpu', 'gpu', 'id', 'machine_type', 'os', 'pool'}\n",
"self.assertEqual(VAR_6, VAR_5)\n"
] | [
"def test_get_dimensions(self):...\n",
"dimensions = set(bot_main.get_dimensions(None))\n",
"dimensions.discard('hidpi')\n",
"dimensions.discard('zone')\n",
"expected = {'cores', 'cpu', 'gpu', 'id', 'machine_type', 'os', 'pool'}\n",
"self.assertEqual(expected, dimensions)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@login_required...\n",
"\"\"\"docstring\"\"\"\n",
"return render_to_response('student_account/account_settings.html', FUNC_12(\n VAR_3))\n"
] | [
"@login_required...\n",
"\"\"\"docstring\"\"\"\n",
"return render_to_response('student_account/account_settings.html',\n account_settings_context(request))\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"return b'xxxx device\\nyyyy device'\n"
] | [
"def devices(self):...\n",
"return b'xxxx device\\nyyyy device'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, *VAR_5, **VAR_6):...\n",
"VAR_2 = VAR_6['campaign']\n",
"super(CLASS_0, self).__init__(*VAR_5, **kwargs)\n",
"VAR_27 = self.injection_choices(VAR_2, 'bit')\n",
"self.filters['bit'].extra.update(VAR_4=bit_choices)\n",
"self.filters['bit'].widget.attrs['size'] = min(len(VAR_27), 10)\n",
... | [
"def __init__(self, *args, **kwargs):...\n",
"campaign = kwargs['campaign']\n",
"super(injection_filter, self).__init__(*args, **kwargs)\n",
"bit_choices = self.injection_choices(campaign, 'bit')\n",
"self.filters['bit'].extra.update(choices=bit_choices)\n",
"self.filters['bit'].widget.attrs['size'] = min... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"E... |
[
"@property...\n",
"return self._handler.response\n"
] | [
"@property...\n",
"return self._handler.response\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.