lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_1(self):...\n", "super(CLASS_1, self).setUp()\n", "VAR_12 = patch('pavelib.utils.test.suites.bokchoy_suite.sh')\n", "self._mock_sh = VAR_12.start()\n", "self.addCleanup(VAR_12.stop)\n" ]
[ "def setUp(self):...\n", "super(TestPaverPa11yCrawlerCmd, self).setUp()\n", "mock_sh = patch('pavelib.utils.test.suites.bokchoy_suite.sh')\n", "self._mock_sh = mock_sh.start()\n", "self.addCleanup(mock_sh.stop)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_34, *VAR_35, **VAR_36):...\n", "super().__init__(*VAR_35, **kvargs)\n", "self.newproxyfile = 'newproxies.txt'\n", "self.proxylist = set()\n", "self.c = VAR_34\n", "self.threads = []\n", "self.processes = []\n", "self.th_sa = 'inproc://wm-wth.sock'\n", "self.th_ba = 'inproc://...
[ "def __init__(self, config, *args, **kvargs):...\n", "super().__init__(*args, **kvargs)\n", "self.newproxyfile = 'newproxies.txt'\n", "self.proxylist = set()\n", "self.c = config\n", "self.threads = []\n", "self.processes = []\n", "self.th_sa = 'inproc://wm-wth.sock'\n", "self.th_ba = 'inproc://wm-b...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def __init__(self, VAR_46):...\n", "super(CLASS_2, self).__init__(VAR_46)\n" ]
[ "def __init__(self, conf):...\n", "super(AnsiblePlugin, self).__init__(conf)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@VAR_0.route('/users/<id>/edit', methods=['GET', 'POST'])...\n", "VAR_5 = VAR_1\n", "VAR_2 = connectToMySQL('users_db')\n", "if request.method == 'POST':\n", "VAR_6 = 'string' + VAR_5 + ';'\n", "VAR_4 = VAR_2.query_db('SELECT * FROM users WHERE id = ' + VAR_5 + ';')\n", "VAR_8 = {'fn': request.form['fi...
[ "@app.route('/users/<id>/edit', methods=['GET', 'POST'])...\n", "user_id = id\n", "mysql = connectToMySQL('users_db')\n", "if request.method == 'POST':\n", "query = (\n 'UPDATE users SET first_name = %(fn)s, last_name = %(ln)s, email= %(e)s, description = %(d)s, updated_at = now() WHERE id = '\n + us...
[ 0, 4, 0, 0, 4, 4, 0, 0, 0, 4 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Expr'", "Return'" ]
[ "@VAR_3.message_handler(func=lambda m: True)...\n", "VAR_26 = VAR_6.text\n", "VAR_10 = VAR_6.from_user.id\n", "VAR_1[VAR_10].new_directory(VAR_26)\n", "VAR_7 = VAR_1[VAR_10].get_directory_content()\n", "VAR_27 = FUNC_2(VAR_7, len(VAR_1[VAR_10].path) > 1)\n", "FUNC_6(VAR_10, VAR_3)\n", "VAR_28 = VAR_3....
[ "@bot.message_handler(func=lambda m: True)...\n", "new_directory_name = message.text\n", "telegram_id = message.from_user.id\n", "explorers[telegram_id].new_directory(new_directory_name)\n", "content = explorers[telegram_id].get_directory_content()\n", "keyboard = content_builder(content, len(explorers[te...
[ 0, 0, 0, 4, 4, 4, 0, 4, 4 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_12(self):...\n", "self.run_test_case(self.scenario.delete_server_group(), max_retries=5)\n" ]
[ "def test_x_delete_server_group(self):...\n", "self.run_test_case(self.scenario.delete_server_group(), max_retries=5)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "from . import pathexpr\n", "from . import ds\n", "from . import fs\n", "def __init__(self, VAR_0, VAR_1):...\n", "self._doc = VAR_0\n", "self._root = VAR_1\n", "def FUNC_0(self):...\n", "return self._doc['rules'].keys()\n" ]
[ "from . import pathexpr\n", "from . import ds\n", "from . import fs\n", "def __init__(self, compileddoc, startingpath):...\n", "self._doc = compileddoc\n", "self._root = startingpath\n", "def get_rule_names(self):...\n", "return self._doc['rules'].keys()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_11(self, VAR_7, VAR_16):...\n", "VAR_15 = self.find_product_by_id(VAR_7)\n", "self._purchase_by_product(VAR_15, VAR_16)\n" ]
[ "def purchase_by_product_id(self, product_id, quantity):...\n", "product = self.find_product_by_id(product_id)\n", "self._purchase_by_product(product, quantity)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_11(VAR_16, VAR_17, VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_15 is not None:\n", "VAR_17 = str(VAR_17)\n", "if VAR_15.alt_number is None:\n", "print(\n '[VCF-Zarr] Determining maximum number of ALT alleles by scaling all variants in the VCF file.'\n )\n", "print('[VCF-Zarr] Usin...
[ "def convert_to_zarr(input_vcf_path, output_zarr_path, conversion_config):...\n", "\"\"\"docstring\"\"\"\n", "if conversion_config is not None:\n", "output_zarr_path = str(output_zarr_path)\n", "if conversion_config.alt_number is None:\n", "print(\n '[VCF-Zarr] Determining maximum number of ALT alleles...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Expr'", "Expr'", "...
[ "def FUNC_13(self, VAR_12, VAR_13, VAR_14=None):...\n", "\"\"\"docstring\"\"\"\n", "assert VAR_14 is None or (VAR_13 is None or VAR_14 >= VAR_23(VAR_13))\n", "if VAR_14:\n", "VAR_38 = 'create table t1(s %s(%s))' % (VAR_12, VAR_14)\n", "VAR_38 = 'create table t1(s %s)' % VAR_12\n", "self.cursor.execute(V...
[ "def _test_strtype(self, sqltype, value, colsize=None):...\n", "\"\"\"docstring\"\"\"\n", "assert colsize is None or (value is None or colsize >= len(value))\n", "if colsize:\n", "sql = 'create table t1(s %s(%s))' % (sqltype, colsize)\n", "sql = 'create table t1(s %s)' % sqltype\n", "self.cursor.execute...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assert'", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = VAR_0[:]\n", "for user in self.participants:\n", "VAR_11.append((Allow, user.login, ('view_activity', 'view_workshop',\n 'view.file')))\n", "return VAR_11\n" ]
[ "def get_event_acl(self):...\n", "\"\"\"docstring\"\"\"\n", "acl = DEFAULT_PERM[:]\n", "for user in self.participants:\n", "acl.append((Allow, user.login, ('view_activity', 'view_workshop', 'view.file'))\n )\n", "return acl\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Return'" ]
[ "@jwt_required...\n", "\"\"\"docstring\"\"\"\n", "return database_utilities.execute_query(\n f\"delete from admins where email = '{VAR_1}'\")\n" ]
[ "@jwt_required...\n", "\"\"\"docstring\"\"\"\n", "return database_utilities.execute_query(\n f\"delete from admins where email = '{email}'\")\n" ]
[ 0, 0, 4 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_19(self):...\n", "VAR_7, VAR_12 = self.make_xsrf_handling_app()\n", "self.mock_get_current_identity(model.Identity(model.IDENTITY_USER,\n 'a@example.com'))\n", "VAR_17 = VAR_7.get('/request').body\n", "self.mock_get_current_identity(model.Identity(model.IDENTITY_USER,\n 'b@example.com'))\n",...
[ "def test_xsrf_token_identity_matters(self):...\n", "app, calls = self.make_xsrf_handling_app()\n", "self.mock_get_current_identity(model.Identity(model.IDENTITY_USER,\n 'a@example.com'))\n", "token = app.get('/request').body\n", "self.mock_get_current_identity(model.Identity(model.IDENTITY_USER,\n 'b...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_4():...\n", "VAR_33 = FUNC_3(VAR_21=parent, VAR_22=child, VAR_23=\n ExtractedChemicalFormSet, VAR_24=ExtractedChemicalForm)\n", "return CLASS_16, VAR_33\n" ]
[ "def one():...\n", "ChemicalFormSet = make_formset(parent_model=parent, model=child, formset=\n ExtractedChemicalFormSet, form=ExtractedChemicalForm)\n", "return ExtractedTextForm, ChemicalFormSet\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_5(self, VAR_1, VAR_2, VAR_8=None, VAR_9='form', VAR_4=None, VAR_14...\n", "VAR_29 = super(CLASS_0, self).fields_view_get(VAR_1, VAR_2, VAR_8, VAR_9,\n VAR_4, VAR_14=toolbar, VAR_15=submenu)\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "if 'location' in VAR_4 and VAR_4['location']:\n", "VAR_51 =...
[ "def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=...\n", "res = super(product_product, self).fields_view_get(cr, uid, view_id,\n view_type, context, toolbar=toolbar, submenu=submenu)\n", "if context is None:\n", "context = {}\n", "if 'location' in context and context['location'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "For", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Condition...
[ "def FUNC_14(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1.value = beamr.interpreters.Box(VAR_1.value)\n", "return VAR_1\n" ]
[ "def t_BOX(t):...\n", "\"\"\"docstring\"\"\"\n", "t.value = beamr.interpreters.Box(t.value)\n", "return t\n" ]
[ 0, 0, 2, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_3(self):...\n", "\"\"\"docstring\"\"\"\n", "GenericRequest._prepare(self)\n", "VAR_17 = os.path.join(self.submissions_path, self.task[1])\n", "VAR_18 = os.listdir(VAR_17)\n", "VAR_19 = random.choice(VAR_18)\n", "self.source_path = os.path.join(VAR_17, VAR_19)\n", "self.files = []\n", "if o...
[ "def _prepare(self):...\n", "\"\"\"docstring\"\"\"\n", "GenericRequest._prepare(self)\n", "task_path = os.path.join(self.submissions_path, self.task[1])\n", "sources = os.listdir(task_path)\n", "source = random.choice(sources)\n", "self.source_path = os.path.join(task_path, source)\n", "self.files = [...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_57():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "VAR_38 = set(['a'])\n", "self.cursor.executemany('insert into t1 (word) values (?)', [VAR_38])\n" ]
[ "def f():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "words = set(['a'])\n", "self.cursor.executemany('insert into t1 (word) values (?)', [words])\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = []\n", "VAR_7 = self.pool.get('ir.model.data')\n", "VAR_8 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n", "VAR_9 = self.pool.get('account.bank.statement')\n", "VAR_10 = self.pool.get('ir....
[ "def open_statement(self, cr, uid, ids, context):...\n", "\"\"\"docstring\"\"\"\n", "list_statement = []\n", "mod_obj = self.pool.get('ir.model.data')\n", "company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n", "statement_obj = self.pool.get('account.bank.statement')\n", "sequenc...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 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'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", ...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "return sum(map(len, VAR_3.values()))\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "return sum(map(len, wildcards.values()))\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "VAR_18 = self.common.create_volume(VAR_6)\n", "self.common.client_logout()\n", "return {'metadata': VAR_18}\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "metadata = self.common.create_volume(volume)\n", "self.common.client_logout()\n", "return {'metadata': metadata}\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_1(VAR_2):...\n", "" ]
[ "def try_get_template(name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_2(self, VAR_2):...\n", "VAR_4 = 'select userid from post_like where postid=%d' % VAR_2\n", "VAR_5 = sql.queryDB(self.conn, VAR_4)\n", "return VAR_5\n" ]
[ "def getPostLike(self, postid):...\n", "sqlText = 'select userid from post_like where postid=%d' % postid\n", "result = sql.queryDB(self.conn, sqlText)\n", "return result\n" ]
[ 0, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._redis_address\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._redis_address\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = VAR_0['sensors']\n", "if 'column_fmt' in VAR_0:\n", "VAR_21 = VAR_0['column_fmt']\n", "VAR_3 = ('TIMESTAMP',) + tuple([str(sen).strip() for sen in VAR_10])\n", "VAR_3 = ('TIMESTAMP',) + tuple([VAR_21.replace('{sensor}', str(sen).strip()\n ...
[ "def get_columns(settings):...\n", "\"\"\"docstring\"\"\"\n", "sensors = settings['sensors']\n", "if 'column_fmt' in settings:\n", "column_fmt = settings['column_fmt']\n", "columns = ('TIMESTAMP',) + tuple([str(sen).strip() for sen in sensors])\n", "columns = ('TIMESTAMP',) + tuple([column_fmt.replace('...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_7(self, VAR_13, VAR_11, VAR_7, VAR_14, VAR_10):...\n", "VAR_22 = VAR_7.do_existing_paths()\n", "VAR_23 = []\n", "if VAR_22:\n", "for ictx in VAR_14:\n", "VAR_26 = []\n", "VAR_38 = glob.glob(os.path.join(ictx.path, '*'))\n", "return VAR_23\n", "if 'key' in VAR_11:\n", "VAR_38 = (x for x i...
[ "def get_directories(self, levelctx, levelfields, searcher, ctxlist, client):...\n", "doexisting = searcher.do_existing_paths()\n", "dirlist = []\n", "if doexisting:\n", "for ictx in ctxlist:\n", "values = []\n", "ctxdirs = glob.glob(os.path.join(ictx.path, '*'))\n", "return dirlist\n", "if 'key' in...
[ 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'", "Condition", "For", "Assign'", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Assign'", "For", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Condition" ]
[ "def FUNC_37(self, VAR_14, VAR_18):...\n", "VAR_31 = self.get_related_model(VAR_14)\n", "return self.session.query(VAR_31).get(VAR_18)\n" ]
[ "def get_related_obj(self, col_name, value):...\n", "rel_model = self.get_related_model(col_name)\n", "return self.session.query(rel_model).get(value)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_23(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = []\n", "for VAR_7, VAR_12 in self.all_processes.items():\n", "for VAR_16 in VAR_12:\n", "return VAR_17\n", "if VAR_16.process.poll() is None:\n", "VAR_17.append((VAR_7, VAR_16.process))\n" ]
[ "def live_processes(self):...\n", "\"\"\"docstring\"\"\"\n", "result = []\n", "for process_type, process_infos in self.all_processes.items():\n", "for process_info in process_infos:\n", "return result\n", "if process_info.process.poll() is None:\n", "result.append((process_type, process_info.process))...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "For", "Return'", "Condition", "Expr'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = config.ensure_configured()\n", "VAR_40 = api.reinitialize_request_cache()\n", "self.response.headers['Content-Security-Policy'] = 'string'\n", "self.response.headers['Strict-Transport-Security'\n ] = 'max-age=31536000; includeSubDomains; pr...
[ "def dispatch(self):...\n", "\"\"\"docstring\"\"\"\n", "conf = config.ensure_configured()\n", "auth_context = api.reinitialize_request_cache()\n", "self.response.headers['Content-Security-Policy'] = (\n \"default-src https: 'self' 'unsafe-inline' https://www.google.com https://www.google-analytics.com 'u...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assert'", "Condition", "Assign'", "Assign'...
[ "def FUNC_6(self, VAR_27):...\n", "if VAR_27:\n", "VAR_27 = int(VAR_27, 36)\n", "return Comment._byID(VAR_27, True)\n" ]
[ "def run(self, cid):...\n", "if cid:\n", "cid = int(cid, 36)\n", "return Comment._byID(cid, True)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = self.parse_body()\n", "VAR_9 = VAR_4.get('version', None)\n", "VAR_24 = VAR_4.get('dimensions', {})\n", "VAR_25 = VAR_4.get('state', {})\n", "VAR_14 = None\n", "if VAR_24.get('id'):\n", "VAR_52 = VAR_24['id']\n", "if bool(VAR_24.get('qu...
[ "def _process(self):...\n", "\"\"\"docstring\"\"\"\n", "request = self.parse_body()\n", "version = request.get('version', None)\n", "dimensions = request.get('dimensions', {})\n", "state = request.get('state', {})\n", "bot_id = None\n", "if dimensions.get('id'):\n", "dimension_id = dimensions['id']\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Assign'", "For", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Con...
[ "def FUNC_0(self, VAR_1, VAR_6, VAR_7, VAR_3=None):...\n", "\"\"\"docstring\"\"\"\n", "return self.text_input(VAR_6, VAR_7)\n" ]
[ "def make_input(self, version, name, value, attribute=None):...\n", "\"\"\"docstring\"\"\"\n", "return self.text_input(name, value)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_14(self, VAR_9):...\n", "if not self.logged_in():\n", "print('shrub: unauthenticated; use \"login [username] to log in first')\n", "VAR_20 = self.send_cmd('create_issue{} {}'.format(self.insecure_mode, VAR_9))\n", "return\n", "print(VAR_20)\n" ]
[ "def do_create_issue(self, line):...\n", "if not self.logged_in():\n", "print('shrub: unauthenticated; use \"login [username] to log in first')\n", "response = self.send_cmd('create_issue{} {}'.format(self.insecure_mode, line))\n", "return\n", "print(response)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Return'", "Expr'" ]
[ "@staticmethod...\n", "if tuple(VAR_17) != tuple(VAR_12):\n", "VAR_31 = Diff.from_string_arrays(VAR_12, VAR_17)\n", "for diff in VAR_31.split_diff():\n", "yield diff\n" ]
[ "@staticmethod...\n", "if tuple(new_file) != tuple(file):\n", "wholediff = Diff.from_string_arrays(file, new_file)\n", "for diff in wholediff.split_diff():\n", "yield diff\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "For", "Expr'" ]
[ "def FUNC_13(self):...\n", "VAR_11 = {}\n", "for VAR_12 in self.parent_groups:\n", "VAR_11[VAR_12.name] = VAR_12\n", "return VAR_11\n", "VAR_11.update(VAR_12._get_ancestors())\n" ]
[ "def _get_ancestors(self):...\n", "results = {}\n", "for g in self.parent_groups:\n", "results[g.name] = g\n", "return results\n", "results.update(g._get_ancestors())\n" ]
[ 0, 1, 0, 1, 1, 1 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_1(self):...\n", "VAR_0 = {'groupby': ['tags_key', 'tags_value']}\n", "assert column_expr('tags_key', VAR_0\n ) == '(((arrayJoin(arrayMap((x,y) -> [x,y], tags.key, tags.value)) AS all_tags))[1] AS tags_key)'\n", "assert column_expr('tags_key', VAR_0) == 'tags_key'\n", "assert column_expr('tags_v...
[ "def test_alias_in_alias(self):...\n", "body = {'groupby': ['tags_key', 'tags_value']}\n", "assert column_expr('tags_key', body\n ) == '(((arrayJoin(arrayMap((x,y) -> [x,y], tags.key, tags.value)) AS all_tags))[1] AS tags_key)'\n", "assert column_expr('tags_key', body) == 'tags_key'\n", "assert column_ex...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assert'", "Assert'", "Assert'" ]
[ "@wait_for(timeout=5.0)...\n", "return VAR_0.start_client(VAR_1=mode)\n" ]
[ "@wait_for(timeout=5.0)...\n", "return client.start_client(mode=mode)\n" ]
[ 0, 0 ]
[ "For", "Return'" ]
[ "def FUNC_0(self):...\n", "VAR_7 = []\n", "for parent in self.parent_groups:\n", "VAR_7.append(parent.serialize())\n", "self._hosts = None\n", "VAR_8 = dict(VAR_0=self.name, vars=self.vars.copy(), VAR_7=parent_groups,\n depth=self.depth, VAR_9=self.hosts)\n", "return VAR_8\n" ]
[ "def serialize(self):...\n", "parent_groups = []\n", "for parent in self.parent_groups:\n", "parent_groups.append(parent.serialize())\n", "self._hosts = None\n", "result = dict(name=self.name, vars=self.vars.copy(), parent_groups=\n parent_groups, depth=self.depth, hosts=self.hosts)\n", "return resul...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_8=None, VAR_9=None, VAR_2=None, **VAR_10):...\n", "if VAR_2 and not callable(VAR_2):\n", "self.encoder = VAR_2\n", "super().__init__(VAR_8, VAR_9, **kwargs)\n" ]
[ "def __init__(self, verbose_name=None, name=None, encoder=None, **kwargs):...\n", "if encoder and not callable(encoder):\n", "self.encoder = encoder\n", "super().__init__(verbose_name, name, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_13(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = 2\n", "VAR_10 = 'string'.format(repo_dir=REPO_DIR, shard_str='/shard_' + self.\n shard if self.shard else '', procs=process_count)\n", "VAR_7 = BokChoyTestSuite('', num_processes=process_count)\n", "self.assertEqual(BokChoyTestSuite.verbos...
[ "def test_verbosity_settings_2_processes(self):...\n", "\"\"\"docstring\"\"\"\n", "process_count = 2\n", "expected_verbosity_string = (\n '--with-xunitmp --xunitmp-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --processes={procs} --no-color --process-timeout=1200'\n .format(repo_dir=REPO_DIR, sh...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(VAR_2):...\n", "VAR_2.call_to_terminate_proxy()\n" ]
[ "def after_all(context):...\n", "context.call_to_terminate_proxy()\n" ]
[ 0, 5 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4(VAR_14, VAR_15):...\n", "return FUNC_6(VAR_14, [[VAR_16 for line in VAR_15 for VAR_16 in line]], True)\n" ]
[ "def hStrip(dims, files):...\n", "return smartGrid(dims, [[file for line in files for file in line]], True)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(self, VAR_21, VAR_22):...\n", "\"\"\"docstring\"\"\"\n", "VAR_55 = VAR_21.rstrip('/').split('/')\n", "if len(VAR_55[0]):\n", "VAR_22 = [x for x in VAR_22.split('/') if len(x) and x is not None]\n", "VAR_22, VAR_55 = [], VAR_55[1:]\n", "VAR_21 = VAR_21[1:]\n", "VAR_56 = []\n", "def FUNC_3...
[ "def resolve_path_wc(self, path, cwd):...\n", "\"\"\"docstring\"\"\"\n", "pieces = path.rstrip('/').split('/')\n", "if len(pieces[0]):\n", "cwd = [x for x in cwd.split('/') if len(x) and x is not None]\n", "cwd, pieces = [], pieces[1:]\n", "path = path[1:]\n", "found = []\n", "def foo(p, cwd):...\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "For", "Expr'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.priority = VAR_77\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.priority = priority\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "return self.name\n" ]
[ "def get_name(self):...\n", "return self.name\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_3(self, VAR_2, VAR_1, VAR_3):...\n", "" ]
[ "def support_project(self, user_id, project_id, money):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __init__(self, VAR_1):...\n", "self.file = VAR_1\n", "self.hosts = list()\n", "self.parse()\n" ]
[ "def __init__(self, file):...\n", "self.file = file\n", "self.hosts = list()\n", "self.parse()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "from pylons import c, request, g\n", "from pylons.i18n import _\n", "from pylons.controllers.util import abort\n", "from r2.lib import utils, captcha\n", "from r2.lib.filters import unkeep_space, websafe, _force_utf8, _force_ascii\n", "from r2.lib.db.operators import asc, desc\n", "from r2.config impor...
[ "from pylons import c, request, g\n", "from pylons.i18n import _\n", "from pylons.controllers.util import abort\n", "from r2.lib import utils, captcha\n", "from r2.lib.filters import unkeep_space, websafe, _force_utf8, _force_ascii\n", "from r2.lib.db.operators import asc, desc\n", "from r2.config impor...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", ...
[ "def FUNC_1(VAR_0, VAR_1, VAR_2=False):...\n", "\"\"\"docstring\"\"\"\n", "if 'device_class' in VAR_0:\n", "VAR_22 = VAR_0['device_class']\n", "if VAR_1 in ['simulate', 'fake']:\n", "VAR_11, VAR_12 = VAR_22.split('.')\n", "VAR_22 = 'fake.Fake'\n", "VAR_22 = 'generic.Generic'\n", "VAR_13 = import_mod...
[ "def get_device(settings, instrum, debug=False):...\n", "\"\"\"docstring\"\"\"\n", "if 'device_class' in settings:\n", "device_class = settings['device_class']\n", "if instrum in ['simulate', 'fake']:\n", "mod, obj = device_class.split('.')\n", "device_class = 'fake.Fake'\n", "device_class = 'generic....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6():...\n", "if not request.method in VAR_0:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "VAR_7 = urlparse(request.environ.get('HTTP_...
[ "def check():...\n", "if not request.method in methods:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "ref_url = urlparse(request.environ.get('HT...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Condition", "AugAssign'", "Condition", "Condition", "Return'" ]
[ "@click.command(help='List accounts')...\n", "VAR_37 = newrelic.get_accounts()\n", "if VAR_11:\n", "for VAR_20 in VAR_37:\n", "VAR_24 = [['ID', 'Name']]\n", "print(VAR_20[0])\n", "for VAR_20 in VAR_37:\n", "VAR_24.append([VAR_20['id'], VAR_20['name']])\n", "VAR_25 = SingleTable(VAR_24)\n", "VAR_25...
[ "@click.command(help='List accounts')...\n", "accounts = newrelic.get_accounts()\n", "if raw:\n", "for account in accounts:\n", "data = [['ID', 'Name']]\n", "print(account[0])\n", "for account in accounts:\n", "data.append([account['id'], account['name']])\n", "table = SingleTable(data)\n", "table...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "For", "Assign'", "Expr'", "For", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_26(self, VAR_74):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.benchmark = VAR_74\n", "return VAR_101\n" ]
[ "def benchmark(self, benchmark):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.benchmark = benchmark\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "import logging\n", "import traceback\n", "from fuel_health.common.utils.data_utils import rand_name\n", "from fuel_health import nmanager\n", "VAR_0 = logging.getLogger(__name__)\n", "\"\"\"string\"\"\"\n", "@classmethod...\n", "super(CLASS_0, VAR_1).setUpClass()\n", "if VAR_1.manager.clients_initi...
[ "import logging\n", "import traceback\n", "from fuel_health.common.utils.data_utils import rand_name\n", "from fuel_health import nmanager\n", "LOG = logging.getLogger(__name__)\n", "\"\"\"Test suit verifies:\n - keypairs creation\n - security groups creation\n - Network creation\n - Insta...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Expr'", "Condition", "Expr'", "Condition", "Assign'", "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Expr'", "Condition", "Co...
[ "def FUNC_6(self, VAR_47):...\n", "if VAR_101.user_is_admin:\n", "return True\n", "if VAR_101.user_is_loggedin:\n", "VAR_18 = Thing._by_fullname(VAR_47, data=True)\n", "abort(403, 'forbidden')\n", "VAR_109 = VAR_18.subreddit_slow\n", "if VAR_109.can_ban(VAR_101.user):\n", "return True\n" ]
[ "def run(self, thing_name):...\n", "if c.user_is_admin:\n", "return True\n", "if c.user_is_loggedin:\n", "item = Thing._by_fullname(thing_name, data=True)\n", "abort(403, 'forbidden')\n", "subreddit = item.subreddit_slow\n", "if subreddit.can_ban(c.user):\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Assign'", "Expr'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_4(self):...\n", "\"\"\"docstring\"\"\"\n", "self._check_flags()\n" ]
[ "def check_for_setup_error(self):...\n", "\"\"\"docstring\"\"\"\n", "self._check_flags()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_1(VAR_0, VAR_1=None):...\n", "VAR_5 = FUNC_0()\n", "VAR_6 = VAR_5.cursor()\n", "if not VAR_1:\n", "VAR_6.execute(VAR_0)\n", "VAR_6.execute(VAR_0, VAR_1)\n", "VAR_5.commit()\n", "VAR_5.close()\n" ]
[ "def execute(query, params=None):...\n", "conn = connect()\n", "c = conn.cursor()\n", "if not params:\n", "c.execute(query)\n", "c.execute(query, params)\n", "conn.commit()\n", "conn.close()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_11(self, VAR_9):...\n", "return [self.actors[VAR_6] for VAR_6 in self.actors.keys() if VAR_9 in self\n .actors[VAR_6].name]\n" ]
[ "def allActorsbyName(self, name):...\n", "return [self.actors[ID] for ID in self.actors.keys() if name in self.actors\n [ID].name]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_16(self, VAR_7, VAR_15):...\n", "VAR_26 = []\n", "if VAR_7._joins:\n", "VAR_9 = [None] * len(VAR_7._joins) + [None]\n", "for res in VAR_15:\n", "VAR_30 = {}\n", "VAR_4 = dict(zip(VAR_7.model_class._meta.sorted_fields_names, res))\n", "return VAR_26\n", "VAR_31 = []\n", "VAR_26.append(VAR...
[ "def parse_select(self, query, result):...\n", "class_list = []\n", "if query._joins:\n", "current = [None] * len(query._joins) + [None]\n", "for res in result:\n", "models_class = {}\n", "kwargs = dict(zip(query.model_class._meta.sorted_fields_names, res))\n", "return class_list\n", "rel = []\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "For", "Assign'", "Assign'", "Return'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'"...
[ "def FUNC_23(self, VAR_29):...\n", "" ]
[ "def is_localhost(self, hostname):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_19(VAR_16):...\n", "VAR_37 = os.path.join(VAR_16, 'README.md')\n", "if os.path.isfile(VAR_37):\n", "return 'LICENSE' in open(VAR_37).read()\n", "return False\n" ]
[ "def license_mentionned_in_readme(path):...\n", "readme_path = os.path.join(path, 'README.md')\n", "if os.path.isfile(readme_path):\n", "return 'LICENSE' in open(readme_path).read()\n", "return False\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def __getstate__(self):...\n", "return self.serialize()\n" ]
[ "def __getstate__(self):...\n", "return self.serialize()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@property...\n", "return self.settings['db']\n" ]
[ "@property...\n", "return self.settings['db']\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_19(self, VAR_16, VAR_20, VAR_21=False, **VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "self._eql_execute('volume', 'select', VAR_16['name'], 'access', 'delete', '1')\n", "VAR_0.error(_('Failed to terminate connection to volume %s'), VAR_16['name'])\n" ]
[ "def terminate_connection(self, volume, connector, force=False, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "self._eql_execute('volume', 'select', volume['name'], 'access', 'delete', '1')\n", "LOG.error(_('Failed to terminate connection to volume %s'), volume['name'])\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'" ]
[ "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_30(VAR_13):...\n", "self.fail('authenticate should not be called')\n" ]
[ "def skipped(request):...\n", "self.fail('authenticate should not be called')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_9(self):...\n", "self.assertTrue(os.path.exists(fp.name),\n 'Temporary file should exist within the context.')\n", "self.assertTrue(os.path.exists(fp.name),\n 'Temporary file should exist outside of context if cleanup=False.')\n", "os.unlink(fp.name)\n" ]
[ "def test_temporary_file_without_cleanup(self):...\n", "self.assertTrue(os.path.exists(fp.name),\n 'Temporary file should exist within the context.')\n", "self.assertTrue(os.path.exists(fp.name),\n 'Temporary file should exist outside of context if cleanup=False.')\n", "os.unlink(fp.name)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_17(self):...\n", "def FUNC_23(VAR_11):...\n", "return '%s> ' % self.configuration.eqlx_group_name\n" ]
[ "def test_get_output(self):...\n", "def _fake_recv(ignore_arg):...\n", "return '%s> ' % self.configuration.eqlx_group_name\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Return'" ]
[ "def FUNC_25(VAR_32, VAR_34=0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_67 = list(VAR_32.items())\n", "VAR_67.sort(FUNC_23)\n", "return VAR_34 and VAR_67[:VAR_34] or VAR_67\n" ]
[ "def _sort_kw_matches(skw_matches, limit=0):...\n", "\"\"\"docstring\"\"\"\n", "sorted_keywords = list(skw_matches.items())\n", "sorted_keywords.sort(_skw_matches_comparator)\n", "return limit and sorted_keywords[:limit] or sorted_keywords\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(VAR_6):...\n", "VAR_8 = VAR_6.submission.exercise if VAR_6.submission else None\n", "return {'id': VAR_6.id, 'submission_id': VAR_6.submission.id if VAR_6.\n submission else 0, 'name': '{} {}, {}'.format(VAR_6.course_instance.\n course.code, str(VAR_8.parent) if VAR_8 and VAR_8.parent else VAR...
[ "def notification_entry(n):...\n", "exercise = n.submission.exercise if n.submission else None\n", "return {'id': n.id, 'submission_id': n.submission.id if n.submission else 0,\n 'name': '{} {}, {}'.format(n.course_instance.course.code, str(exercise.\n parent) if exercise and exercise.parent else n.course...
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "from osv import fields, osv\n", "from tools.translate import _\n", "VAR_0 = 'product.product'\n", "def FUNC_0(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "VAR_17 = self.pool.get('product.product').browse(VAR_1, VAR_2, VAR_3, VAR_4\n...
[ "from osv import fields, osv\n", "from tools.translate import _\n", "_inherit = 'product.product'\n", "def get_product_accounts(self, cr, uid, product_id, context=None):...\n", "\"\"\"docstring\"\"\"\n", "if context is None:\n", "context = {}\n", "product_obj = self.pool.get('product.product').browse(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_16(self, VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "for o in self.products:\n", "if o.match(VAR_15):\n", "return False\n", "return True\n" ]
[ "def is_producer(self, requested_output):...\n", "\"\"\"docstring\"\"\"\n", "for o in self.products:\n", "if o.match(requested_output):\n", "return False\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_2, VAR_10, VAR_11):...\n", "self.window = VAR_2\n", "self.parent_widget = VAR_10\n", "self.database_filepath = VAR_11\n", "self.unlock_database()\n" ]
[ "def __init__(self, window, widget, filepath):...\n", "self.window = window\n", "self.parent_widget = widget\n", "self.database_filepath = filepath\n", "self.unlock_database()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@VAR_2.patch('core.common.utils.c_onboarding_status')...\n", "VAR_5 = VAR_2.return_value\n", "VAR_5.find_one.return_value = VAR_0\n", "self.assertEqual(get_onboarding_percentage(1), VAR_1)\n" ]
[ "@mock.patch('core.common.utils.c_onboarding_status')...\n", "_mock = mock.return_value\n", "_mock.find_one.return_value = steps\n", "self.assertEqual(get_onboarding_percentage(1), result)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_14, VAR_15 = new_webui_log_file()\n", "self._webui_url, VAR_16 = ray.services.start_ui(self._redis_address, VAR_14\n =stdout_file, VAR_15=stderr_file)\n", "assert VAR_13.PROCESS_TYPE_WEB_UI not in self.all_processes\n", "if VAR_16 is not None:\n...
[ "def start_ui(self):...\n", "\"\"\"docstring\"\"\"\n", "stdout_file, stderr_file = new_webui_log_file()\n", "self._webui_url, process_info = ray.services.start_ui(self._redis_address,\n stdout_file=stdout_file, stderr_file=stderr_file)\n", "assert ray_constants.PROCESS_TYPE_WEB_UI not in self.all_process...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assert'", "Condition", "Assign'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = self.data_document.data_group.group_type.code\n", "if VAR_18 in ['CP', 'HH']:\n", "return reverse('qa_chemicalpresence_index')\n", "return reverse('qa_extractionscript_index')\n" ]
[ "def get_qa_index_path(self):...\n", "\"\"\"docstring\"\"\"\n", "group_type_code = self.data_document.data_group.group_type.code\n", "if group_type_code in ['CP', 'HH']:\n", "return reverse('qa_chemicalpresence_index')\n", "return reverse('qa_extractionscript_index')\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_26(self, VAR_41, VAR_42):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def symlink(self, targetPath, linkPath):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_5(self, VAR_13, VAR_14=1):...\n", "utils.check_ssh_injection(VAR_13)\n", "VAR_11 = ' '.join(VAR_13)\n", "if not self.sshpool:\n", "VAR_39 = self.configuration.san_password\n", "VAR_43 = VAR_14\n", "VAR_0.error(_('Error running SSH command: %s') % VAR_11)\n", "VAR_40 = self.configuration.san_...
[ "def _run_ssh(self, cmd_list, attempts=1):...\n", "utils.check_ssh_injection(cmd_list)\n", "command = ' '.join(cmd_list)\n", "if not self.sshpool:\n", "password = self.configuration.san_password\n", "total_attempts = attempts\n", "LOG.error(_('Error running SSH command: %s') % command)\n", "privatekey...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "AugAssign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_6():...\n", "VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n" ]
[ "def _raise_exception():...\n", "frappe.throw(_('Invalid Search Field'), frappe.DataError)\n" ]
[ 0, 4 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_25(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 8}, 'CONFIDENCE': {'MEDIUM': 8}}\n", "self.check_example('os-exec.py', VAR_2)\n" ]
[ "def test_os_exec(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 8}, 'CONFIDENCE': {'MEDIUM': 8}}\n", "self.check_example('os-exec.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "from reddit_base import RedditController\n", "from r2.lib.pages import BoringPage, ShowMeetup, NewMeetup, EditMeetup, PaneStack, CommentListing, LinkInfoPage, CommentReplyBox, NotEnoughKarmaToPost\n", "from validator import validate, VUser, VRequired, VMeetup, VEditMeetup, VFloat, ValueOrBlank, ValidIP, VMenu,...
[ "from reddit_base import RedditController\n", "from r2.lib.pages import BoringPage, ShowMeetup, NewMeetup, EditMeetup, PaneStack, CommentListing, LinkInfoPage, CommentReplyBox, NotEnoughKarmaToPost\n", "from validator import validate, VUser, VRequired, VMeetup, VEditMeetup, VFloat, ValueOrBlank, ValidIP, VMenu,...
[ 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", ...
[ "def FUNC_9(self, VAR_9, VAR_11=None):...\n", "VAR_1 = get_and_check_project(VAR_9, VAR_11, ('change_project',))\n", "VAR_27 = [VAR_35 for filesList in map(lambda key: VAR_9.FILES.getlist(key),\n [keys for keys in VAR_9.FILES]) for VAR_35 in filesList]\n", "VAR_28 = models.Task.create_from_images(VAR_27, V...
[ "def create(self, request, project_pk=None):...\n", "project = get_and_check_project(request, project_pk, ('change_project',))\n", "files = [file for filesList in map(lambda key: request.FILES.getlist(key),\n [keys for keys in request.FILES]) for file in filesList]\n", "task = models.Task.create_from_image...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_26(self, VAR_41, VAR_42):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def symlink(self, targetPath, linkPath):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "\"\"\"string\"\"\"\n", "from flask import Flask, jsonify, request\n", "from flask_restful import Resource, Api\n", "from flask_cors import CORS\n", "import db_interac\n", "import utils\n", "VAR_0 = Flask(__name__)\n", "VAR_1 = Api(VAR_0)\n", "CORS(VAR_0)\n", "def FUNC_0(self):...\n", "\"\"\"doc...
[ "\"\"\"A basic Flask app which we can build off of.\n\nHandles basic http requests in a simple way.\nOnly throws 404 errors for now.\n\nNote: Pretty much everything should be changed.\n Also see about adding arguments to the requests.\n Should also change the names of the classes.\n\n The classes may...
[ 4, 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 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "For", "Assign'", "A...
[ "def FUNC_34(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n", "self.check_example('skip.py', VAR_2)\n" ]
[ "def test_skip(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n", "self.check_example('skip.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_8(self, VAR_3):...\n", "VAR_8 = '%s-%s' % (self.__cluster_name, VAR_3)\n", "VAR_5 = [{'cloudProvider': 'gce', 'asgName': VAR_8, 'serverGroupName':\n VAR_8, 'region': self.TEST_REGION, 'zone': self.TEST_ZONE, 'type':\n 'destroyServerGroup', 'regions': [self.TEST_REGION], 'zones': [self.\n TEST...
[ "def destroy_server_group(self, version):...\n", "serverGroupName = '%s-%s' % (self.__cluster_name, version)\n", "job = [{'cloudProvider': 'gce', 'asgName': serverGroupName,\n 'serverGroupName': serverGroupName, 'region': self.TEST_REGION, 'zone':\n self.TEST_ZONE, 'type': 'destroyServerGroup', 'regions':...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "@auth.route('/reset/<token>', methods=['GET', 'POST'])...\n", "if not current_user.is_anonymous:\n", "return redirect(url_for('main.index'))\n", "VAR_1 = PasswordResetForm()\n", "if VAR_1.validate_on_submit():\n", "VAR_2 = User.query.filter_by(email=form.email.data).first()\n", "return render_template(...
[ "@auth.route('/reset/<token>', methods=['GET', 'POST'])...\n", "if not current_user.is_anonymous:\n", "return redirect(url_for('main.index'))\n", "form = PasswordResetForm()\n", "if form.validate_on_submit():\n", "user = User.query.filter_by(email=form.email.data).first()\n", "return render_template('au...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Return'", "Condition", "Expr'", "Return'", "Return'" ]
[ "def FUNC_30(self, VAR_78):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.version = VAR_78\n", "return VAR_101\n" ]
[ "def version(self, version):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.version = version\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_17(self, VAR_4, VAR_12=True, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def make_target_proxy(self, accessor, manage_back_references=True, options=None...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_4(self, VAR_4):...\n", "if self.log_dir is None:\n", "return\n", "VAR_19 = '%s_%s.log' % (VAR_4.start_time, VAR_4.__class__.__name__)\n", "VAR_20 = os.path.join(self.log_dir, VAR_19)\n", "VAR_21 = os.path.join(self.log_dir, VAR_4.__class__.__name__)\n", "VAR_4.store_to_file(fd)\n", "os.remov...
[ "def store_to_file(self, request):...\n", "if self.log_dir is None:\n", "return\n", "filename = '%s_%s.log' % (request.start_time, request.__class__.__name__)\n", "filepath = os.path.join(self.log_dir, filename)\n", "linkpath = os.path.join(self.log_dir, request.__class__.__name__)\n", "request.store_to...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_18(VAR_32, VAR_33, VAR_5=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_60 = {}\n", "VAR_52 = {}\n", "for VAR_93, _ in VAR_32:\n", "for VAR_83 in VAR_93.fieldcodes:\n", "for VAR_94, _ in VAR_33:\n", "VAR_60.setdefault(VAR_83, set()).add(VAR_93.output(VAR_5))\n", "if len(VAR_94.fieldcodes):...
[ "def _get_fieldcodes(skw_matches, ckw_matches, spires=False):...\n", "\"\"\"docstring\"\"\"\n", "fieldcodes = {}\n", "output = {}\n", "for skw, _ in skw_matches:\n", "for fieldcode in skw.fieldcodes:\n", "for ckw, _ in ckw_matches:\n", "fieldcodes.setdefault(fieldcode, set()).add(skw.output(spires))\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "For", "For", "Expr'", "Condition", "For", "For", "For", "Assign'", "Return'", "Expr'", "For", "Expr'", "Expr'" ]
[ "def FUNC_6(self):...\n", "VAR_14 = ['8.9.10.11', '9.10.11.12:4433']\n", "VAR_15 = self.new_mocked_cluster(VAR_14, FUNC_0)\n", "self._assert_providers(VAR_15, [(p, 'https://%s' % p) for p in VAR_14])\n" ]
[ "def test_conf_providers_no_scheme(self):...\n", "conf_managers = ['8.9.10.11', '9.10.11.12:4433']\n", "api = self.new_mocked_cluster(conf_managers, _validate_conn_up)\n", "self._assert_providers(api, [(p, 'https://%s' % p) for p in conf_managers])\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_11(self):...\n", "VAR_14 = []\n", "for VAR_16 in self.FORM:\n", "if VAR_16 in self.meta.iptc_keys:\n", "return VAR_14\n", "VAR_14.append((VAR_16, self.get_safe_value(self.meta, VAR_16)))\n", "VAR_14.append((VAR_16, ''))\n" ]
[ "def get_form_fields(self):...\n", "ret = []\n", "for field in self.FORM:\n", "if field in self.meta.iptc_keys:\n", "return ret\n", "ret.append((field, self.get_safe_value(self.meta, field)))\n", "ret.append((field, ''))\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_3(self, VAR_4):...\n", "if not VAR_4:\n", "return None\n", "VAR_30 = VAR_4\n", "if isinstance(VAR_30, str):\n", "VAR_30 = bytes(VAR_30, encoding='utf-8')\n", "return pickle.loads(VAR_30)\n", "return super().to_python(VAR_4)\n", "VAR_30 = base64.b64decode(VAR_30)\n" ]
[ "def to_python(self, value):...\n", "if not value:\n", "return None\n", "_value = value\n", "if isinstance(_value, str):\n", "_value = bytes(_value, encoding='utf-8')\n", "return pickle.loads(_value)\n", "return super().to_python(value)\n", "_value = base64.b64decode(_value)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Assign'" ]
[ "def FUNC_13(self, *VAR_13, **VAR_14):...\n", "for VAR_9 in VAR_13:\n", "self._set_log_item(VAR_9)\n", "for VAR_10, VAR_9 in VAR_14.items():\n", "self._set_log_item(VAR_9, VAR_10=name)\n" ]
[ "def set_log(self, *logs, **kwlogs):...\n", "for item in logs:\n", "self._set_log_item(item)\n", "for name, item in kwlogs.items():\n", "self._set_log_item(item, name=name)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "For", "Expr'" ]
[ "def __repr__(self):...\n", "return super().__repr__() + 'Backend: ' + self.backend + '\\n'\n" ]
[ "def __repr__(self):...\n", "return super().__repr__() + 'Backend: ' + self.backend + '\\n'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/countries/<country_id>', methods=['GET'])...\n", "return get_by_id('countries', VAR_1)\n" ]
[ "@locations.route('/countries/<country_id>', methods=['GET'])...\n", "return get_by_id('countries', country_id)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "import json\n", "import functools\n", "import zope.security.interfaces\n", "from twisted.internet import defer\n", "from twisted.python import log, failure\n", "from twisted.web import resource\n", "from twisted.web.server import NOT_DONE_YET\n", "from zope.component import queryAdapter, getUtility\n...
[ "import json\n", "import functools\n", "import zope.security.interfaces\n", "from twisted.internet import defer\n", "from twisted.python import log, failure\n", "from twisted.web import resource\n", "from twisted.web.server import NOT_DONE_YET\n", "from zope.component import queryAdapter, getUtility\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Expr'", "Assign'", "Condition", "Condition", "...
[ "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'" ]
[ "def FUNC_5(self):...\n", "return \"datetime('now')\"\n" ]
[ "def sqlNowCall(self):...\n", "return \"datetime('now')\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_4(self):...\n", "VAR_11 = ExtractedChemicalIndex(meta={'id': self.id}, chem_name=self.\n raw_chem_name, raw_cas=self.raw_cas, raw_chem_name=self.raw_chem_name,\n facet_model_name='Extracted Chemical')\n", "VAR_11.save()\n", "return VAR_11.to_dict(include_meta=True)\n" ]
[ "def indexing(self):...\n", "obj = ExtractedChemicalIndex(meta={'id': self.id}, chem_name=self.\n raw_chem_name, raw_cas=self.raw_cas, raw_chem_name=self.raw_chem_name,\n facet_model_name='Extracted Chemical')\n", "obj.save()\n", "return obj.to_dict(include_meta=True)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]