lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_8(self, VAR_13):...\n", "self.cursor.execute('SELECT * FROM log_' + VAR_13 + ' WHERE result_id=? ',\n [self.result['id']])\n", "return self.cursor.fetchall()\n" ]
[ "def get_item(self, item):...\n", "self.cursor.execute('SELECT * FROM log_' + item + ' WHERE result_id=? ', [\n self.result['id']])\n", "return self.cursor.fetchall()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = self\n", "VAR_12 = []\n", "@api.require(lambda : False)...\n", "VAR_6.fail('Handler code should not be called')\n", "def FUNC_37(self, VAR_29):...\n", "VAR_12.append('authorization_error')\n", "super(CLASS_7, self).authorization_error(VAR...
[ "def test_authorization_error(self):...\n", "\"\"\"docstring\"\"\"\n", "test = self\n", "calls = []\n", "@api.require(lambda : False)...\n", "test.fail('Handler code should not be called')\n", "def authorization_error(self, err):...\n", "calls.append('authorization_error')\n", "super(Handler, self)....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "FunctionDef'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_6(*VAR_16, **VAR_17):...\n", "return VAR_15.translate(VAR_1(*VAR_16, **kwargs))\n" ]
[ "def auto_translate(*args, **kwargs):...\n", "return localizer.translate(translation_string_factory(*args, **kwargs))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, *VAR_10, **VAR_11):...\n", "VAR_18 = []\n", "VAR_19 = {'widget': self.widget, 'max_length': VAR_11.pop('max_length', None)}\n", "self.scheme_name = VAR_11.pop('scheme')\n", "self.scheme = PERSON_NAME_SCHEMES.get(self.scheme_name)\n", "self.one_required = VAR_11.get('required', True)\n"...
[ "def __init__(self, *args, **kwargs):...\n", "fields = []\n", "defaults = {'widget': self.widget, 'max_length': kwargs.pop('max_length', None)\n }\n", "self.scheme_name = kwargs.pop('scheme')\n", "self.scheme = PERSON_NAME_SCHEMES.get(self.scheme_name)\n", "self.one_required = kwargs.get('required', Tr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "For", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(VAR_11):...\n", "VAR_17 = []\n", "for r in VAR_11:\n", "VAR_18 = {'value': r[0], 'description': ', '.join(unique(cstr(d) for d in r if\n d)[1:])}\n", "return VAR_17\n", "VAR_17.append(VAR_18)\n" ]
[ "def build_for_autosuggest(res):...\n", "results = []\n", "for r in res:\n", "out = {'value': r[0], 'description': ', '.join(unique(cstr(d) for d in r if\n d)[1:])}\n", "return results\n", "results.append(out)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_7(self):...\n", "VAR_13 = FUNC_0(self.groups['path'])\n", "if self.groups['path'] != VAR_13:\n", "self.response.headers.set('Location', self.remote + VAR_13)\n", "self.filename = self.local + urllib.parse.unquote(self.groups['path'])\n", "return 307, ''\n", "return VAR_5.respond(self)\n" ]
[ "def respond(self):...\n", "norm_request = normpath(self.groups['path'])\n", "if self.groups['path'] != norm_request:\n", "self.response.headers.set('Location', self.remote + norm_request)\n", "self.filename = self.local + urllib.parse.unquote(self.groups['path'])\n", "return 307, ''\n", "return handler...
[ 0, 0, 0, 0, 1, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_10(self, VAR_12):...\n", "VAR_33 = super().get_transform(VAR_12)\n", "if VAR_33:\n", "return VAR_33\n", "return CLASS_18(VAR_12)\n" ]
[ "def get_transform(self, name):...\n", "transform = super().get_transform(name)\n", "if transform:\n", "return transform\n", "return JsonKeyTransformFactory(name)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_0, VAR_1, VAR_2=None):...\n", "GenericRequest.__init__(self, VAR_0, VAR_2)\n", "self.submission_id = VAR_1\n", "self.url = '%ssubmission/%s' % (self.base_url, VAR_1)\n" ]
[ "def __init__(self, browser, submission_id, base_url=None):...\n", "GenericRequest.__init__(self, browser, base_url)\n", "self.submission_id = submission_id\n", "self.url = '%ssubmission/%s' % (self.base_url, submission_id)\n" ]
[ 0, 0, 0, 5 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_4(self, VAR_1, VAR_2, VAR_5, VAR_10=None, VAR_11=False, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_10:\n", "VAR_10 = []\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "VAR_29 = {}\n", "for VAR_48 in VAR_5:\n", "VAR_29[VAR_48] = {}.fromkeys(VAR_10, 0.0)\n", "for VAR_55 in VAR_...
[ "def _product_available(self, cr, uid, ids, field_names=None, arg=False,...\n", "\"\"\"docstring\"\"\"\n", "if not field_names:\n", "field_names = []\n", "if context is None:\n", "context = {}\n", "res = {}\n", "for id in ids:\n", "res[id] = {}.fromkeys(field_names, 0.0)\n", "for f in field_names:...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "For", "Assign'", "For", "Assign'", "Return'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "For", "Assign'" ]
[ "@app.route('/api/sequences', methods=['GET'])...\n", "return [x.to_map() for x in controller.sequences]\n" ]
[ "@app.route('/api/sequences', methods=['GET'])...\n", "return [x.to_map() for x in controller.sequences]\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._name\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._name\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_6(self, VAR_11):...\n", "self._portal = VAR_11\n" ]
[ "def set_portal(self, portal):...\n", "self._portal = portal\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_25(self, VAR_10, VAR_9, VAR_6):...\n", "assert self.dbsession is not None, 'Missing dbsession'\n", "VAR_3 = self.dbsession()\n", "VAR_15 = VAR_3.query(VAR_10).options(undefer_group('edit')).filter(getattr(\n VAR_10, self.id_key) == VAR_9).scalar()\n", "if VAR_15 is None:\n", "VAR_15.__name__ ...
[ "def _get_item(self, klass, key, object_name):...\n", "assert self.dbsession is not None, 'Missing dbsession'\n", "dbsession = self.dbsession()\n", "obj = dbsession.query(klass).options(undefer_group('edit')).filter(getattr(\n klass, self.id_key) == key).scalar()\n", "if obj is None:\n", "obj.__name__ ...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assert'", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_3, VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = 'string'\n", "VAR_3.execute(VAR_7 % VAR_4)\n", "return VAR_3.fetchone()[0]\n" ]
[ "def option_ispreset(cursor, option):...\n", "\"\"\"docstring\"\"\"\n", "query = \"\"\"\n SELECT EXISTS\n (SELECT 1\n FROM pg_settings\n WHERE context = 'internal'\n AND name = '%s')\n \"\"\"\n", "cursor.execute(query % option)\n", "return cursor.fetchone()[0]\n" ]
[ 0, 0, 4, 4, 4 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_20(self, VAR_19, VAR_20):...\n", "\"\"\"docstring\"\"\"\n", "for clause in reversed(self.order):\n", "VAR_40 = VAR_20.has_wildcards() - VAR_19.has_wildcards()\n", "VAR_51 = clause.index(VAR_19.name)\n", "if VAR_40 != 0:\n", "VAR_52 = clause.index(VAR_20.name)\n", "return VAR_40\n", "return...
[ "def compare(self, rule1, rule2):...\n", "\"\"\"docstring\"\"\"\n", "for clause in reversed(self.order):\n", "wildcard_cmp = rule2.has_wildcards() - rule1.has_wildcards()\n", "i = clause.index(rule1.name)\n", "if wildcard_cmp != 0:\n", "j = clause.index(rule2.name)\n", "return wildcard_cmp\n", "retu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Assign'" ]
[ "def FUNC_0(VAR_0, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_0.round_numbered(VAR_1)\n" ]
[ "def get_round_or_404(tournament, round_num):...\n", "\"\"\"docstring\"\"\"\n", "return tournament.round_numbered(round_num)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_22(self):...\n", "return bool(self._latest_file_parse_request and self.\n _latest_file_parse_request.Done())\n" ]
[ "def DiagnosticsForCurrentFileReady(self):...\n", "return bool(self._latest_file_parse_request and self.\n _latest_file_parse_request.Done())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6():...\n", "VAR_2.test_locals = dict()\n", "VAR_2.test_locals.update(VAR_8.__dict__)\n", "exec(VAR_3, VAR_2.test_locals)\n" ]
[ "def exec_test():...\n", "step.test_locals = dict()\n", "step.test_locals.update(module.__dict__)\n", "exec(code, step.test_locals)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_2(VAR_34):...\n", "VAR_15.pack_forget()\n", "VAR_10.pack(expand=True, fill='both')\n", "VAR_9.pack_forget()\n", "VAR_39 = 'meal_planner.db'\n", "print(VAR_34)\n", "VAR_48 = conn.cursor()\n", "VAR_49 = VAR_48.execute('SELECT * FROM recipe WHERE name = ' + '\"' + VAR_34 +\n '\"')\n", "for...
[ "def callback(recipeName):...\n", "menu.pack_forget()\n", "viewRecipeFrame.pack(expand=True, fill='both')\n", "groceryButton.pack_forget()\n", "database_file = 'meal_planner.db'\n", "print(recipeName)\n", "cursor = conn.cursor()\n", "selection = cursor.execute('SELECT * FROM recipe WHERE name = ' + '\...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "For", "For", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = self.add_argument_group('ParlAI Model Arguments')\n", "VAR_28.add_argument('-m', '--model', default=None, help=\n 'the model class name. can match parlai/agents/<model> for agents in that directory, or can provide a fully specified module for `...
[ "def add_model_args(self):...\n", "\"\"\"docstring\"\"\"\n", "model_args = self.add_argument_group('ParlAI Model Arguments')\n", "model_args.add_argument('-m', '--model', default=None, help=\n 'the model class name. can match parlai/agents/<model> for agents in that directory, or can provide a fully specif...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_13(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.run_tracker.background_worker_pool()\n" ]
[ "def background_worker_pool(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.run_tracker.background_worker_pool()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_12(self, VAR_2, VAR_17, VAR_18, VAR_3=None):...\n", "VAR_36 = FUNC_0(VAR_2, VAR_3)\n" ]
[ "def _raise_error(self, status_code, operation, result_msg, error_code=None):...\n", "error = http_error_to_exception(status_code, error_code)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_4(VAR_10, VAR_11, VAR_12, VAR_13, VAR_14, VAR_15, VAR_16=None,...\n", "\"\"\"docstring\"\"\"\n", "VAR_33, VAR_34 = VAR_14\n", "VAR_35 = glob.glob(os.path.join(VAR_10, VAR_12, VAR_13, VAR_11, '*.tif'))\n", "VAR_35 = FUNC_0(FUNC_1(VAR_35, VAR_4=decade_begin, VAR_5=decade_end, VAR_1=\n '_', VAR_3=...
[ "def get_metrics(base_path, variable, model, scenario, decade, mask,...\n", "\"\"\"docstring\"\"\"\n", "decade_begin, decade_end = decade\n", "modeled_files = glob.glob(os.path.join(base_path, model, scenario, variable,\n '*.tif'))\n", "modeled_files = sort_files(only_years(modeled_files, begin=decade_be...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'...
[ "def FUNC_5(self):...\n", "self._tab_after(' s')\n", "eq_(self.terminal.method_calls, [('write', ('et ',), {})])\n" ]
[ "def test_command_completion_spaces(self):...\n", "self._tab_after(' s')\n", "eq_(self.terminal.method_calls, [('write', ('et ',), {})])\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_5(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = {}\n", "VAR_5['clusterName'] = self.configuration.san_clustername\n", "if self.configuration.san_thin_provision:\n", "VAR_5['thinProvision'] = '1'\n", "VAR_5['thinProvision'] = '0'\n", "VAR_5['volumeName'] = VAR_10['name']\n", "if...
[ "def create_volume(self, volume):...\n", "\"\"\"docstring\"\"\"\n", "cliq_args = {}\n", "cliq_args['clusterName'] = self.configuration.san_clustername\n", "if self.configuration.san_thin_provision:\n", "cliq_args['thinProvision'] = '1'\n", "cliq_args['thinProvision'] = '0'\n", "cliq_args['volumeName']...
[ 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'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_44=None):...\n", "if not VAR_101.user_is_loggedin:\n", "if VAR_44 is not None and not valid_password(VAR_101.user, VAR_44):\n", "VAR_101.errors.add(errors.WRONG_PASSWORD)\n" ]
[ "def run(self, password=None):...\n", "if not c.user_is_loggedin:\n", "if password is not None and not valid_password(c.user, password):\n", "c.errors.add(errors.WRONG_PASSWORD)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'" ]
[ "def FUNC_1():...\n", "if not os.path.isfile(VAR_0):\n", "VAR_9 = lite.connect(VAR_0)\n", "VAR_7 = VAR_9.cursor()\n" ]
[ "def check_files():...\n", "if not os.path.isfile(DATABASE_PATH):\n", "conn = lite.connect(DATABASE_PATH)\n", "c = conn.cursor()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_5(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = self.bindings\n", "VAR_6 = VAR_1['TEST_APP_COMPONENT_NAME']\n", "VAR_7 = '{0}/targetPools/{1}-tp'.format(VAR_1['TEST_GCE_REGION'], VAR_6)\n", "VAR_8 = {'checkIntervalSec': 9, 'healthyThreshold': 3, 'unhealthyThreshold':\n 5, 'timeoutSec': 2,...
[ "def upsert_load_balancer(self):...\n", "\"\"\"docstring\"\"\"\n", "bindings = self.bindings\n", "load_balancer_name = bindings['TEST_APP_COMPONENT_NAME']\n", "target_pool_name = '{0}/targetPools/{1}-tp'.format(bindings[\n 'TEST_GCE_REGION'], load_balancer_name)\n", "spec = {'checkIntervalSec': 9, 'hea...
[ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_2(VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = FUNC_1(VAR_4)\n", "VAR_7 = pd.read_csv(\n 'https://projects.fivethirtyeight.com/soccer-api/club/spi_matches.csv'\n ).drop(columns=['league_id'])\n", "VAR_7['date'] = pd.to_datetime(VAR_7['date'], format='%Y-%m-%d')\n", "VAR_8 = [VAR_1[le...
[ "def create_spi_tables(leagues_ids):...\n", "\"\"\"docstring\"\"\"\n", "leagues_ids = check_leagues_ids(leagues_ids)\n", "spi = pd.read_csv(\n 'https://projects.fivethirtyeight.com/soccer-api/club/spi_matches.csv'\n ).drop(columns=['league_id'])\n", "spi['date'] = pd.to_datetime(spi['date'], format='%...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'" ]
[ "@login_required...\n", "if VAR_14.method == 'POST':\n", "VAR_20 = int(VAR_14.POST['revision'])\n", "return HttpResponseNotAllowed(['POST'])\n", "VAR_27 = {'title': VAR_19}\n", "VAR_8 = None\n", "if VAR_3 is not None:\n", "VAR_8 = get_object_or_404(VAR_5, **{group_slug_field: group_slug})\n", "VAR_4...
[ "@login_required...\n", "if request.method == 'POST':\n", "revision = int(request.POST['revision'])\n", "return HttpResponseNotAllowed(['POST'])\n", "article_args = {'title': title}\n", "group = None\n", "if group_slug is not None:\n", "group = get_object_or_404(group_qs, **{group_slug_field: group_sl...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_7(self, VAR_14):...\n", "" ]
[ "def is_image(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_18(self, VAR_19, VAR_20):...\n", "self.cursor.execute(\n 'update store set storename = \"%s\" where storeid = \"%s\"' % (VAR_20, VAR_19)\n )\n", "self.connection.commit()\n" ]
[ "def update_store(self, storeid, storename):...\n", "self.cursor.execute(\n 'update store set storename = \"%s\" where storeid = \"%s\"' % (storename,\n storeid))\n", "self.connection.commit()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "@property...\n", "return self.meta.get('Iptc.Application2.Headline').value\n" ]
[ "@property...\n", "return self.meta.get('Iptc.Application2.Headline').value\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_0():...\n", "VAR_1 = tornado.web.Application([('^/$', module_index.MainframeHandler), (\n '/static/.*', module_static.StaticHandler), ('^/home', module_home.\n HomeHandler), ('^/files/?()$', module_files.FilesListHandler), (\n '^/files/list/(.*)', module_files.FilesListHandler), (\n '^/files...
[ "def main():...\n", "web_app = tornado.web.Application([('^/$', module_index.MainframeHandler),\n ('/static/.*', module_static.StaticHandler), ('^/home', module_home.\n HomeHandler), ('^/files/?()$', module_files.FilesListHandler), (\n '^/files/list/(.*)', module_files.FilesListHandler), (\n '^/files/...
[ 0, 5, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "For", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_19(self):...\n", "VAR_16 = self.mox.CreateMock(paramiko.SSHClient)\n", "VAR_12 = self.mox.CreateMock(paramiko.Channel)\n", "VAR_17 = self.mox.CreateMock(paramiko.Transport)\n", "self.mox.StubOutWithMock(self.driver, '_get_output')\n", "self.mox.StubOutWithMock(VAR_12, 'invoke_shell')\n", "VAR_...
[ "def test_ssh_execute(self):...\n", "ssh = self.mox.CreateMock(paramiko.SSHClient)\n", "chan = self.mox.CreateMock(paramiko.Channel)\n", "transport = self.mox.CreateMock(paramiko.Transport)\n", "self.mox.StubOutWithMock(self.driver, '_get_output')\n", "self.mox.StubOutWithMock(chan, 'invoke_shell')\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_6(self, *VAR_17, VAR_18=None):...\n", "VAR_18 = list(VAR_18) if VAR_18 is not None else []\n", "VAR_18.extend(self._get_context(VAR_16) for VAR_16 in VAR_17)\n", "return CLASS_2(self, VAR_18)\n" ]
[ "def include(self, *names, contexts=None):...\n", "contexts = list(contexts) if contexts is not None else []\n", "contexts.extend(self._get_context(name) for name in names)\n", "return ContextView(self, contexts)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_6(self):...\n", "for node in self.G.nodes(1):\n", "for otherNode in self.G.nodes():\n", "if not node == otherNode and not self.G.has_edge(node[0], otherNode[0]\n", "self.G.add_edge(node[0], otherNode[0])\n" ]
[ "def addEdges(self):...\n", "for node in self.G.nodes(1):\n", "for otherNode in self.G.nodes():\n", "if not node == otherNode and not self.G.has_edge(node[0], otherNode[0]\n", "self.G.add_edge(node[0], otherNode[0])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "For", "Condition", "Expr'" ]
[ "def FUNC_0(self, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10, VAR_11, VAR_12,...\n", "\"\"\"docstring\"\"\"\n", "if VAR_13 is None:\n", "VAR_13 = {}\n", "VAR_30 = self.pool.get('budget.line')\n", "VAR_31 = VAR_30.filter_by_items(VAR_5, VAR_6, VAR_9, [VAR_7], VAR_13=context)\n", "VAR_32 = VAR_30.get_analy...
[ "def get_real_values_from_analytic_accounts(self, cr, uid, item_id, periods,...\n", "\"\"\"docstring\"\"\"\n", "if context is None:\n", "context = {}\n", "budget_line_obj = self.pool.get('budget.line')\n", "budget_lines = budget_line_obj.filter_by_items(cr, uid, lines, [item_id],\n context=context)\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 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "R...
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "if not self._home:\n", "VAR_24 = self._get_system_properties(self.java)['java.home']\n", "return self._home\n", "if os.path.basename(VAR_24) == 'jre':\n", "VAR_44 = os.path.dirname(VAR_24)\n", "self._home = VAR_24\n", "if self._is_executable(os.path.join...
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "if not self._home:\n", "home = self._get_system_properties(self.java)['java.home']\n", "return self._home\n", "if os.path.basename(home) == 'jre':\n", "jdk_dir = os.path.dirname(home)\n", "self._home = home\n", "if self._is_executable(os.path.join(jdk_di...
[ 0, 0, 0, 0, 7, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_13(self, VAR_1):...\n", "VAR_25 = datetime.strptime(VAR_1, '%Y-%m-%d')\n", "VAR_26 = VAR_25.replace(VAR_25=28) + timedelta(days=4)\n", "return (VAR_26 - timedelta(days=next_month.day)).day\n" ]
[ "def get_last_day_of_month(self, date):...\n", "day = datetime.strptime(date, '%Y-%m-%d')\n", "next_month = day.replace(day=28) + timedelta(days=4)\n", "return (next_month - timedelta(days=next_month.day)).day\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_11, VAR_8, VAR_12, VAR_13):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_8 is None or VAR_12 is None or VAR_12(VAR_11, VAR_8):\n", "return True\n", "if VAR_13 is not None and VAR_13(VAR_8):\n", "return False\n", "return True\n" ]
[ "def has_read_perm(user, group, is_member, is_private):...\n", "\"\"\"docstring\"\"\"\n", "if group is None or is_member is None or is_member(user, group):\n", "return True\n", "if is_private is not None and is_private(group):\n", "return False\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_16(self, VAR_16, VAR_19):...\n", "\"\"\"docstring\"\"\"\n", "VAR_46 = self.configuration.volume_name_template % VAR_19['id']\n", "VAR_0.error(_('Failed to create clone of volume %s'), VAR_16['name'])\n", "VAR_25 = self._eql_execute('volume', 'select', VAR_46, 'clone', VAR_16['name'])\n", "return...
[ "def create_cloned_volume(self, volume, src_vref):...\n", "\"\"\"docstring\"\"\"\n", "src_volume_name = self.configuration.volume_name_template % src_vref['id']\n", "LOG.error(_('Failed to create clone of volume %s'), volume['name'])\n", "out = self._eql_execute('volume', 'select', src_volume_name, 'clone',...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_18(self):...\n", "VAR_13 = ['Line1 passed', 'Line1 failed']\n", "VAR_14 = ['Line1', 'Line2']\n", "VAR_15 = [' passed', None]\n", "self.assertEqual(self.driver._get_prefixed_value(VAR_13, VAR_14[0]), VAR_15[0])\n", "self.assertEqual(self.driver._get_prefixed_value(VAR_13, VAR_14[1]), VAR_15[1])\n...
[ "def test_get_prefixed_value(self):...\n", "lines = ['Line1 passed', 'Line1 failed']\n", "prefix = ['Line1', 'Line2']\n", "expected_output = [' passed', None]\n", "self.assertEqual(self.driver._get_prefixed_value(lines, prefix[0]),\n expected_output[0])\n", "self.assertEqual(self.driver._get_prefixed_v...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "import os\n", "import vim\n", "import tempfile\n", "import json\n", "import signal\n", "from subprocess import PIPE\n", "from ycm import vimsupport\n", "from ycm import utils\n", "from ycm.diagnostic_interface import DiagnosticInterface\n", "from ycm.completers.all.omni_completer import OmniCompl...
[ "import os\n", "import vim\n", "import tempfile\n", "import json\n", "import signal\n", "from subprocess import PIPE\n", "from ycm import vimsupport\n", "from ycm import utils\n", "from ycm.diagnostic_interface import DiagnosticInterface\n", "from ycm.completers.all.omni_completer import OmniCompl...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'"...
[ "def FUNC_6(self, VAR_11):...\n", "VAR_33 = CLASS_43.run(self, VAR_11)\n", "if VAR_33 is None:\n", "return ''\n", "return VAR_33\n" ]
[ "def run(self, url):...\n", "val = VSanitizedUrl.run(self, url)\n", "if val is None:\n", "return ''\n", "return val\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_1():...\n", "VAR_16 = sqlite3.connect(VAR_5)\n", "VAR_17 = VAR_16.cursor()\n", "VAR_17.execute('SELECT DiscordId, OsuId FROM users')\n", "VAR_18 = VAR_17.fetchall()\n", "for VAR_13 in VAR_18:\n", "FUNC_2(VAR_13[1], VAR_13[0])\n" ]
[ "def refresh_all_pp_stats():...\n", "conn = sqlite3.connect(databasePath)\n", "cursor = conn.cursor()\n", "cursor.execute('SELECT DiscordId, OsuId FROM users')\n", "usersToRefresh = cursor.fetchall()\n", "for user in usersToRefresh:\n", "update_pp_stats(user[1], user[0])\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Expr'" ]
[ "def FUNC_3(self, VAR_3):...\n", "VAR_6 = \"SELECT COUNT(email) FROM members WHERE email = '{email}'\".format(email\n =member)\n", "self.cursor.execute(VAR_6)\n", "VAR_9 = self.cursor.fetchone()\n", "if int(VAR_9[0]) > 0:\n", "return True\n", "return False\n" ]
[ "def verify_email(self, member):...\n", "query = \"SELECT COUNT(email) FROM members WHERE email = '{email}'\".format(email\n =member)\n", "self.cursor.execute(query)\n", "result = self.cursor.fetchone()\n", "if int(result[0]) > 0:\n", "return True\n", "return False\n" ]
[ 0, 4, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_24(VAR_25, VAR_23, *VAR_24):...\n", "if VAR_23 == 'on_after_task':\n", "VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n", "self.assertEqual(False, VAR_50)\n", "self.assertEqual(True, VAR_51)\n", "self.assertEqual({'pool': 'default'}, VAR_5)\n", "self.assertEqual({}, VAR_52)\n" ]
[ "def call_hook(_botobj, name, *args):...\n", "if name == 'on_after_task':\n", "failure, internal_failure, dimensions, summary = args\n", "self.assertEqual(False, failure)\n", "self.assertEqual(True, internal_failure)\n", "self.assertEqual({'pool': 'default'}, dimensions)\n", "self.assertEqual({}, summar...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_3, VAR_4):...\n", "self.name = VAR_3\n", "self.connection = VAR_4\n", "self.cursor = self.connection.cursor()\n" ]
[ "def __init__(self, name, connection):...\n", "self.name = name\n", "self.connection = connection\n", "self.cursor = self.connection.cursor()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'" ]
[ "@contextlib.contextmanager...\n", "if VAR_6 is None:\n", "VAR_6 = self.TIMEOUT\n", "VAR_36, VAR_32 = get_locked_and_waiter()\n", "def FUNC_28(VAR_21):...\n", "if not VAR_25(VAR_21):\n", "return VAR_21, False\n", "VAR_36.release()\n", "return VAR_21, True\n" ]
[ "@contextlib.contextmanager...\n", "if timeout is None:\n", "timeout = self.TIMEOUT\n", "lock, wait = get_locked_and_waiter()\n", "def handler(msg):...\n", "if not match(msg):\n", "return msg, False\n", "lock.release()\n", "return msg, True\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Assign'", "FunctionDef'", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_8():...\n", "for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n", "create_test_db()\n", "os.rename(filename, 'temp_' + filename)\n", "for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n", "os.rename('test_' + filename, filename)\n" ]
[ "def setUpClass():...\n", "for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n", "create_test_db()\n", "os.rename(filename, 'temp_' + filename)\n", "for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n", "os.rename('test_' + filename, filename)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'", "For", "Expr'" ]
[ "def __eq__(self, VAR_11):...\n", "if VAR_11 is None:\n", "return False\n", "return self.rule == VAR_11.rule and (self.dynamic_output or self.\n wildcards_dict == VAR_11.wildcards_dict)\n" ]
[ "def __eq__(self, other):...\n", "if other is None:\n", "return False\n", "return self.rule == other.rule and (self.dynamic_output or self.\n wildcards_dict == other.wildcards_dict)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "@frappe.whitelist()...\n", "\"\"\"docstring\"\"\"\n", "VAR_3.pop('cmd', None)\n", "return CLASS_0(VAR_0).execute(None, *VAR_2, **kwargs)\n" ]
[ "@frappe.whitelist()...\n", "\"\"\"docstring\"\"\"\n", "kwargs.pop('cmd', None)\n", "return DatabaseQuery(doctype).execute(None, *args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Return'" ]
[ "def FUNC_20(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_34 = []\n", "for value in self.iscsi_ips.values():\n", "VAR_34.append(value['nsp'])\n", "return VAR_34\n" ]
[ "def _get_iscsi_nsps(self):...\n", "\"\"\"docstring\"\"\"\n", "nsps = []\n", "for value in self.iscsi_ips.values():\n", "nsps.append(value['nsp'])\n", "return nsps\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_5(VAR_5, VAR_6, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = {}\n", "if 'title' in VAR_8:\n", "VAR_12['title'] = VAR_8['title']\n", "if 'description' in VAR_8:\n", "VAR_12['description'] = VAR_8['description']\n", "VAR_13 = ', '.join(map(lambda kv: f'{kv[0]} = \"{kv[1]}\"', VAR_12.ite...
[ "def update_issue(cursor, id, fields):...\n", "\"\"\"docstring\"\"\"\n", "updated_fields = {}\n", "if 'title' in fields:\n", "updated_fields['title'] = fields['title']\n", "if 'description' in fields:\n", "updated_fields['description'] = fields['description']\n", "set_clause_args = ', '.join(map(lambd...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 0, 4 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "For", "Expr'" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed('string')\n" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed(\n 'While following the guide, after installing boot9strap, if you get an error that says \"Failed to mount CTRNAND\", just continue on with the guide.'\n )\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "def FUNC_4():...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(VAR_1):\n", "os.makedirs(VAR_1)\n", "if exc.errno != errno.EEXIST:\n" ]
[ "def goals_dir_check():...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(GOALS_CONFIG_FOLDER_PATH):\n", "os.makedirs(GOALS_CONFIG_FOLDER_PATH)\n", "if exc.errno != errno.EEXIST:\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Condition" ]
[ "@wraps(VAR_7)...\n", "if VAR_12:\n", "return VAR_7(VAR_8[0], VAR_1, *VAR_8[1:], **kwargs)\n", "return VAR_7(VAR_1, *VAR_8, **kwargs)\n" ]
[ "@wraps(f)...\n", "if with_response:\n", "return f(args[0], remote, *args[1:], **kwargs)\n", "return f(remote, *args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_20(VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = os.path.normpath(VAR_8)\n", "VAR_33 = re.search('{[^{]', VAR_8)\n", "VAR_34 = os.path.dirname(VAR_8[:VAR_33.start()]\n ) if VAR_33 else os.path.dirname(VAR_8)\n", "if not VAR_34:\n", "VAR_34 = '.'\n", "VAR_35 = [VAR_29.group('name') fo...
[ "def glob_wildcards(pattern):...\n", "\"\"\"docstring\"\"\"\n", "pattern = os.path.normpath(pattern)\n", "first_wildcard = re.search('{[^{]', pattern)\n", "dirname = os.path.dirname(pattern[:first_wildcard.start()]\n ) if first_wildcard else os.path.dirname(pattern)\n", "if not dirname:\n", "dirname ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "For", "Return'", "Condition", "Assign'", "Assign'", "Condition", "For", "Expr'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if VAR_0 is None:\n", "return True\n", "return shutil.which(VAR_0) is not None\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if executable is None:\n", "return True\n", "return shutil.which(executable) is not None\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Return'", "Return'" ]
[ "def FUNC_16(self):...\n", "return log_check_output(['git', 'status', '--porcelain']) != b''\n" ]
[ "def has_local_edit(self):...\n", "return log_check_output(['git', 'status', '--porcelain']) != b''\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(self, VAR_10):...\n", "if VAR_10:\n", "return 'TRUE'\n", "return 'FALSE'\n" ]
[ "def sqlForNonNone(self, value):...\n", "if value:\n", "return 'TRUE'\n", "return 'FALSE'\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_3(self):...\n", "for VAR_5 in self.groups:\n", "self.add_group(VAR_5)\n" ]
[ "def populate_ancestors(self):...\n", "for group in self.groups:\n", "self.add_group(group)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_39(self):...\n", "" ]
[ "def _update_case_status(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4='en-US'):...\n", "self.chat_id = VAR_0\n", "self.first_name = VAR_1\n", "self.nickname = VAR_2\n", "self.last_name = VAR_3\n", "self.language = VAR_4\n" ]
[ "def __init__(self, chat_id, first_name, nickname, last_name, language='en-US'):...\n", "self.chat_id = chat_id\n", "self.first_name = first_name\n", "self.nickname = nickname\n", "self.last_name = last_name\n", "self.language = language\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def __str__(self):...\n", "VAR_10 = 'Serial Port: ' + self.serial.port + '\\n\\tTimeout: ' + str(self.\n serial.timeout) + \"\"\" seconds\n\tPrompt: \\\"\"\"\" + self.prompt + '\"'\n", "VAR_10 += '\\n\\tIP Address: ' + self.ip_address\n", "VAR_10 += '\\n\\tSCP Port: ' + str(self.options.dut_scp_port if no...
[ "def __str__(self):...\n", "string = 'Serial Port: ' + self.serial.port + '\\n\\tTimeout: ' + str(self.\n serial.timeout) + \"\"\" seconds\n\tPrompt: \\\"\"\"\" + self.prompt + '\"'\n", "string += '\\n\\tIP Address: ' + self.ip_address\n", "string += '\\n\\tSCP Port: ' + str(self.options.dut_scp_port if no...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "AugAssign'", "AugAssign'", "Return'" ]
[ "@FUNC_0...\n", "VAR_14 = await database.select_tags(VAR_3)\n", "VAR_15 = '\\n\\t'.join(\n f'<input type=\"checkbox\" name=\"tag\" value=\"{ID}\"> {label}<br>' for ID,\n label in VAR_14)\n", "return VAR_4.format(VAR_14=tag_checkboxes)\n" ]
[ "@handle_html...\n", "tags = await database.select_tags(request)\n", "tag_checkboxes = '\\n\\t'.join(\n f'<input type=\"checkbox\" name=\"tag\" value=\"{ID}\"> {label}<br>' for ID,\n label in tags)\n", "return base.format(tags=tag_checkboxes)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_8(self, VAR_7):...\n", "return self._job_percent[VAR_7]\n" ]
[ "def copy_percent(self, job_id):...\n", "return self._job_percent[job_id]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "return os.path.exists(os.path.join(VAR_0, '__init__.py'))\n" ]
[ "def _is_package(directory):...\n", "return os.path.exists(os.path.join(directory, '__init__.py'))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self):...\n", "os_ext.rmtree(rt.runtime().resources.prefix)\n" ]
[ "def tearDown(self):...\n", "os_ext.rmtree(rt.runtime().resources.prefix)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_6(self, VAR_11, VAR_10, VAR_12):...\n", "self.current = Current(VAR_11=session, VAR_23=data)\n", "self.current.headers = VAR_12\n", "VAR_14 = get_object_from_path(settings.BG_JOBS[VAR_10['job']])\n", "VAR_14(self.current)\n" ]
[ "def _handle_job(self, session, data, headers):...\n", "self.current = Current(session=session, input=data)\n", "self.current.headers = headers\n", "method = get_object_from_path(settings.BG_JOBS[data['job']])\n", "method(self.current)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_45 = UserRole[VAR_18.upper()]\n", "VAR_36 = CLASS_1.get_user_by_id(VAR_17)\n", "VAR_37 = UserRole(VAR_36.role)\n", "if VAR_37 == UserRole.PROJECT_MANAGER and VAR_45 == UserRole.ADMIN:\n", "if VAR_37 == UserRole.PROJECT_MANAGER and VAR_45 == UserRole....
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "requested_role = UserRole[role.upper()]\n", "admin = UserService.get_user_by_id(admin_user_id)\n", "admin_role = UserRole(admin.role)\n", "if admin_role == UserRole.PROJECT_MANAGER and requested_role == UserRole.ADMIN:\n", "if admin_role == UserRole.PROJ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_0(self, VAR_0):...\n", "return VAR_0.id\n" ]
[ "def to_representation(self, obj):...\n", "return obj.id\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_12():...\n", "VAR_18 = requests.get(FUNC_2('healthy'))\n", "VAR_18.raise_for_status()\n", "return VAR_18.json()\n" ]
[ "def _ServerIsHealthy():...\n", "response = requests.get(_BuildUri('healthy'))\n", "response.raise_for_status()\n", "return response.json()\n" ]
[ 0, 7, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_14(self, VAR_23, VAR_24=0, VAR_25='***', VAR_7={}):...\n", "return VAR_25 + ' ' + (VAR_23.user_id and VAR_23.user_id.name.upper() or ''\n ) + (VAR_24 and ': L' + str(VAR_24) or '') + ' - %.1fh / %.1fh' % (\n VAR_23.effective_hours or 0.0, VAR_23.planned_hours\n ) + ' ' + VAR_25 + '\\n' + VAR_25...
[ "def _str_get(self, task, level=0, border='***', context={}):...\n", "return border + ' ' + (task.user_id and task.user_id.name.upper() or '') + (\n level and ': L' + str(level) or '') + ' - %.1fh / %.1fh' % (task.\n effective_hours or 0.0, task.planned_hours) + ' ' + border + '\\n' + border[\n 0] + ' ' ...
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_18(self):...\n", "super(CLASS_3, self).setUp()\n", "VAR_19 = Blueprint('testing', __name__)\n", "@VAR_19.route('/test')...\n", "return 'OK'\n" ]
[ "def setUp(self):...\n", "super(NoAuthnAPITestCase, self).setUp()\n", "test_views = Blueprint('testing', __name__)\n", "@test_views.route('/test')...\n", "return 'OK'\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_3(self):...\n", "self._check_key(VAR_1)\n" ]
[ "def test_ecdsa_key(self):...\n", "self._check_key(ECDSA_PUBKEY)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_10(self, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = VAR_9.args.get('csessid')[0]\n", "self.last_alive[VAR_8] = time.time(), False\n", "VAR_23 = self.databuffer.get(VAR_8, [])\n", "if VAR_23:\n", "return VAR_23.pop(0)\n", "VAR_9.notifyFinish().addErrback(self._responseFailed, VAR_8, V...
[ "def mode_receive(self, request):...\n", "\"\"\"docstring\"\"\"\n", "csessid = request.args.get('csessid')[0]\n", "self.last_alive[csessid] = time.time(), False\n", "dataentries = self.databuffer.get(csessid, [])\n", "if dataentries:\n", "return dataentries.pop(0)\n", "request.notifyFinish().addErrbac...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Expr'", "Condition", "Expr'", "Assign'", "Return'" ]
[ "from gi.repository import Gio, Gdk, Gtk\n", "from keepassgtk.logging_manager import LoggingManager\n", "from keepassgtk.database_manager import DatabaseManager\n", "from keepassgtk.create_database import CreateDatabase\n", "from keepassgtk.container_page import ContainerPage\n", "from keepassgtk.unlock_d...
[ "from gi.repository import Gio, Gdk, Gtk\n", "from keepassgtk.logging_manager import LoggingManager\n", "from keepassgtk.database_manager import DatabaseManager\n", "from keepassgtk.create_database import CreateDatabase\n", "from keepassgtk.container_page import ContainerPage\n", "from keepassgtk.unlock_d...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "Import'", "ImportFrom'", "Import'", "Import'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assig...
[ "def FUNC_1(self, VAR_11):...\n", "return 'jsonb'\n" ]
[ "def db_type(self, connection):...\n", "return 'jsonb'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __getitem__(self, VAR_9):...\n", "return self._get_item(self.factory, VAR_9, self.object_name)\n" ]
[ "def __getitem__(self, key):...\n", "return self._get_item(self.factory, key, self.object_name)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self, VAR_13):...\n", "VAR_31 = get_uniformed_tracker_url(VAR_13)\n", "if VAR_31:\n", "VAR_39 = VAR_0.TrackerState.get(url=sanitized_url) or VAR_0.TrackerState(url\n =sanitized_url)\n", "self.health.trackers.add(VAR_39)\n" ]
[ "def add_tracker(self, tracker_url):...\n", "sanitized_url = get_uniformed_tracker_url(tracker_url)\n", "if sanitized_url:\n", "tracker = db.TrackerState.get(url=sanitized_url) or db.TrackerState(url=\n sanitized_url)\n", "self.health.trackers.add(tracker)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "@inlineCallbacks...\n", "VAR_2 = self.database.generate_insert(self)\n", "if self.return_id:\n", "VAR_3 = yield self.database.runQuery(VAR_2)\n", "yield self.database.runOperation(VAR_2)\n", "if VAR_3 and self.model_class._meta.primary_key:\n", "returnValue(None)\n", "returnValue(VAR_3[0][0])\n" ]
[ "@inlineCallbacks...\n", "query = self.database.generate_insert(self)\n", "if self.return_id:\n", "result = yield self.database.runQuery(query)\n", "yield self.database.runOperation(query)\n", "if result and self.model_class._meta.primary_key:\n", "returnValue(None)\n", "returnValue(result[0][0])\n" ]
[ 0, 4, 0, 4, 4, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n", "VAR_7 = []\n", "VAR_8 = self.pool.get('ir.model.data')\n", "VAR_9 = self.pool.get('account.bank.statement')\n", "VAR_10 = self.pool.get('acc...
[ "def close_statement(self, cr, uid, ids, context):...\n", "\"\"\"docstring\"\"\"\n", "company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n", "list_statement = []\n", "mod_obj = self.pool.get('ir.model.data')\n", "statement_obj = self.pool.get('account.bank.statement')\n", "journa...
[ 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 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "...
[ "def FUNC_1(self):...\n", "VAR_2 = self.connect()\n", "VAR_3 = 'SELECT description FROM crimes;'\n", "VAR_2.close()\n", "cursor.execute(VAR_3)\n", "return cursor.fetchall()\n" ]
[ "def get_all_inputs(self):...\n", "connection = self.connect()\n", "query = 'SELECT description FROM crimes;'\n", "connection.close()\n", "cursor.execute(query)\n", "return cursor.fetchall()\n" ]
[ 0, 0, 0, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "from django import template\n", "from django.core.urlresolvers import reverse\n", "from exercise.templatetags.exercise import _prepare_context\n", "from ..grade import assign_grade\n", "from ..models import CourseDiplomaDesign\n", "VAR_0 = template.Library()\n", "@VAR_0.inclusion_tag('diploma/_diploma_...
[ "from django import template\n", "from django.core.urlresolvers import reverse\n", "from exercise.templatetags.exercise import _prepare_context\n", "from ..grade import assign_grade\n", "from ..models import CourseDiplomaDesign\n", "register = template.Library()\n", "@register.inclusion_tag('diploma/_di...
[ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "return gate.new_agent(VAR_1)\n" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "return gate.new_agent(bindings)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_11(self, VAR_14):...\n", "" ]
[ "def is_integer(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_4(VAR_0):...\n", "VAR_8 = {'disabled': 0, 'is_stock_item': 1}\n", "if VAR_0.get('item_group'):\n", "VAR_8.update({'item_group': VAR_0['item_group']})\n", "if VAR_0.get('item'):\n", "VAR_8.update({'name': VAR_0['item']})\n", "VAR_3 = frappe.get_all('Item', fields=['name', 'item_group', 'item_na...
[ "def get_items(filters):...\n", "filters_dict = {'disabled': 0, 'is_stock_item': 1}\n", "if filters.get('item_group'):\n", "filters_dict.update({'item_group': filters['item_group']})\n", "if filters.get('item'):\n", "filters_dict.update({'name': filters['item']})\n", "items = frappe.get_all('Item', fiel...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._name\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._name\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "@wraps(VAR_7)...\n", "if VAR_12:\n", "return VAR_7(VAR_8[0], VAR_1, *VAR_8[1:], **kwargs)\n", "return VAR_7(VAR_1, *VAR_8, **kwargs)\n" ]
[ "@wraps(f)...\n", "if with_response:\n", "return f(args[0], remote, *args[1:], **kwargs)\n", "return f(remote, *args, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_12(self, *VAR_9, **VAR_10):...\n", "self.render('app.html', VAR_2={})\n" ]
[ "def get(self, *a, **kwargs):...\n", "self.render('app.html', page_json={})\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_26(self):...\n", "if self._IsServerAlive():\n", "VAR_23 = BaseRequest.PostDataToHandler(BuildRequestData(), 'debug_info')\n", "VAR_23 = 'Server crashed, no debug info from server'\n", "VAR_23 += \"\"\"\nServer running at: {0}\"\"\".format(BaseRequest.server_location)\n", "VAR_23 += \"\"\"\nServe...
[ "def DebugInfo(self):...\n", "if self._IsServerAlive():\n", "debug_info = BaseRequest.PostDataToHandler(BuildRequestData(), 'debug_info')\n", "debug_info = 'Server crashed, no debug info from server'\n", "debug_info += \"\"\"\nServer running at: {0}\"\"\".format(BaseRequest.server_location)\n", "debug_inf...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "AugAssign'", "AugAssign'", "Condition", "AugAssign'", "Return'" ]
[ "def FUNC_0():...\n", "VAR_3 = sublime.load_settings('urtext-default.sublime-settings')\n", "VAR_4 = VAR_3.get('meta_separator')\n", "return VAR_4\n" ]
[ "def meta_separator():...\n", "settings = sublime.load_settings('urtext-default.sublime-settings')\n", "meta_separator = settings.get('meta_separator')\n", "return meta_separator\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_9(self, *VAR_15, **VAR_75):...\n", "" ]
[ "def newfn(self, *a, **env):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_6(self, VAR_72):...\n", "VAR_92 = set(self.separator.findall(VAR_72) if VAR_72 else [])\n", "VAR_93 = set(VAR_17 for VAR_17 in VAR_92 if not self.email_re.match(VAR_17))\n", "VAR_92 = VAR_92 - VAR_93\n", "if self.num > 0 and len(VAR_92) + len(VAR_93) > self.num:\n", "if self.num == 1:\n", "if ...
[ "def run(self, emails0):...\n", "emails = set(self.separator.findall(emails0) if emails0 else [])\n", "failures = set(e for e in emails if not self.email_re.match(e))\n", "emails = emails - failures\n", "if self.num > 0 and len(emails) + len(failures) > self.num:\n", "if self.num == 1:\n", "if failures:...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Condition", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Return'" ]
[ "import sqlite3\n", "def __init__(self, VAR_0):...\n", "self.cursor = VAR_0\n", "self.rides = []\n", "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 FUNC_1(self, VAR_2):...\n", "VAR_7 = self.r...
[ "import sqlite3\n", "def __init__(self, cursor):...\n", "self.cursor = cursor\n", "self.rides = []\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, booki...
[ 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Expr'", "Assign'", "FunctionDef'", "Assign'", "For", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "FunctionDef'", "Expr'", "Assign'", "Expr'", "Assign...
[ "def FUNC_0(VAR_0):...\n", "VAR_1 = sqlite3.connect('app.db')\n", "VAR_2 = VAR_1.execute('select * from {} order by timestamp desc'.format(VAR_0))\n", "VAR_3 = [column[0] for column in VAR_2.description]\n", "VAR_4 = []\n", "for row in VAR_2.fetchall():\n", "VAR_4.append(dict(zip(VAR_3, row)))\n", "re...
[ "def get_table_dict(table):...\n", "database = sqlite3.connect('app.db')\n", "cur = database.execute('select * from {} order by timestamp desc'.format(table)\n )\n", "columns = [column[0] for column in cur.description]\n", "results = []\n", "for row in cur.fetchall():\n", "results.append(dict(zip(col...
[ 0, 4, 4, 4, 4, 4, 4, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_56 = not os.path.exists(CLASS_0.db_path)\n", "self.con = sqlite3.connect(CLASS_0.db_path)\n", "self.con.row_factory = FUNC_1\n", "self.c = self.con.cursor()\n", "if VAR_56:\n", "self.create_history_db()\n", "if not CLASS_0.done_cleaning:\n", ...
[ "def connect(self):...\n", "\"\"\"docstring\"\"\"\n", "create_table = not os.path.exists(HistoryDB.db_path)\n", "self.con = sqlite3.connect(HistoryDB.db_path)\n", "self.con.row_factory = dict_factory\n", "self.c = self.con.cursor()\n", "if create_table:\n", "self.create_history_db()\n", "if not Hist...
[ 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", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Assign'" ]