lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@property...\n", "return self._handler.request\n" ]
[ "@property...\n", "return self._handler.request\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@contextmanager...\n", "yield\n" ]
[ "@contextmanager...\n", "yield\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_16(VAR_23):...\n", "\"\"\"docstring\"\"\"\n", "VAR_58 = {}\n", "if VAR_23:\n", "for VAR_91, expansions in iteritems(VAR_23):\n", "return VAR_23\n", "VAR_90 = ', '.join([('%s (%d)' % expansion) for expansion in expansions])\n", "VAR_58[VAR_91] = VAR_90\n" ]
[ "def _get_acronyms(acronyms):...\n", "\"\"\"docstring\"\"\"\n", "acronyms_str = {}\n", "if acronyms:\n", "for acronym, expansions in iteritems(acronyms):\n", "return acronyms\n", "expansions_str = ', '.join([('%s (%d)' % expansion) for expansion in\n expansions])\n", "acronyms_str[acronym] = expans...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "For", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_14(self, VAR_10, VAR_11):...\n", "VAR_24 = self.common._cli_run('createhost -add %s %s' % (VAR_10, ' '.join(\n VAR_11)), None)\n" ]
[ "def _modify_3par_fibrechan_host(self, hostname, wwn):...\n", "out = self.common._cli_run('createhost -add %s %s' % (hostname, ' '.join(\n wwn)), None)\n" ]
[ 0, 2 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_10(self):...\n", "return self.current_user()['email'].lower()\n" ]
[ "def current_email(self):...\n", "return self.current_user()['email'].lower()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(self, VAR_3):...\n", "VAR_4 = super().value_from_object(VAR_3)\n", "return self.to_python(VAR_4)\n" ]
[ "def value_from_object(self, obj):...\n", "value = super().value_from_object(obj)\n", "return self.to_python(value)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "VAR_1 = 'INVALID'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bla',\n VAR_1), '/home/us r/a-file with spaces.bla')\n", "self.assertEqual(escape_path_arg...
[ "def test_escape_path_argument_unsupported(self):...\n", "_type = 'INVALID'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', _type),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bla',\n _type), '/home/us r/a-file with spaces.bla')\n", "s...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_10(self, VAR_32):...\n", "self.tables.append(VAR_32)\n", "VAR_0 = VAR_32[4:-1]\n", "if not self.flags.ignore_permissions and not frappe.has_permission(VAR_0):\n", "frappe.flags.error_message = _('Insufficient Permission for {0}').format(frappe\n .bold(VAR_0))\n" ]
[ "def append_table(self, table_name):...\n", "self.tables.append(table_name)\n", "doctype = table_name[4:-1]\n", "if not self.flags.ignore_permissions and not frappe.has_permission(doctype):\n", "frappe.flags.error_message = _('Insufficient Permission for {0}').format(frappe\n .bold(doctype))\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_0(self, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "log.debug('Updating info about user %s language in memory & database...', self)\n", "self.language = VAR_5\n", "VAR_10 = (\n f\"UPDATE users SET language='{self.language}' WHERE chat_id='{self.chat_id}'\"\n )\n", "db.add(VAR_10)\n", "log...
[ "def set_language(self, lang):...\n", "\"\"\"docstring\"\"\"\n", "log.debug('Updating info about user %s language in memory & database...', self)\n", "self.language = lang\n", "query = (\n f\"UPDATE users SET language='{self.language}' WHERE chat_id='{self.chat_id}'\"\n )\n", "db.add(query)\n", "l...
[ 0, 0, 0, 0, 4, 4, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_14(self, VAR_7):...\n", "VAR_12 = VAR_7.model_class._meta.table_name\n", "VAR_7 = \"DELETE FROM {0} WHERE {1} = '{3}' AND {2}='{4}';\".format(VAR_12,\n VAR_7.model_class._meta.sorted_fields_names[0], VAR_7.model_class._meta\n .sorted_fields_names[1], VAR_7.objs[0].id, VAR_7.objs[1].id)\n", "re...
[ "def generate_remove(self, query):...\n", "table_name = query.model_class._meta.table_name\n", "query = \"DELETE FROM {0} WHERE {1} = '{3}' AND {2}='{4}';\".format(table_name,\n query.model_class._meta.sorted_fields_names[0], query.model_class._meta\n .sorted_fields_names[1], query.objs[0].id, query.objs[...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@VAR_2.route('/data/results/flot/day/')...\n", "\"\"\"docstring\"\"\"\n", "VAR_24, VAR_23 = FUNC_4(request.args)\n", "VAR_27 = ['android4.0', 'android2.3', 'linux32', 'winxp', 'win7', 'win8',\n 'osx10.6', 'osx10.7', 'osx10.8']\n", "VAR_28 = FUNC_0()\n", "VAR_29 = {}\n", "for VAR_38 in VAR_27:\n", ...
[ "@app.route('/data/results/flot/day/')...\n", "\"\"\"docstring\"\"\"\n", "start_date, end_date = clean_date_params(request.args)\n", "platforms = ['android4.0', 'android2.3', 'linux32', 'winxp', 'win7', 'win8',\n 'osx10.6', 'osx10.7', 'osx10.8']\n", "db = create_db_connnection()\n", "data_platforms = {...
[ 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'", "For", "Assign'", "Expr'", "Expr'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_20(self):...\n", "print('INFO: connection recovered')\n", "return DeadConnectionDetector.connectionRecovered(self)\n" ]
[ "def connectionRecovered(self):...\n", "print('INFO: connection recovered')\n", "return DeadConnectionDetector.connectionRecovered(self)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_7=None, VAR_8=None, VAR_9=True, VAR_10=True, VAR_11=True...\n", "if VAR_7:\n", "self.param = VAR_7\n", "self.param = self.default_param\n", "self.default = VAR_8\n", "self.post, self.get, self.url = VAR_9, VAR_10, VAR_11\n" ]
[ "def __init__(self, param=None, default=None, post=True, get=True, url=True):...\n", "if param:\n", "self.param = param\n", "self.param = self.default_param\n", "self.default = default\n", "self.post, self.get, self.url = post, get, url\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_2 is None:\n", "return None\n", "if not VAR_2.startswith('models:'):\n", "return VAR_2\n", "VAR_18 = VAR_2[7:VAR_2.rfind('/')].replace('/', '.')\n", "VAR_19 = f'parlai.zoo.{VAR_18}'\n", "print(VAR_19)\n", "VAR_36 = importlib.impo...
[ "def modelzoo_path(datapath, path):...\n", "\"\"\"docstring\"\"\"\n", "if path is None:\n", "return None\n", "if not path.startswith('models:'):\n", "return path\n", "animal = path[7:path.rfind('/')].replace('/', '.')\n", "module_name = f'parlai.zoo.{animal}'\n", "print(module_name)\n", "my_module...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'", "Assign'", "Expr'" ]
[ "def FUNC_17(self, VAR_20):...\n", "return super().form_invalid(VAR_20)\n" ]
[ "def form_invalid(self, form):...\n", "return super().form_invalid(form)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def act(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "@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'" ]
[ "from __future__ import unicode_literals\n", "from django.db import models, migrations\n", "VAR_0 = [('contenttypes', '0001_initial'), ('inheritance', '0001_initial')]\n", "VAR_1 = [migrations.CreateModel(name='BasePlugin', fields=[(\n 'modelwithinheritance_ptr', models.OneToOneField(parent_link=True,\n ...
[ "from __future__ import unicode_literals\n", "from django.db import models, migrations\n", "dependencies = [('contenttypes', '0001_initial'), ('inheritance',\n '0001_initial')]\n", "operations = [migrations.CreateModel(name='BasePlugin', fields=[(\n 'modelwithinheritance_ptr', models.OneToOneField(paren...
[ 0, 0, 0, 4 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "Assign'" ]
[ "def FUNC_13(self, VAR_19):...\n", "\"\"\"docstring\"\"\"\n", "if self.test_name is None:\n", "self.initFile('clockwise')\n", "self.testSquare(VAR_19, self.c_square)\n" ]
[ "def testCsquare(self, length):...\n", "\"\"\"docstring\"\"\"\n", "if self.test_name is None:\n", "self.initFile('clockwise')\n", "self.testSquare(length, self.c_square)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_1):...\n", "self.server = VAR_1.get('etcd_server', '127.0.0.1')\n", "self.port = int(VAR_1.get('etcd_port', 4001))\n", "self.namespace = VAR_1.get('namespace', '/custodia')\n", "self.etcd = etcd.Client(self.server, self.port)\n", "FUNC_0('Error creating namespace %s: [%r]' % (self....
[ "def __init__(self, config):...\n", "self.server = config.get('etcd_server', '127.0.0.1')\n", "self.port = int(config.get('etcd_port', 4001))\n", "self.namespace = config.get('namespace', '/custodia')\n", "self.etcd = etcd.Client(self.server, self.port)\n", "log_error('Error creating namespace %s: [%r]' %...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_33(self):...\n", "" ]
[ "def some_other_method(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(VAR_0):...\n", "print(VAR_0, file=sys.stderr)\n" ]
[ "def log_error(error):...\n", "print(error, file=sys.stderr)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "from time import time\n", "from saml2.ident import code\n", "from flask import session, request, redirect, current_app\n", "from eduid_common.authn.loa import get_loa\n", "from eduid_webapp.authn.acs_registry import acs_action\n", "@acs_action('login-action')...\n", "\"\"\"docstring\"\"\"\n", "curren...
[ "from time import time\n", "from saml2.ident import code\n", "from flask import session, request, redirect, current_app\n", "from eduid_common.authn.loa import get_loa\n", "from eduid_webapp.authn.acs_registry import acs_action\n", "@acs_action('login-action')...\n", "\"\"\"docstring\"\"\"\n", "curren...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_8(VAR_13, VAR_14):...\n", "VAR_5 = self.paths[VAR_13]\n", "return VAR_5._handlers.get(VAR_14, None)\n" ]
[ "def get_handlers(path, method):...\n", "component = self.paths[path]\n", "return component._handlers.get(method, None)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_2(self, VAR_6, VAR_7):...\n", "return next(filter(lambda field: field.name == VAR_7, VAR_6._meta.fields))\n" ]
[ "def _get_model_field(self, model, name):...\n", "return next(filter(lambda field: field.name == name, model._meta.fields))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0():...\n", "VAR_30 = []\n", "VAR_30.append('[image-original-none-http://simg4.gelbooru.com/' +\n '/images/db/1d/db1dfb62a40f5ced2043bb8966da9a98.png]')\n", "VAR_30.append('Каждый хочет дружить с ядерной бомбой.')\n", "VAR_30.append(str(random.randint(0, 9999999999)))\n", "return '\\n'.join(V...
[ "def message():...\n", "msg = []\n", "msg.append('[image-original-none-http://simg4.gelbooru.com/' +\n '/images/db/1d/db1dfb62a40f5ced2043bb8966da9a98.png]')\n", "msg.append('Каждый хочет дружить с ядерной бомбой.')\n", "msg.append(str(random.randint(0, 9999999999)))\n", "return '\\n'.join(msg)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_1(self, VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_37 = VAR_1.GET.get('regenerate') == 'true'\n", "return HttpResponse(status=409)\n", "VAR_39 = HttpResponse(content_type='application/binary')\n", "if VAR_37:\n", "VAR_39['Content-Disposition'] = 'attachment; filename=%s.pem' % slugi...
[ "def get(self, request, keypair_name):...\n", "\"\"\"docstring\"\"\"\n", "regenerate = request.GET.get('regenerate') == 'true'\n", "return HttpResponse(status=409)\n", "response = HttpResponse(content_type='application/binary')\n", "if regenerate:\n", "response['Content-Disposition'] = 'attachment; file...
[ 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_18(self, VAR_16, VAR_20):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = ['volume', 'select', VAR_16['name'], 'access', 'create',\n 'initiator', VAR_20['initiator']]\n", "VAR_0.error(_('Failed to initialize connection to volume %s'), VAR_16['name'])\n", "if self.configuration.eqlx_use_chap:\n", ...
[ "def initialize_connection(self, volume, connector):...\n", "\"\"\"docstring\"\"\"\n", "cmd = ['volume', 'select', volume['name'], 'access', 'create', 'initiator',\n connector['initiator']]\n", "LOG.error(_('Failed to initialize connection to volume %s'), volume['name'])\n", "if self.configuration.eqlx_u...
[ 0, 0, 0, 0, 0, 2, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_28(self):...\n", "VAR_21 = self._time\n", "self._time += 0.0001\n", "return VAR_21\n" ]
[ "def time(self):...\n", "ret = self._time\n", "self._time += 0.0001\n", "return ret\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "AugAssign'", "Return'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = CLASS_1().forward('--list')\n", "VAR_5 = str(VAR_4, 'utf-8').strip().split('\\n')\n", "VAR_6 = []\n", "for line in VAR_5:\n", "VAR_13 = line.split(' tcp:')\n", "return VAR_6\n", "if len(VAR_13) != 3:\n", "VAR_6.append(int(VAR_13[1]))\n" ]
[ "def list_occupied_adb_ports():...\n", "\"\"\"docstring\"\"\"\n", "out = AdbProxy().forward('--list')\n", "clean_lines = str(out, 'utf-8').strip().split('\\n')\n", "used_ports = []\n", "for line in clean_lines:\n", "tokens = line.split(' tcp:')\n", "return used_ports\n", "if len(tokens) != 3:\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Expr'" ]
[ "def FUNC_2(VAR_7=None, VAR_8=0, VAR_9=0):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_7 is None:\n", "return True\n", "return False\n", "VAR_21 = re.match('^([^;]+)(; length=([0-9]+))?$', VAR_7, re.IGNORECASE)\n", "VAR_22 = parse_http_date(VAR_21.group(1))\n", "VAR_23 = VAR_21.group(3)\n", "if VAR_23...
[ "def was_modified_since(header=None, mtime=0, size=0):...\n", "\"\"\"docstring\"\"\"\n", "if header is None:\n", "return True\n", "return False\n", "matches = re.match('^([^;]+)(; length=([0-9]+))?$', header, re.IGNORECASE)\n", "header_mtime = parse_http_date(matches.group(1))\n", "header_len = matche...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "Condition" ]
[ "def FUNC_6(self, VAR_41):...\n", "VAR_79 = CLASS_24.run(self, VAR_41)\n", "if VAR_79:\n", "if not VAR_79._loaded:\n", "return self.error(errors.NOT_AUTHOR)\n", "VAR_79._load()\n", "if VAR_101.user_is_loggedin and VAR_79.author_id == VAR_101.user._id:\n", "return VAR_79\n" ]
[ "def run(self, fullname):...\n", "thing = VByName.run(self, fullname)\n", "if thing:\n", "if not thing._loaded:\n", "return self.error(errors.NOT_AUTHOR)\n", "thing._load()\n", "if c.user_is_loggedin and thing.author_id == c.user._id:\n", "return thing\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Condition", "Return'", "Expr'", "Condition", "Return'" ]
[ "def FUNC_6(self, VAR_10, VAR_11):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def create_volume_from_snapshot(self, volume, snapshot):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "@VAR_0.filter...\n", "return reverse('model-edit', VAR_5=_normal_kwargs(model_object.\n course_instance, model_name, id=model_object.id))\n" ]
[ "@register.filter...\n", "return reverse('model-edit', kwargs=_normal_kwargs(model_object.\n course_instance, model_name, id=model_object.id))\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_12(VAR_0, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_23 = pd.read_sql_table(VAR_0, db.engine)\n", "print('NORMALIZATION FAILED')\n", "VAR_23[VAR_5] = (VAR_23[VAR_5] - VAR_23[VAR_5].mean()) / VAR_23[VAR_5].std(ddof\n =0)\n", "db.engine.execute('DROP TABLE \"{0}\"'.format(VAR_0))\n", "VAR...
[ "def normalize_attribute(table_name, attr):...\n", "\"\"\"docstring\"\"\"\n", "df = pd.read_sql_table(table_name, db.engine)\n", "print('NORMALIZATION FAILED')\n", "df[attr] = (df[attr] - df[attr].mean()) / df[attr].std(ddof=0)\n", "db.engine.execute('DROP TABLE \"{0}\"'.format(table_name))\n", "df.to_s...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "VAR_0 = requests.get('http://127.0.0.1:5000/profiles')\n", "self.assertEqual(VAR_0.status_code, 200)\n", "self.assertIsNotNone(VAR_0.text)\n", "print('/profiles get_user: {}'.format(VAR_0.text))\n", "VAR_1 = json.loads(VAR_0.text)\n", "for user in VAR_1:\n", "VAR_0 = request...
[ "def test_b_get_user(self):...\n", "resp = requests.get('http://127.0.0.1:5000/profiles')\n", "self.assertEqual(resp.status_code, 200)\n", "self.assertIsNotNone(resp.text)\n", "print('/profiles get_user: {}'.format(resp.text))\n", "users = json.loads(resp.text)\n", "for user in users:\n", "resp = requ...
[ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_12(VAR_10, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n", "for VAR_1 in oauth.remote_apps.values():\n", "FUNC_6(VAR_1)\n" ]
[ "def oauth_logout_handler(sender_app, user=None):...\n", "\"\"\"docstring\"\"\"\n", "for remote in oauth.remote_apps.values():\n", "token_delete(remote)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Expr'" ]
[ "import os\n", "import pickle\n", "from bs4 import BeautifulSoup\n", "import urllib3\n", "import certifi\n", "import re\n", "import sys\n", "import argparse as ap\n", "VAR_0 = lambda l: [item for sublist in l for item in sublist]\n", "def FUNC_0(VAR_1):...\n", "VAR_2 = urllib3.PoolManager(cert_r...
[ "import os\n", "import pickle\n", "from bs4 import BeautifulSoup\n", "import urllib3\n", "import certifi\n", "import re\n", "import sys\n", "import argparse as ap\n", "flatten = lambda l: [item for sublist in l for item in sublist]\n", "def getytlinks(link):...\n", "pm = urllib3.PoolManager(cert...
[ 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'", "Import'", "Import'", "Import'", "Import'", "Import'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_2(VAR_6, VAR_7, *VAR_8, **VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "import rasterio\n", "VAR_31 = rasterio.open(VAR_6).read(1)\n", "VAR_32 = rasterio.open(VAR_7).read(1)\n", "return VAR_32 - VAR_31\n" ]
[ "def diff(x, y, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "import rasterio\n", "baseline = rasterio.open(x).read(1)\n", "modeled = rasterio.open(y).read(1)\n", "return modeled - baseline\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Assign'", "Assign'", "Return'" ]
[ "import os\n", "def __init__(self, VAR_1):...\n", "self.debug = VAR_1.debug\n", "self.path = VAR_1.path\n", "self.repos = VAR_1.repos\n", "def FUNC_1(self, VAR_2):...\n", "def FUNC_0(VAR_0):...\n", "VAR_3 = VAR_0.add_argument_group('Common parameters')\n", "VAR_3.add_argument('--debug', action='stor...
[ "import os\n", "def __init__(self, args):...\n", "self.debug = args.debug\n", "self.path = args.path\n", "self.repos = args.repos\n", "def get_command_line(self, client):...\n", "def add_common_arguments(parser):...\n", "group = parser.add_argument_group('Common parameters')\n", "group.add_argument(...
[ 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1 ]
[ "Import'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_0.route('/users')...\n", "VAR_2 = connectToMySQL('users_db')\n", "VAR_3 = VAR_2.query_db('SELECT * FROM users;')\n", "return render_template('index.html', VAR_3=users)\n" ]
[ "@app.route('/users')...\n", "mysql = connectToMySQL('users_db')\n", "users = mysql.query_db('SELECT * FROM users;')\n", "return render_template('index.html', users=users)\n" ]
[ 0, 4, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Return'" ]
[ "import json\n", "import unittest\n", "import webtest\n", "from datamodel import Library, Version, Content\n", "from manage import app\n", "import util\n", "from google.appengine.ext import ndb\n", "from test_base import TestBase\n", "def FUNC_0(self):...\n", "TestBase.setUp(self)\n", "self.app ...
[ "import json\n", "import unittest\n", "import webtest\n", "from datamodel import Library, Version, Content\n", "from manage import app\n", "import util\n", "from google.appengine.ext import ndb\n", "from test_base import TestBase\n", "def setUp(self):...\n", "TestBase.setUp(self)\n", "self.app =...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Expr'", "Assign'", "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Expr'", "A...
[ "def FUNC_6(self, VAR_16):...\n", "self._WriteHeader('text/html')\n", "self._WriteTemplate('header.html')\n", "self.wfile.write('<table class=\"FileContents\">')\n", "VAR_31 = fp.read().replace('&', '&amp;').replace('<', '&lt;').replace('>',\n '&gt;').replace('\"', '&quot;')\n", "for i, line in enumera...
[ "def _DoRawSourceFile(self, full_path):...\n", "self._WriteHeader('text/html')\n", "self._WriteTemplate('header.html')\n", "self.wfile.write('<table class=\"FileContents\">')\n", "data = fp.read().replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;'\n ).replace('\"', '&quot;')\n", "for i, lin...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Assign'", "For", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_3(self):...\n", "self.handled_resp = 1\n", "self.handled_remote = 1\n", "self.handled_args = 1\n", "self.handled_kwargs = 1\n" ]
[ "def handler_invalid(self):...\n", "self.handled_resp = 1\n", "self.handled_remote = 1\n", "self.handled_args = 1\n", "self.handled_kwargs = 1\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = 'http://www.football-data.co.uk'\n", "VAR_14 = ['Date', 'Div', 'HomeTeam', 'AwayTeam']\n", "VAR_15 = ['BbAvH', 'BbAvA', 'BbAvD', 'BbAv>2.5', 'BbAv<2.5', 'BbAHh',\n 'BbAvAHH', 'BbAvAHA']\n", "VAR_16 = ['PSH', 'PSA', 'PSD', 'BbMx>2.5', 'BbMx...
[ "def create_fd_tables(leagues_ids):...\n", "\"\"\"docstring\"\"\"\n", "base_url = 'http://www.football-data.co.uk'\n", "cols = ['Date', 'Div', 'HomeTeam', 'AwayTeam']\n", "features_cols = ['BbAvH', 'BbAvA', 'BbAvD', 'BbAv>2.5', 'BbAv<2.5', 'BbAHh',\n 'BbAvAHH', 'BbAvAHA']\n", "odds_cols = ['PSH', 'PSA'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Expr'" ]
[ "def FUNC_43(VAR_127, VAR_96):...\n", "for VAR_121 in VAR_127['events']:\n", "if all([(match in VAR_121) for match in VAR_96]):\n", "return None\n", "return VAR_121\n" ]
[ "def get_event(events, matches):...\n", "for e in events['events']:\n", "if all([(match in e) for match in matches]):\n", "return None\n", "return e\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "For", "Return'", "Return'" ]
[ "def FUNC_3(self):...\n", "return self.rawchem.all()\n" ]
[ "def fetch_extracted_records(self):...\n", "return self.rawchem.all()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = 0.1\n", "VAR_23 = self.metrics['time_coeff'] * random.expovariate(self.metrics[\n 'time_lambda'])\n", "VAR_24 = int(VAR_23 / VAR_22)\n", "VAR_25 = VAR_23 - VAR_24 * VAR_22\n", "for i in xrange(VAR_24):\n", "time.sleep(VAR_22)\n", "tim...
[ "def wait_next(self):...\n", "\"\"\"docstring\"\"\"\n", "SLEEP_PERIOD = 0.1\n", "time_to_wait = self.metrics['time_coeff'] * random.expovariate(self.metrics\n ['time_lambda'])\n", "sleep_num = int(time_to_wait / SLEEP_PERIOD)\n", "remaining_sleep = time_to_wait - sleep_num * SLEEP_PERIOD\n", "for i i...
[ 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Expr'", "Condition", "Condition" ]
[ "def FUNC_2(self):...\n", "self.delete_session_cookie()\n", "self.redirect('/')\n" ]
[ "def get(self):...\n", "self.delete_session_cookie()\n", "self.redirect('/')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_9():...\n", "\"\"\"docstring\"\"\"\n", "VAR_35 = FUNC_8('tasks')\n", "VAR_36 = re.findall('string', VAR_35.text, re.X)\n", "VAR_37 = {}\n", "for VAR_46 in VAR_36:\n", "VAR_57, VAR_58, VAR_59 = VAR_46\n", "return VAR_37\n", "VAR_57 = int(VAR_57)\n", "VAR_37[VAR_58] = {'title': VAR_59, 'id...
[ "def get_tasks():...\n", "\"\"\"docstring\"\"\"\n", "r = admin_req('tasks')\n", "groups = re.findall(\n \"\"\"\n <tr>\\\\s*\n <td><a\\\\s+href=\"./task/(\\\\d+)\">(.*)</a></td>\\\\s*\n <td>(.*)</td>\\\\s*\n \"\"\"\n , r.text, re.X)\n", "tasks = {}\n", "for g in groups:\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_1(self, VAR_2):...\n", "self.read_xsrf_token(VAR_2.base_url)\n", "VAR_2.execute()\n" ]
[ "def login(self, login_request):...\n", "self.read_xsrf_token(login_request.base_url)\n", "login_request.execute()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_6(self):...\n", "if is_banned_IP(VAR_102.ip):\n", "VAR_101.errors.add(errors.BANNED_IP)\n", "return VAR_102.ip\n" ]
[ "def run(self):...\n", "if is_banned_IP(request.ip):\n", "c.errors.add(errors.BANNED_IP)\n", "return request.ip\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'" ]
[ "@FUNC_7...\n", "\"\"\"docstring\"\"\"\n", "VAR_16.pop(VAR_17(VAR_1.name) + '_autoregister', None)\n", "VAR_5 = FUNC_1(VAR_1, VAR_2)\n", "VAR_19 = signup_handlers[VAR_1.name]\n", "if not current_user.is_authenticated():\n", "VAR_27 = VAR_19['info'](VAR_2)\n", "if not VAR_5.remote_account.extra_data an...
[ "@oauth_error_handler...\n", "\"\"\"docstring\"\"\"\n", "session.pop(token_session_key(remote.name) + '_autoregister', None)\n", "token = response_token_setter(remote, resp)\n", "handlers = signup_handlers[remote.name]\n", "if not current_user.is_authenticated():\n", "account_info = handlers['info'](res...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Condition", "Return'", "Return'", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(self, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = {}\n", "VAR_5['clusterName'] = VAR_8\n", "VAR_5['searchDepth'] = '1'\n", "VAR_5['verbose'] = '0'\n", "VAR_18 = self._cliq_run_xml('getClusterInfo', VAR_5)\n", "return VAR_18\n" ]
[ "def _cliq_get_cluster_info(self, cluster_name):...\n", "\"\"\"docstring\"\"\"\n", "cliq_args = {}\n", "cliq_args['clusterName'] = cluster_name\n", "cliq_args['searchDepth'] = '1'\n", "cliq_args['verbose'] = '0'\n", "result_xml = self._cliq_run_xml('getClusterInfo', cliq_args)\n", "return result_xml\n...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_1(VAR_2, VAR_0, VAR_1):...\n", "VAR_5 = FUNC_0(VAR_0, VAR_1)\n", "VAR_6 = open(VAR_2, 'w')\n", "VAR_6.write(VAR_5)\n", "VAR_6.close()\n" ]
[ "def write_eb_config(dest, application_name, default_region):...\n", "contents = make_eb_config(application_name, default_region)\n", "fh = open(dest, 'w')\n", "fh.write(contents)\n", "fh.close()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_1(self, VAR_6, VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = ray.gcs_utils.GcsTableEntry.GetRootAsGcsTableEntry(VAR_7, 0)\n", "VAR_15 = VAR_14.Entries(0)\n", "VAR_16 = (ray.gcs_utils.HeartbeatBatchTableData.\n GetRootAsHeartbeatBatchTableData(VAR_15, 0))\n", "for j in range(VAR_16.Batch...
[ "def xray_heartbeat_batch_handler(self, unused_channel, data):...\n", "\"\"\"docstring\"\"\"\n", "gcs_entries = ray.gcs_utils.GcsTableEntry.GetRootAsGcsTableEntry(data, 0)\n", "heartbeat_data = gcs_entries.Entries(0)\n", "message = (ray.gcs_utils.HeartbeatBatchTableData.\n GetRootAsHeartbeatBatchTableDat...
[ 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'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, **VAR_5):...\n", "VAR_10 = super().get_context_data(**kwargs)\n", "VAR_11 = SearchForm(self.request.GET)\n", "VAR_10['search_form'] = VAR_11\n", "VAR_12 = self.object_list.count()\n", "VAR_10['count'] = VAR_12\n", "VAR_10['30_day_labels'] = self.thirty_day_labels()\n", "VAR_10['30_da...
[ "def get_context_data(self, **kwargs):...\n", "context = super().get_context_data(**kwargs)\n", "search_form = SearchForm(self.request.GET)\n", "context['search_form'] = search_form\n", "count = self.object_list.count()\n", "context['count'] = count\n", "context['30_day_labels'] = self.thirty_day_labels...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@jwt_required...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = f'update users set user_id = %s '\n", "VAR_2 += f\"where user_id = '{VAR_1}'\"\n", "VAR_3 = request.get_json()\n", "VAR_4 = VAR_3['user_id'],\n", "database_utilities.execute_query(VAR_2, VAR_4)\n" ]
[ "@jwt_required...\n", "\"\"\"docstring\"\"\"\n", "query = f'update users set user_id = %s '\n", "query += f\"where user_id = '{user_id}'\"\n", "json_data = request.get_json()\n", "parameters = json_data['user_id'],\n", "database_utilities.execute_query(query, parameters)\n" ]
[ 0, 0, 0, 4, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "AugAssign'", "Assign'", "Assign'", "Expr'" ]
[ "def __bool__(self):...\n", "return bool(self.updated_input or self.missing_output or self.forced or\n self.updated_input_run or self.noio or self.nooutput)\n" ]
[ "def __bool__(self):...\n", "return bool(self.updated_input or self.missing_output or self.forced or\n self.updated_input_run or self.noio or self.nooutput)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@functools.wraps(VAR_7)...\n", "assert isinstance(self, webapp2.RequestHandler)\n", "assert self.request.method == 'GET'\n", "if model.is_replica():\n", "VAR_40 = model.get_replication_state().primary_url\n", "return VAR_7(self, *VAR_9, **kwargs)\n", "VAR_41 = 'http://' if utils.is_local_dev_server() e...
[ "@functools.wraps(method)...\n", "assert isinstance(self, webapp2.RequestHandler)\n", "assert self.request.method == 'GET'\n", "if model.is_replica():\n", "primary_url = model.get_replication_state().primary_url\n", "return method(self, *args, **kwargs)\n", "protocol = 'http://' if utils.is_local_dev_se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assert'", "Assert'", "Condition", "Assign'", "Return'", "Assign'", "Assert'", "Assert'", "Expr'" ]
[ "def FUNC_3(self):...\n", "VAR_5 = {'title': 'Admin: Chrome Infra Monitoring Proxy'}\n", "self.render_response('admin.html', **context)\n" ]
[ "def get(self):...\n", "context = {'title': 'Admin: Chrome Infra Monitoring Proxy'}\n", "self.render_response('admin.html', **context)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_6(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_10 in self._rules\n" ]
[ "def is_rule(self, name):...\n", "\"\"\"docstring\"\"\"\n", "return name in self._rules\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_16(self):...\n", "VAR_14 = ['8.9.10.11', '9.10.11.12', '10.11.12.13']\n", "VAR_15 = self.new_mocked_cluster(VAR_14, FUNC_1)\n", "self.assertEqual(3, len(VAR_15.endpoints))\n", "self.assertRaises(nsxlib_exc.ServiceClusterUnavailable, VAR_15.get,\n 'api/v1/transport-zones')\n" ]
[ "def test_cluster_validate_with_exception(self):...\n", "conf_managers = ['8.9.10.11', '9.10.11.12', '10.11.12.13']\n", "api = self.new_mocked_cluster(conf_managers, _validate_conn_down)\n", "self.assertEqual(3, len(api.endpoints))\n", "self.assertRaises(nsxlib_exc.ServiceClusterUnavailable, api.get,\n '...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@staticmethod...\n", "if not isinstance(VAR_1, int):\n", "VAR_9 = {}\n", "VAR_10 = VAR_0.view_task(VAR_1, details=True)\n", "if VAR_10:\n", "VAR_19 = VAR_10.to_dict()\n", "return Exception('Task not found')\n", "VAR_19['guest'] = {}\n", "if VAR_10.guest:\n", "VAR_19['guest'] = VAR_10.guest.to_dic...
[ "@staticmethod...\n", "if not isinstance(task_id, int):\n", "data = {}\n", "task = db.view_task(task_id, details=True)\n", "if task:\n", "entry = task.to_dict()\n", "return Exception('Task not found')\n", "entry['guest'] = {}\n", "if task.guest:\n", "entry['guest'] = task.guest.to_dict()\n", "en...
[ 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@classmethod...\n", "return ()\n" ]
[ "@classmethod...\n", "return ()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import hashlib\n", "import json\n", "import logging\n", "import os\n", "import StringIO\n", "import zipfile\n", "VAR_0 = ('__main__.py', 'api/__init__.py', 'api/bot.py', 'api/parallel.py',\n 'api/os_utilities.py', 'api/platforms/__init__.py',\n 'api/platforms/android.py'...
[ "\"\"\"Generates the swarming_bot.zip archive for the bot.\n\nUnlike the other source files, this file can be run from ../tools/bot_archive.py\nstand-alone to generate a swarming_bot.zip for local testing so it doesn't\nimport anything from the AppEngine SDK.\n\nThe hash of the content of the files in the archive i...
[ 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Assign'", "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_7(VAR_6):...\n", "return 'dir2' not in VAR_6\n" ]
[ "def directory_filter(path):...\n", "return 'dir2' not in path\n" ]
[ 0, 1 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_17(self):...\n", "VAR_22 = mocks.MockRequestsResponse(200, jsonutils.dumps({'result': {'ok': \n 200}}))\n", "VAR_14 = self.new_mocked_client(client.JSONRESTClient, session_response=\n resp, url_prefix='api/v2/nat')\n", "VAR_22 = VAR_14.create(VAR_24={'name': 'mgmt-egress'})\n", "FUNC_2('post...
[ "def test_json_request(self):...\n", "resp = mocks.MockRequestsResponse(200, jsonutils.dumps({'result': {'ok': 200}})\n )\n", "api = self.new_mocked_client(client.JSONRESTClient, session_response=resp,\n url_prefix='api/v2/nat')\n", "resp = api.create(body={'name': 'mgmt-egress'})\n", "assert_json_cal...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@staticmethod...\n", "return ' '.join(escape_path_argument(s) for s in (sys.executable, os.path.\n join(os.path.dirname(os.path.realpath(__file__)),\n 'run_shell_command_testfiles', VAR_0)))\n" ]
[ "@staticmethod...\n", "return ' '.join(escape_path_argument(s) for s in (sys.executable, os.path.\n join(os.path.dirname(os.path.realpath(__file__)),\n 'run_shell_command_testfiles', scriptname)))\n" ]
[ 0, 2 ]
[ "Condition", "Return'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = request.args.get('group_by')\n", "if not VAR_4:\n", "VAR_4 = ''\n", "return VAR_4\n" ]
[ "def get_group_by_args():...\n", "\"\"\"docstring\"\"\"\n", "group_by = request.args.get('group_by')\n", "if not group_by:\n", "group_by = ''\n", "return group_by\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_1(self, VAR_6):...\n", "VAR_22 = []\n", "for node in VAR_6.split('/'):\n", "if node in ['', '.']:\n", "return '/'.join(VAR_22)\n", "if node == '..':\n", "if VAR_22:\n", "VAR_22.append(node)\n", "VAR_22.pop()\n" ]
[ "def undot(self, path):...\n", "ret = []\n", "for node in path.split('/'):\n", "if node in ['', '.']:\n", "return '/'.join(ret)\n", "if node == '..':\n", "if ret:\n", "ret.append(node)\n", "ret.pop()\n" ]
[ 0, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_0(self, VAR_1):...\n", "VAR_6 = 'string'.format(VAR_1=driver)\n", "self.cursor.execute(VAR_6)\n", "self.rides = self.cursor.fetchall()\n" ]
[ "def find_rides(self, driver):...\n", "query = (\n \"\"\"\n SELECT r.rno, r.price, r.rdate, r.seats, r.lugDesc, r.src, r.dst, r.driver, r.cno, r.seats-COUNT(b.bno) \n FROM rides r, bookings b\n WHERE driver = '{driver}'\n AND r.rno = b.bno \n GROUP BY r.rno, r.price, r.rdate,...
[ 0, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'" ]
[ "def __init__(self, VAR_7, VAR_20=True, *VAR_15, **VAR_16):...\n", "CLASS_5.__init__(self, VAR_7, *VAR_15, VAR_20=redirect, **kw)\n" ]
[ "def __init__(self, param, redirect=True, *a, **kw):...\n", "VLink.__init__(self, param, *a, redirect=redirect, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_13(VAR_9, VAR_7, VAR_11, VAR_10):...\n", "if VAR_11 == 'POST':\n", "return CLASS_0.session.post(FUNC_2(VAR_7), VAR_9=ToUtf8Json(data), headers=\n _HEADERS, VAR_10=timeout)\n", "if VAR_11 == 'GET':\n", "return CLASS_0.session.get(FUNC_2(VAR_7), headers=_HEADERS, VAR_10=timeout)\n" ]
[ "def SendRequest(data, handler, method, timeout):...\n", "if method == 'POST':\n", "return BaseRequest.session.post(_BuildUri(handler), data=ToUtf8Json(data),\n headers=_HEADERS, timeout=timeout)\n", "if method == 'GET':\n", "return BaseRequest.session.get(_BuildUri(handler), headers=_HEADERS,\n timeo...
[ 0, 0, 7, 0, 7 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'" ]
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import argparse\n", "import ast\n", "import io\n", "import os\n", "import sys\n", "import threading\n", "import random\n", "import time\n", "from cms import conf...
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import argparse\n", "import ast\n", "import io\n", "import os\n", "import sys\n", "import threading\n", "import random\n", "import time\n", "from cms import conf...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'",...
[ "def FUNC_43(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'HIGH': 4}, 'CONFIDENCE': {'HIGH': 3, 'MEDIUM': 1}}\n", "self.check_example('jinja2_templating.py', VAR_2)\n" ]
[ "def test_jinja2_templating(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'HIGH': 4}, 'CONFIDENCE': {'HIGH': 3, 'MEDIUM': 1}}\n", "self.check_example('jinja2_templating.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_16(self, VAR_53, VAR_39):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_39 in [self.CHOICE, self.MULTICHOICE]:\n", "if VAR_39 in self.CONVERSION_REQUIRED:\n", "int(VAR_53[0])\n", "VAR_96 = \"'{value}'\"\n", "VAR_96 = '{value}'\n", "VAR_96 = \"'{value}'\"\n", "VAR_96 = '{value}'\n", "return (...
[ "def _convert_values(self, values, data_type):...\n", "\"\"\"docstring\"\"\"\n", "if data_type in [self.CHOICE, self.MULTICHOICE]:\n", "if data_type in self.CONVERSION_REQUIRED:\n", "int(values[0])\n", "wrapper = \"'{value}'\"\n", "wrapper = '{value}'\n", "wrapper = \"'{value}'\"\n", "wrapper = '{va...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "from django import forms\n", "VAR_0 = forms.CharField(label='', max_length=100, required=True)\n", "VAR_0.widget.attrs['class'] = 'form-control mr-sm-2 my-2'\n", "VAR_0.widget.attrs['placeholder'] = 'Lookup URL'\n" ]
[ "from django import forms\n", "keyword = forms.CharField(label='', max_length=100, required=True)\n", "keyword.widget.attrs['class'] = 'form-control mr-sm-2 my-2'\n", "keyword.widget.attrs['placeholder'] = 'Lookup URL'\n" ]
[ 0, 6, 0, 0 ]
[ "ImportFrom'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_34(self, VAR_14):...\n", "return self.list_properties[VAR_14].mapper.class_\n" ]
[ "def get_related_model(self, col_name):...\n", "return self.list_properties[col_name].mapper.class_\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_34(self):...\n", "" ]
[ "def get(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_1(VAR_2, VAR_3, VAR_4):...\n", "if VAR_2 is None and VAR_3 is None:\n", "return False\n", "if VAR_2 is not None:\n", "return False\n", "VAR_2 = int(VAR_2)\n", "if VAR_3 is not None:\n", "VAR_3 = int(VAR_3)\n", "VAR_4 = int(VAR_4)\n", "return True\n" ]
[ "def _ValidateInput(lower_bound_commit_position, upper_bound_commit_position,...\n", "if lower_bound_commit_position is None and upper_bound_commit_position is None:\n", "return False\n", "if lower_bound_commit_position is not None:\n", "return False\n", "lower_bound_commit_position = int(lower_bound_comm...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "@FUNC_0...\n", "VAR_12 = await get_session(VAR_3)\n", "VAR_13 = await VAR_3.post()\n", "if set(['action', 'uname', 'psw']).issubset(VAR_13.keys()\n", "VAR_5 = VAR_13['uname']\n", "if 'action' in VAR_13:\n", "VAR_21 = VAR_13['psw']\n", "if VAR_13['action'] == 'logout' and 'uname' in VAR_12:\n", "ret...
[ "@handle_html...\n", "session = await get_session(request)\n", "data = await request.post()\n", "if set(['action', 'uname', 'psw']).issubset(data.keys()\n", "uname = data['uname']\n", "if 'action' in data:\n", "psw = data['psw']\n", "if data['action'] == 'logout' and 'uname' in session:\n", "return ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Condition", "For", "Assign'", "Condition", "Condition", "Return'", "Condition", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Assign'", ...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(VAR_4):\n", "VAR_12, VAR_13 = [], []\n", "for filename in os.listdir(VAR_4):\n", "VAR_5 = os.path.join(VAR_4, filename)\n", "return VAR_12, VAR_13\n", "if os.path.isdir(VAR_5):\n", "VAR_12.append((filename, len(os.listdir(VAR_5)...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(analysis_path):\n", "dirs, files = [], []\n", "for filename in os.listdir(analysis_path):\n", "path = os.path.join(analysis_path, filename)\n", "return dirs, files\n", "if os.path.isdir(path):\n", "dirs.append((filename, len(os....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "For", "Assign'", "Return'", "Condition", "Expr'", "Expr'" ]
[ "@VAR_0.before_app_first_request...\n", "\"\"\"docstring\"\"\"\n", "user_logged_out.connect(oauth_logout_handler)\n", "oauth.init_app(current_app)\n", "for VAR_1, conf in cfg['OAUTHCLIENT_REMOTE_APPS'].items():\n", "if VAR_1 not in oauth.remote_apps:\n", "VAR_4 = oauth.remote_app(VAR_1, **conf['params']...
[ "@blueprint.before_app_first_request...\n", "\"\"\"docstring\"\"\"\n", "user_logged_out.connect(oauth_logout_handler)\n", "oauth.init_app(current_app)\n", "for remote_app, conf in cfg['OAUTHCLIENT_REMOTE_APPS'].items():\n", "if remote_app not in oauth.remote_apps:\n", "remote = oauth.remote_app(remote_a...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "For", "Docstring", "Expr'", "Expr'", "For", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(VAR_9):...\n", "if VAR_9['exception']['TYPE'] == UnknownExtraConf.__name__:\n" ]
[ "def _RaiseExceptionForData(data):...\n", "if data['exception']['TYPE'] == UnknownExtraConf.__name__:\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_2(self, VAR_7):...\n", "VAR_25 = ''\n", "VAR_26 = '%s> ' % self.configuration.eqlx_group_name\n", "while not VAR_25.endswith(VAR_26):\n", "VAR_25 += VAR_7.recv(102400)\n", "VAR_0.debug(_('CLI output\\n%s'), VAR_25)\n", "return VAR_25.splitlines()\n" ]
[ "def _get_output(self, chan):...\n", "out = ''\n", "ending = '%s> ' % self.configuration.eqlx_group_name\n", "while not out.endswith(ending):\n", "out += chan.recv(102400)\n", "LOG.debug(_('CLI output\\n%s'), out)\n", "return out.splitlines()\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "AugAssign'", "Expr'", "Return'" ]
[ "def FUNC_7(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "if not self._rules:\n", "if not VAR_10 in self._rules:\n", "return self._rules[VAR_10]\n" ]
[ "def get_rule(self, name):...\n", "\"\"\"docstring\"\"\"\n", "if not self._rules:\n", "if not name in self._rules:\n", "return self._rules[name]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Return'" ]
[ "def FUNC_3(self, VAR_5, VAR_6):...\n", "if not VAR_5.lower() in VAR_6:\n", "self.connect()\n", "VAR_7 = 'INSERT INTO badwords (word, badness) VALUE (%s,%s)'\n", "VAR_11 = VAR_5.lower(), 1\n", "self.cursor.execute(VAR_7, VAR_11)\n", "self.close()\n" ]
[ "def insert(self, targetWord, badwordlist):...\n", "if not targetWord.lower() in badwordlist:\n", "self.connect()\n", "sqlFormula = 'INSERT INTO badwords (word, badness) VALUE (%s,%s)'\n", "word = targetWord.lower(), 1\n", "self.cursor.execute(sqlFormula, word)\n", "self.close()\n" ]
[ 0, 0, 0, 0, 4, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "VAR_16 = self.kwargs['pk']\n", "VAR_8 = Attribute.objects.filter(event=pk).order_by('id')\n", "VAR_19 = self.request.GET.get('category')\n", "VAR_20 = self.request.GET.get('type')\n", "if VAR_19 is not None:\n", "VAR_8 = VAR_8.filter(VAR_19=category)\n", "if VAR_20 is not No...
[ "def get_queryset(self):...\n", "pk = self.kwargs['pk']\n", "query = Attribute.objects.filter(event=pk).order_by('id')\n", "category = self.request.GET.get('category')\n", "type = self.request.GET.get('type')\n", "if category is not None:\n", "query = query.filter(category=category)\n", "if type is no...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_10(VAR_6):...\n", "VAR_0, VAR_10 = FUNC_0()\n", "VAR_18 = \"SELECT * from {} where adm_token='{}'\".format(CFG(\n 'admintoken_table_name'), VAR_6)\n", "VAR_20 = bool(FUNC_3(VAR_10, VAR_18))\n", "FUNC_1(VAR_0)\n", "return VAR_20\n" ]
[ "def isValidAdmToken(adm_token):...\n", "conn, c = connectDB()\n", "req = \"SELECT * from {} where adm_token='{}'\".format(CFG(\n 'admintoken_table_name'), adm_token)\n", "answer = bool(queryOne(c, req))\n", "closeDB(conn)\n", "return answer\n" ]
[ 0, 0, 4, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_5(VAR_10):...\n", "if not VAR_10 in new_beatmap_list:\n", "VAR_36 = open('/home/pi/DiscordBots/OsuBot/beatmapsFiles/newBeatmaps.txt', 'a')\n", "VAR_36.write('\\n' + VAR_10)\n", "VAR_36.close()\n", "print('Added ' + VAR_10 + ' to beatmap queue')\n" ]
[ "def add_beatmap_to_queue(url):...\n", "if not url in new_beatmap_list:\n", "new_beatmaps_file = open(\n '/home/pi/DiscordBots/OsuBot/beatmapsFiles/newBeatmaps.txt', 'a')\n", "new_beatmaps_file.write('\\n' + url)\n", "new_beatmaps_file.close()\n", "print('Added ' + url + ' to beatmap queue')\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_10):...\n", "if VAR_10.find('\\t') > -1:\n", "VAR_10 = VAR_10.replace('\\t', ' ')\n", "super(CLASS_1, self).__init__(docParser.parse(VAR_10, docLexer), VAR_2=self.end\n )\n", "warn(\n \"Input file has tabs, which will be considered 4 spaces; but please don't use tabs!\"\n ...
[ "def __init__(self, txt):...\n", "if txt.find('\\t') > -1:\n", "txt = txt.replace('\\t', ' ')\n", "super(Document, self).__init__(docParser.parse(txt, docLexer), after=self.end)\n", "warn(\n \"Input file has tabs, which will be considered 4 spaces; but please don't use tabs!\"\n )\n", "Config.res...
[ 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "For", "AugAssign'", "AugAssign'", "Assign'", "For", "Condition", "Assign'", "AugAssign'", "Condition", "AugAssign'", "Assign'" ]
[ "def __init__(self, VAR_45, VAR_46, VAR_47, VAR_48, VAR_49, VAR_50, VAR_51,...\n", "self.st_mode = VAR_45\n", "self.st_ino = VAR_46\n", "self.st_dev = VAR_47\n", "self.st_nlink = VAR_48\n", "self.st_uid = VAR_49\n", "self.st_gid = VAR_50\n", "self.st_size = VAR_51\n", "self.st_atime = VAR_52\n", "...
[ "def __init__(self, st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid,...\n", "self.st_mode = st_mode\n", "self.st_ino = st_ino\n", "self.st_dev = st_dev\n", "self.st_nlink = st_nlink\n", "self.st_uid = st_uid\n", "self.st_gid = st_gid\n", "self.st_size = st_size\n", "self.st_atime = st_atime\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_2(self, VAR_7, VAR_8):...\n", "VAR_3.info('we are about to analyze scene {} with {} brackets'.format(VAR_8,\n len(VAR_7)))\n", "for url in VAR_7:\n", "VAR_11 = \"SELECT * FROM analyzed where base_url='{}'\".format(url)\n", "VAR_12 = self.db.exec(VAR_11)\n", "if len(VAR_12) == 0:\n", "VAR_26...
[ "def analyze_smashgg(self, urls, name):...\n", "LOG.info('we are about to analyze scene {} with {} brackets'.format(name,\n len(urls)))\n", "for url in urls:\n", "sql = \"SELECT * FROM analyzed where base_url='{}'\".format(url)\n", "res = self.db.exec(sql)\n", "if len(res) == 0:\n", "display_name = b...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_14(self, VAR_64):...\n", "self._onerror = VAR_64\n" ]
[ "def onerror(self, func):...\n", "self._onerror = func\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_18(VAR_13):...\n", "\"\"\"docstring\"\"\"\n", "return html.escape(str(VAR_13))\n" ]
[ "def html_escape(input_string):...\n", "\"\"\"docstring\"\"\"\n", "return html.escape(str(input_string))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_17(self, VAR_25, VAR_27='', VAR_28=None):...\n", "VAR_28 = VAR_28 or {'Content-Type': 'application/json'}\n", "VAR_20 = request_mock(VAR_25=path, method='POST', VAR_27=body, VAR_28=headers)\n", "return self._render(VAR_20)\n" ]
[ "def post(self, path, body='', headers=None):...\n", "headers = headers or {'Content-Type': 'application/json'}\n", "request = request_mock(path=path, method='POST', body=body, headers=headers)\n", "return self._render(request)\n" ]
[ 0, 0, 5, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_8(self):...\n", "self.uut.executable = 'echo'\n", "self.uut.config_file = lambda : ['config line1']\n", "VAR_6 = self.uut.generate_config_file()\n", "self.assertTrue(os.path.isfile(VAR_6))\n", "os.remove(VAR_6)\n", "self.uut.lint('filename')\n" ]
[ "def test_config_file_generator(self):...\n", "self.uut.executable = 'echo'\n", "self.uut.config_file = lambda : ['config line1']\n", "config_filename = self.uut.generate_config_file()\n", "self.assertTrue(os.path.isfile(config_filename))\n", "os.remove(config_filename)\n", "self.uut.lint('filename')\n"...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "VAR_24 = self.common.create_cloned_volume(VAR_7, VAR_8)\n", "self.common.client_logout()\n", "return {'metadata': VAR_24}\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "new_vol = self.common.create_cloned_volume(volume, src_vref)\n", "self.common.client_logout()\n", "return {'metadata': new_vol}\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(VAR_2, VAR_4):...\n", "if VAR_4.status == 'failed':\n", "VAR_8 = str(uuid.uuid4())\n", "os.chdir('screenshots')\n", "VAR_2.browser.save_screenshot('failed ' + str(VAR_4.name) + '_' + VAR_8 +\n '.png')\n", "FUNC_7(VAR_2, 'failed ' + str(VAR_4.name) + '_' + VAR_8 + '.html')\n", "os.chdir('....
[ "def after_step(context, step):...\n", "if step.status == 'failed':\n", "id = str(uuid.uuid4())\n", "os.chdir('screenshots')\n", "context.browser.save_screenshot('failed ' + str(step.name) + '_' + id + '.png')\n", "save_source(context, 'failed ' + str(step.name) + '_' + id + '.html')\n", "os.chdir('../'...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]