lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(self, VAR_8, VAR_9):...\n",
"return self._exec_cmd(' '.join((self.adb_str, VAR_8, VAR_9)))\n"
] | [
"def _exec_adb_cmd(self, name, arg_str):...\n",
"return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))\n"
] | [
0,
2
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"VAR_14 = 'CREATE TABLE IF NOT EXISTS DPNET(why_mySQL int)'\n",
"self.cursor.execute(VAR_14)\n",
"self.connection.commit()\n"
] | [
"def create_junk_table(self):...\n",
"query = 'CREATE TABLE IF NOT EXISTS DPNET(why_mySQL int)'\n",
"self.cursor.execute(query)\n",
"self.connection.commit()\n"
] | [
0,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_20():...\n",
"\"\"\"docstring\"\"\"\n",
"assert sys.platform == 'linux' or sys.platform == 'linux2'\n",
"VAR_48 = VAR_40.open('/dev/shm', VAR_40.O_RDONLY)\n",
"VAR_56 = VAR_40.fstatvfs(VAR_48)\n",
"VAR_40.close(VAR_48)\n",
"return VAR_57\n",
"VAR_57 = VAR_56.f_bsize * VAR_56.f_bavail\n"
] | [
"def get_shared_memory_bytes():...\n",
"\"\"\"docstring\"\"\"\n",
"assert sys.platform == 'linux' or sys.platform == 'linux2'\n",
"shm_fd = os.open('/dev/shm', os.O_RDONLY)\n",
"shm_fs_stats = os.fstatvfs(shm_fd)\n",
"os.close(shm_fd)\n",
"return shm_avail\n",
"shm_avail = shm_fs_stats.f_bsize * shm_f... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assert'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'"
] |
[
"def __init__(self, VAR_0):...\n",
"self.doctype = VAR_0\n",
"self.tables = []\n",
"self.conditions = []\n",
"self.or_conditions = []\n",
"self.fields = None\n",
"self.user = None\n",
"self.ignore_ifnull = False\n",
"self.flags = frappe._dict()\n"
] | [
"def __init__(self, doctype):...\n",
"self.doctype = doctype\n",
"self.tables = []\n",
"self.conditions = []\n",
"self.or_conditions = []\n",
"self.fields = None\n",
"self.user = None\n",
"self.ignore_ifnull = False\n",
"self.flags = frappe._dict()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"\"\"\"Unittest to exercise the code in url_helper.py.\"\"\"\n",
"import logging\n",
"import os\n",
"import stat\n",
"import StringIO\n",
"import sys\n",
"import tempfile\n",
"import time\n",
"import unittest\n",
"import urllib\n",
"import urllib2\n",
"VAR_0 = os.path.dirname(os.path.dirname(o... | [
"\"\"\"Unittest to exercise the code in url_helper.py.\"\"\"\n",
"import logging\n",
"import os\n",
"import stat\n",
"import StringIO\n",
"import sys\n",
"import tempfile\n",
"import time\n",
"import unittest\n",
"import urllib\n",
"import urllib2\n",
"ROOT_DIR = os.path.dirname(os.path.dirnam... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
5,
0,
0... | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Expr'",
"Import'",
"Expr'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr... |
[
"def FUNC_11(VAR_9):...\n",
"@functools.wraps(VAR_9)...\n",
"VAR_19 = {'$schema': 'http://json-schema.org/draft-07/schema#',\n 'definitions': {'tag': {'type': 'object', 'required': ['namespace',\n 'predicate', 'value'], 'properties': {'namespace': {'type': 'string'},\n 'predicate': {'type': 'string'}, ... | [
"def decorator(func):...\n",
"@functools.wraps(func)...\n",
"request_schema = {'$schema': 'http://json-schema.org/draft-07/schema#',\n 'definitions': {'tag': {'type': 'object', 'required': ['namespace',\n 'predicate', 'value'], 'properties': {'namespace': {'type': 'string'},\n 'predicate': {'type': 'st... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_13(self, VAR_9):...\n",
"super().run_validators(VAR_9)\n",
"for VAR_18, part in enumerate(VAR_9):\n",
"self.base_field.run_validators(part)\n"
] | [
"def run_validators(self, value):...\n",
"super().run_validators(value)\n",
"for index, part in enumerate(value):\n",
"self.base_field.run_validators(part)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Expr'"
] |
[
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"await self.simple_embed('string', VAR_3=discord.Color(39623))\n"
] | [
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"await self.simple_embed(\n \"A failed update in Download Management does not mean there is an update and the system is trying to download it. This means your blocking method (DNS etc.) is working and the system can't check for an update.\"\n , color=... | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"VAR_1 = self.client.get(reverse('ajax-form'), {'app_form':\n 'testcases.CaseAutomatedForm'})\n",
"VAR_6 = CaseAutomatedForm()\n",
"self.assertHTMLEqual(str(VAR_1.content, encoding=settings.DEFAULT_CHARSET),\n VAR_6.as_p())\n"
] | [
"def test_get_form(self):...\n",
"response = self.client.get(reverse('ajax-form'), {'app_form':\n 'testcases.CaseAutomatedForm'})\n",
"form = CaseAutomatedForm()\n",
"self.assertHTMLEqual(str(response.content, encoding=settings.\n DEFAULT_CHARSET), form.as_p())\n"
] | [
0,
7,
7,
7
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_5, VAR_6, VAR_15, VAR_10, VAR_13=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_13 is None:\n",
"VAR_13 = {}\n",
"VAR_49 = self.get_sub_items(VAR_5, VAR_15)\n",
"VAR_50 = self.browse(VAR_5, VAR_6, VAR_49, VAR_13=context)\n",
"VAR_20 = []\n",
"for subitem in VAR_50:\n",
"VAR_2... | [
"def get_accounts(self, cr, uid, item_ids, company_id, context=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if context is None:\n",
"context = {}\n",
"sub_items_ids = self.get_sub_items(cr, item_ids)\n",
"sub_items = self.browse(cr, uid, sub_items_ids, context=context)\n",
"ids = []\n",
"for subitem in s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __len__(self):...\n",
"return 0\n"
] | [
"def __len__(self):...\n",
"return 0\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_1 = sqlite3.connect('database.db')\n",
"VAR_2 = VAR_1.cursor()\n",
"VAR_3 = set()\n",
"for row in VAR_2.execute(\n",
"for val in row:\n",
"VAR_4 = [name for name in VAR_3]\n",
"if val is not '':\n",
"VAR_5 = [[name, 0, 0, 0] for name in VAR_4]\n",
"for author in val... | [
"def getRankingsFromDatabase(submission):...\n",
"database = sqlite3.connect('database.db')\n",
"cursor = database.cursor()\n",
"nameSet = set()\n",
"for row in cursor.execute(\n",
"for val in row:\n",
"nameList = [name for name in nameSet]\n",
"if val is not '':\n",
"table = [[name, 0, 0, 0] for na... | [
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Assign'",
"Condition",
"Assign'",
"For",
"For",
"Expr'",
"For",
"Expr'",
"For",
"Expr'",
"Condition",
"Return'",
"For",
"AugAssign'"
] |
[
"def FUNC_10(VAR_9, VAR_8):...\n",
"VAR_21 = FUNC_1('main', 'log_path')\n",
"VAR_39 = ''\n",
"VAR_40 = FUNC_2('date_in_log')\n",
"VAR_15 = '/bin/diff -ub %s %s' % (VAR_9, VAR_8)\n",
"VAR_41, VAR_42 = FUNC_24(VAR_15)\n",
"for line in VAR_41:\n",
"VAR_39 += VAR_40 + ' ' + line + '\\n'\n",
"VAR_68 = op... | [
"def diff_config(oldcfg, cfg):...\n",
"log_path = get_config_var('main', 'log_path')\n",
"diff = ''\n",
"date = get_data('date_in_log')\n",
"cmd = '/bin/diff -ub %s %s' % (oldcfg, cfg)\n",
"output, stderr = subprocess_execute(cmd)\n",
"for line in output:\n",
"diff += date + ' ' + line + '\\n'\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_8):...\n",
"VAR_12 = Client()\n",
"self.response = VAR_12.get(reverse('profile-redirect', args=[username]))\n",
"return self\n"
] | [
"def when_call_profile_redirect(self, username):...\n",
"client = Client()\n",
"self.response = client.get(reverse('profile-redirect', args=[username]))\n",
"return self\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_13, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = self.output_regex\n",
"if isinstance(VAR_27, str):\n",
"VAR_27 = VAR_27 % {'file_name': VAR_11}\n",
"for VAR_14 in re.finditer(VAR_27, ''.join(VAR_13)):\n",
"yield self.match_to_result(VAR_14, VAR_11)\n"
] | [
"def _process_issues(self, output, filename):...\n",
"\"\"\"docstring\"\"\"\n",
"regex = self.output_regex\n",
"if isinstance(regex, str):\n",
"regex = regex % {'file_name': filename}\n",
"for match in re.finditer(regex, ''.join(output)):\n",
"yield self.match_to_result(match, filename)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_2(VAR_0, VAR_1):...\n",
"VAR_9 = get_object_or_404(Hunt, id=pk)\n",
"VAR_9.stop()\n",
"if VAR_9.notice == True:\n",
"VAR_9.setNoticeFalse()\n",
"VAR_9.setNoticeTrue()\n",
"VAR_9.start()\n",
"return redirect('twitter_hunter:index')\n"
] | [
"def hunt_switch_notice(request, pk):...\n",
"hunt = get_object_or_404(Hunt, id=pk)\n",
"hunt.stop()\n",
"if hunt.notice == True:\n",
"hunt.setNoticeFalse()\n",
"hunt.setNoticeTrue()\n",
"hunt.start()\n",
"return redirect('twitter_hunter:index')\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_5(VAR_7):...\n",
"VAR_18 = []\n",
"for r in VAR_7:\n",
"VAR_18.append(FUNC_6(r))\n",
"return VAR_18\n"
] | [
"def rows2list(rows):...\n",
"rlist = []\n",
"for r in rows:\n",
"rlist.append(row2dict(r))\n",
"return rlist\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"@VAR_2.route('/bad_losses')...\n",
"if VAR_0 == None:\n",
"FUNC_16()\n",
"VAR_5 = request.args.get('tag', default=None)\n",
"VAR_19 = request.args.get('date', default=None)\n",
"VAR_14 = request.args.get('scene', default=None)\n",
"if VAR_5 and VAR_19:\n",
"VAR_38 = 'select ranks.player, ranks.rank, ... | [
"@endpoints.route('/bad_losses')...\n",
"if db == None:\n",
"init()\n",
"tag = request.args.get('tag', default=None)\n",
"date = request.args.get('date', default=None)\n",
"scene = request.args.get('scene', default=None)\n",
"if tag and date:\n",
"select = 'select ranks.player, ranks.rank, matches.dat... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_2):...\n",
"VAR_5 = VAR_2.from_dict({'infohash': random_infohash(), 'title': 'test',\n 'tags': '', 'size': 1234, 'status': NEW})\n",
"VAR_5.sign()\n"
] | [
"def add_random_torrent(self, metadata_cls):...\n",
"torrent_metadata = metadata_cls.from_dict({'infohash': random_infohash(),\n 'title': 'test', 'tags': '', 'size': 1234, 'status': NEW})\n",
"torrent_metadata.sign()\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@functools.wraps(VAR_0)...\n",
"\"\"\"docstring\"\"\"\n",
"if hasattr(VAR_9, 'interaction'):\n",
"VAR_28 = map(lambda pp: pp.principal.id, VAR_9.interaction.participations)\n",
"VAR_28 = []\n",
"if hasattr(self, 'logFile'):\n",
"VAR_29 = '%s %s - %s \"%s\" %d %s \"%s\" \"%s\"\\n' % (VAR_9.getClientIP()... | [
"@functools.wraps(f)...\n",
"\"\"\"docstring\"\"\"\n",
"if hasattr(request, 'interaction'):\n",
"principals = map(lambda pp: pp.principal.id, request.interaction.participations\n )\n",
"principals = []\n",
"if hasattr(self, 'logFile'):\n",
"line = '%s %s - %s \"%s\" %d %s \"%s\" \"%s\"\\n' % (request... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"@defer.inlineCallbacks...\n",
"yield self._services_factory.create_services_from(VAR_13)\n",
"if VAR_13.fresh_account:\n",
"yield add_welcome_mail(VAR_13.mail_store)\n"
] | [
"@defer.inlineCallbacks...\n",
"yield self._services_factory.create_services_from(leap_session)\n",
"if leap_session.fresh_account:\n",
"yield add_welcome_mail(leap_session.mail_store)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_22(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.name:\n",
"set_new_name(self)\n",
"if not self.creation:\n",
"self.creation = self.modified = now()\n",
"VAR_6 = self.get_valid_dict(VAR_13=True)\n",
"self.created_by = self.modifield_by = VAR_54.session.user\n",
"VAR_33 = list(VAR_6... | [
"def db_insert(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.name:\n",
"set_new_name(self)\n",
"if not self.creation:\n",
"self.creation = self.modified = now()\n",
"d = self.get_valid_dict(convert_dates_to_str=True)\n",
"self.created_by = self.modifield_by = frappe.session.user\n",
"columns... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_3, VAR_4):...\n",
"self.tok = VAR_3\n",
"self.txt = VAR_4\n"
] | [
"def __init__(self, tok, txt):...\n",
"self.tok = tok\n",
"self.txt = txt\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"@wraps(VAR_7)...\n",
"if not app.config.get('USE_AUTH'):\n",
"return VAR_7(*VAR_9, **kwargs)\n",
"if g.auth_type == 'kms':\n",
"return VAR_7(*VAR_9, **kwargs)\n",
"if VAR_1.check_csrf_token():\n",
"return VAR_7(*VAR_9, **kwargs)\n",
"return abort(401)\n"
] | [
"@wraps(f)...\n",
"if not app.config.get('USE_AUTH'):\n",
"return f(*args, **kwargs)\n",
"if g.auth_type == 'kms':\n",
"return f(*args, **kwargs)\n",
"if user_mod.check_csrf_token():\n",
"return f(*args, **kwargs)\n",
"return abort(401)\n"
] | [
0,
0,
5,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2():...\n",
"super(CLASS_6, self).__init__(slideParser.parse(VAR_10, slideLexer))\n"
] | [
"def innerFunc():...\n",
"super(Emph, self).__init__(slideParser.parse(txt, slideLexer))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = reqparse.RequestParser()\n",
"VAR_2.add_argument('building_id')\n",
"VAR_3 = VAR_2.parse_args()\n",
"VAR_4 = 'WHERE building_id = %s' if VAR_3['building_id'] else ''\n",
"VAR_5 = f'SELECT * FROM spaces {VAR_4}'\n",
"VAR_6 = VAR_3['building_... | [
"def get(self):...\n",
"\"\"\"docstring\"\"\"\n",
"parser = reqparse.RequestParser()\n",
"parser.add_argument('building_id')\n",
"args = parser.parse_args()\n",
"where_query = 'WHERE building_id = %s' if args['building_id'] else ''\n",
"query = f'SELECT * FROM spaces {where_query}'\n",
"parameters = a... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_13):...\n",
"self.log_func('auth', VAR_13)\n"
] | [
"def log(self, msg):...\n",
"self.log_func('auth', msg)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"Log.add('Calculating shortest paths in higher-order network (k = ' + str(\n self.order) + ') ...', Severity.INFO)\n",
"VAR_16 = _co.defaultdict(lambda : _co.defaultdict(lambda : _np.inf))\n",
"VAR_17 = _co.defaultdict(lambda : _co.defaultdict(lambda :... | [
"def getShortestPaths(self):...\n",
"\"\"\"docstring\"\"\"\n",
"Log.add('Calculating shortest paths in higher-order network (k = ' + str(\n self.order) + ') ...', Severity.INFO)\n",
"dist = _co.defaultdict(lambda : _co.defaultdict(lambda : _np.inf))\n",
"shortest_paths = _co.defaultdict(lambda : _co.defa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Expr'",
"For",
"For",
"Condition",
"Assign'",
"Expr'",
"For",
"Expr'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"For",
"For",
"For",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_5 = [{'application': self.TEST_APP, 'stack': self.TEST_STACK,\n 'credentials': self.bindings['GCE_CREDENTIALS'], 'loadBalancers': [self\n .__lb_name], 'targetSize': 1, 'capacity': {'min': 1, 'max': 1,\n 'desired': 1}, 'zone': self.TEST_ZONE, 'network': 'default',\n 'inst... | [
"def clone_server_group(self):...\n",
"job = [{'application': self.TEST_APP, 'stack': self.TEST_STACK,\n 'credentials': self.bindings['GCE_CREDENTIALS'], 'loadBalancers': [self\n .__lb_name], 'targetSize': 1, 'capacity': {'min': 1, 'max': 1,\n 'desired': 1}, 'zone': self.TEST_ZONE, 'network': 'default',\... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_14(VAR_20):...\n",
"VAR_40 = FUNC_8('task/%d' % VAR_20)\n",
"VAR_41 = VAR_40.text\n",
"VAR_42 = re.search('id=\"title_dataset_([0-9]+).* \\\\(Live\\\\)</', VAR_41)\n",
"if VAR_42 is None:\n",
"VAR_47 = int(VAR_42.groups()[0])\n",
"return VAR_47\n"
] | [
"def get_task_active_dataset_id(task_id):...\n",
"resp = admin_req('task/%d' % task_id)\n",
"page = resp.text\n",
"match = re.search('id=\"title_dataset_([0-9]+).* \\\\(Live\\\\)</', page)\n",
"if match is None:\n",
"dataset_id = int(match.groups()[0])\n",
"return dataset_id\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"FUNC_5(VAR_6)\n",
"VAR_8 = FUNC_6(VAR_6)\n",
"VAR_15 = FUNC_7(request.data, VAR_8)\n",
"if re.search('[^a-zA-Z0-9]', VAR_15['key']):\n",
"os.remove('keys/%s/%s.key' % (VAR_6, VAR_15['key']))\n",
"return \"Key '%s' successfully deleted\" % VAR_15['... | [
"def deleteKey(client):...\n",
"\"\"\"docstring\"\"\"\n",
"validateClient(client)\n",
"client_pub_key = loadClientRSAKey(client)\n",
"token_data = decodeRequestToken(request.data, client_pub_key)\n",
"if re.search('[^a-zA-Z0-9]', token_data['key']):\n",
"os.remove('keys/%s/%s.key' % (client, token_data[... | [
0,
0,
0,
0,
0,
1,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_11(VAR_13, VAR_14, VAR_11, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = FUNC_3(VAR_11, VAR_12)\n",
"VAR_29 = FUNC_6(VAR_11, VAR_12)\n",
"VAR_31 = FUNC_8(VAR_13, VAR_14)\n",
"VAR_33 = []\n",
"for source in VAR_27:\n",
"for institution in VAR_29:\n",
"for VAR_38 in VAR_31:\n",
"if ... | [
"def update_history_and_sourcebyinstitution(conn, sqlite, k10plus, ai):...\n",
"\"\"\"docstring\"\"\"\n",
"current_sources = get_all_current_sources(k10plus, ai)\n",
"current_institutions = get_all_current_institutions(k10plus, ai)\n",
"old_sourcebyinstitutions = get_all_old_sourcebyinstitutions(conn, sqlit... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Condition"... |
[
"def __init__(self, VAR_1, VAR_7, VAR_4=None, VAR_12=None):...\n",
"GenericRequest.__init__(self, VAR_1, VAR_4)\n",
"self.url = '%stasks/%s/submit' % (self.base_url, VAR_7[1])\n",
"self.task = VAR_7\n",
"self.submissions_path = VAR_12\n",
"self.data = {}\n"
] | [
"def __init__(self, browser, task, base_url=None, submissions_path=None):...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.url = '%stasks/%s/submit' % (self.base_url, task[1])\n",
"self.task = task\n",
"self.submissions_path = submissions_path\n",
"self.data = {}\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5():...\n",
"VAR_21 = [('/bootstrap', CLASS_0), ('/bot_code', CLASS_1), (\n '/swarming/api/v1/bot/bot_code/<version:[0-9a-f]{40}>', CLASS_1), (\n '/swarming/api/v1/bot/event', CLASS_5), (\n '/swarming/api/v1/bot/handshake', CLASS_3), (\n '/swarming/api/v1/bot/poll', CLASS_4), (\n '/swarmi... | [
"def get_routes():...\n",
"routes = [('/bootstrap', BootstrapHandler), ('/bot_code', BotCodeHandler),\n ('/swarming/api/v1/bot/bot_code/<version:[0-9a-f]{40}>', BotCodeHandler\n ), ('/swarming/api/v1/bot/event', BotEventHandler), (\n '/swarming/api/v1/bot/handshake', BotHandshakeHandler), (\n '/swarmi... | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_1, VAR_5, **VAR_6):...\n",
"import sql\n",
"import http.cookies\n",
"VAR_21 = FUNC_1('main', 'log_path')\n",
"VAR_22 = ''\n",
"if not os.path.exists(VAR_21):\n",
"os.makedirs(VAR_21)\n",
"VAR_67 = cgi.escape(os.environ['REMOTE_ADDR'])\n",
"if VAR_6.get('alerting') == 1:\n",
"VAR_25... | [
"def logging(serv, action, **kwargs):...\n",
"import sql\n",
"import http.cookies\n",
"log_path = get_config_var('main', 'log_path')\n",
"login = ''\n",
"if not os.path.exists(log_path):\n",
"os.makedirs(log_path)\n",
"IP = cgi.escape(os.environ['REMOTE_ADDR'])\n",
"if kwargs.get('alerting') == 1:\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
... |
[
"def FUNC_0(self):...\n",
"self.objects = load_model_objects()\n"
] | [
"def setUp(self):...\n",
"self.objects = load_model_objects()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"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_9(self, VAR_11, VAR_12):...\n",
""
] | [
"def login(self, username, admin):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@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_0(VAR_0, VAR_1, VAR_2):...\n",
"VAR_3 = VAR_2.connect()\n",
"VAR_4 = VAR_3.cursor()\n",
"VAR_5 = \"SELECT * FROM Users WHERE userEmail = '{0}'\".format(VAR_0)\n",
"VAR_4.execute(VAR_5)\n",
"VAR_6 = VAR_4.fetchone()\n",
"if VAR_6 is not None:\n",
"return 'Fail'\n",
"VAR_7 = \"INSERT INTO Us... | [
"def registerUser(username, password, sqlHandle):...\n",
"conn = sqlHandle.connect()\n",
"cursor = conn.cursor()\n",
"userCheckQuery = \"SELECT * FROM Users WHERE userEmail = '{0}'\".format(username)\n",
"cursor.execute(userCheckQuery)\n",
"result = cursor.fetchone()\n",
"if result is not None:\n",
"r... | [
0,
0,
0,
4,
0,
0,
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"self.username = self.get_argument('username').lower()\n",
"self.password = self.get_argument('psword').lower()\n",
"VAR_13 = self.check_database()\n",
"if VAR_13 != None:\n",
"self.render('signin.html', VAR_6=check_details)\n",
"self.set_secure_cookie('user', self.username)\n"... | [
"def post(self):...\n",
"self.username = self.get_argument('username').lower()\n",
"self.password = self.get_argument('psword').lower()\n",
"check_details = self.check_database()\n",
"if check_details != None:\n",
"self.render('signin.html', error=check_details)\n",
"self.set_secure_cookie('user', self.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Return'"
] |
[
"@VAR_0.event...\n",
"VAR_9 = 'USER'\n",
"if VAR_14.content.startswith(VAR_1):\n",
"VAR_9 = FUNC_0(VAR_14.author.id)\n",
"VAR_33 = VAR_14.channel\n",
"await VAR_0.send_message(VAR_4, FUNC_9(str(VAR_14.author), VAR_14.content, 0))\n",
"if VAR_14.content.startswith(VAR_1\n",
"VAR_16 = sqlite3.connect(VA... | [
"@client.event...\n",
"rank = 'USER'\n",
"if message.content.startswith(commandPrefix):\n",
"rank = return_user_rank(message.author.id)\n",
"channel = message.channel\n",
"await client.send_message(logsChannel, Log(str(message.author), message.\n content, 0))\n",
"if message.content.startswith(comman... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'"... |
[
"import sys\n",
"import os\n",
"import logging\n",
"import pdb\n",
"import urllib2\n",
"import json\n",
"import ijson\n",
"from dbnav.writer import Writer\n",
"from dbnav import logger as log\n",
"from dbnav.jsonable import from_json\n",
"VAR_0 = {'dbdiff': 'differ', 'dbexec': 'executer', 'dbexp... | [
"import sys\n",
"import os\n",
"import logging\n",
"import pdb\n",
"import urllib2\n",
"import json\n",
"import ijson\n",
"from dbnav.writer import Writer\n",
"from dbnav import logger as log\n",
"from dbnav.jsonable import from_json\n",
"COMMANDS = {'dbdiff': 'differ', 'dbexec': 'executer', 'db... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"import json\n",
"import logging\n",
"import os\n",
"import shutil\n",
"import sys\n",
"import tempfile\n",
"import threading\n",
"import time\n",
"import unittest\n",
"import zipfile\n",
"import test_env_bot_code\n",
"test_env_bot_code.setup_test_env()\n",
"import net_utils\n",
"import bo... | [
"import json\n",
"import logging\n",
"import os\n",
"import shutil\n",
"import sys\n",
"import tempfile\n",
"import threading\n",
"import time\n",
"import unittest\n",
"import zipfile\n",
"import test_env_bot_code\n",
"test_env_bot_code.setup_test_env()\n",
"import net_utils\n",
"import bo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Expr'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Imp... |
[
"from ansible import inventory\n",
"from ansible import vars\n",
"from ansible.executor import playbook_executor\n",
"from ansible.parsing import dataloader\n",
"from ansible.utils.display import Display\n",
"from dciclient.v1 import helper as dci_helper\n",
"from dciagent.plugins import plugin\n",
"i... | [
"from ansible import inventory\n",
"from ansible import vars\n",
"from ansible.executor import playbook_executor\n",
"from ansible.parsing import dataloader\n",
"from ansible.utils.display import Display\n",
"from dciclient.v1 import helper as dci_helper\n",
"from dciagent.plugins import plugin\n",
"i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_9(self, VAR_9, VAR_10):...\n",
"if self._IsServerAlive():\n",
"return FUNC_9(VAR_9, VAR_10)\n"
] | [
"def SendCommandRequest(self, arguments, completer):...\n",
"if self._IsServerAlive():\n",
"return SendCommandRequest(arguments, completer)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_7(VAR_0):...\n",
"VAR_24, VAR_25 = os.path.split(VAR_0)\n",
"return VAR_24\n"
] | [
"def path_head(path):...\n",
"head, tail = os.path.split(path)\n",
"return head\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(VAR_1, VAR_5=''):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = VAR_17(VAR_1.name)\n",
"if VAR_18 not in VAR_16 and current_user.is_authenticated():\n",
"VAR_26 = RemoteToken.get(current_user.get_id(), VAR_1.consumer_key, VAR_3=token\n )\n",
"return VAR_16.get(VAR_18, None)\n",
"if VAR_26 i... | [
"def token_getter(remote, token=''):...\n",
"\"\"\"docstring\"\"\"\n",
"session_key = token_session_key(remote.name)\n",
"if session_key not in session and current_user.is_authenticated():\n",
"remote_token = RemoteToken.get(current_user.get_id(), remote.consumer_key,\n token_type=token)\n",
"return se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'"
] |
[
"import fnmatch\n",
"import inspect\n",
"import logging\n",
"import os\n",
"import paramiko\n",
"import re\n",
"import shutil\n",
"import socket\n",
"import subprocess\n",
"import six\n",
"import time\n",
"from distutils.version import LooseVersion\n",
"from subprocess import Popen, PIPE\n",... | [
"import fnmatch\n",
"import inspect\n",
"import logging\n",
"import os\n",
"import paramiko\n",
"import re\n",
"import shutil\n",
"import socket\n",
"import subprocess\n",
"import six\n",
"import time\n",
"from distutils.version import LooseVersion\n",
"from subprocess import Popen, PIPE\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
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Ass... |
[
"def FUNC_5(self):...\n",
"return VAR_15.get('XSRF-TOKEN')\n"
] | [
"def get_csrf_token(self):...\n",
"return session.get('XSRF-TOKEN')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_23(VAR_48):...\n",
"if VAR_48.name in VAR_47 or VAR_48.exclude_from_cmake:\n",
"return\n",
"VAR_47.add(VAR_48.name)\n",
"for c in sorted(VAR_48.children, VAR_29=lambda x: x.name):\n",
"FUNC_23(c)\n",
"FUNC_22(VAR_48)\n",
"if VAR_48 is not VAR_22 and exists(join(VAR_48.directory, 'CMakeLists.... | [
"def process_module(module):...\n",
"if module.name in processed or module.exclude_from_cmake:\n",
"return\n",
"processed.add(module.name)\n",
"for c in sorted(module.children, key=lambda x: x.name):\n",
"process_module(c)\n",
"dump_options(module)\n",
"if module is not root and exists(join(module.dir... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(VAR_0=None):...\n",
"VAR_9 = frappe._dict(template='templates/includes/blog/blog.html', get_list\n =get_blog_list, hide_filters=True, children=get_children(), title=_('Blog')\n )\n",
"VAR_10 = (frappe.local.form_dict.blog_category or frappe.local.form_dict.\n category)\n",
"if VAR_10:\n",... | [
"def get_list_context(context=None):...\n",
"list_context = frappe._dict(template='templates/includes/blog/blog.html',\n get_list=get_blog_list, hide_filters=True, children=get_children(),\n title=_('Blog'))\n",
"category = (frappe.local.form_dict.blog_category or frappe.local.form_dict.\n category)\n"... | [
0,
0,
3,
0,
0,
0,
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_16 = self.common.get_volume_stats(VAR_4)\n",
"VAR_16['storage_protocol'] = 'FC'\n",
"VAR_17 = self.configuration.safe_get('volume_backend_name')\n",
"VAR_16['volume_backend_name'] = VAR_17 or self.__class__.__name__\n"... | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"stats = self.common.get_volume_stats(refresh)\n",
"stats['storage_protocol'] = 'FC'\n",
"backend_name = self.configuration.safe_get('volume_backend_name')\n",
"stats['volume_backend_name'] = backend_name or self.__class__.... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_3=None, VAR_4=None, VAR_5=True):...\n",
"VAR_14, VAR_15 = vimsupport.CurrentLineAndColumn()\n",
"VAR_16 = vimsupport.GetCurrentBufferFilepath()\n",
"VAR_17 = {'filetypes': vimsupport.CurrentFiletypes(), 'line_num': VAR_14,\n 'column_num': VAR_15, 'start_column': VAR_3, 'line_value': vim.cur... | [
"def BuildRequestData(start_column=None, query=None, include_buffer_data=True):...\n",
"line, column = vimsupport.CurrentLineAndColumn()\n",
"filepath = vimsupport.GetCurrentBufferFilepath()\n",
"request_data = {'filetypes': vimsupport.CurrentFiletypes(), 'line_num':\n line, 'column_num': column, 'start_co... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_8(VAR_1, VAR_2, VAR_3):...\n",
"VAR_4 = lambda VAR_16, new_steps: VAR_16 + new_steps\n",
"return FUNC_10(VAR_1, VAR_2, VAR_3, VAR_4)\n"
] | [
"def increment_achievement(achievement_id, player_id, steps):...\n",
"steps_function = lambda current_steps, new_steps: current_steps + new_steps\n",
"return update_steps(achievement_id, player_id, steps, steps_function)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"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'"
] |
[
"\"\"\"string\"\"\"\n",
"from app.models.theq import Office\n",
"from .base import Base\n",
"from flask_login import current_user\n",
"from qsystem import db\n",
"VAR_1 = ['SUPPORT']\n",
"def FUNC_0(self):...\n",
"return current_user.is_authenticated and current_user.role.role_code in self.roles_allow... | [
"\"\"\"Copyright 2018 Province of British Columbia\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agr... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self, VAR_9, *VAR_13, **VAR_14):...\n",
"VAR_14['partial'] = True\n",
"return self.update(VAR_9, *VAR_13, **kwargs)\n"
] | [
"def partial_update(self, request, *args, **kwargs):...\n",
"kwargs['partial'] = True\n",
"return self.update(request, *args, **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_28(self, *VAR_33):...\n",
"self._run_tracker.log(Report.INFO, *VAR_33)\n"
] | [
"def info(self, *msg_elements):...\n",
"self._run_tracker.log(Report.INFO, *msg_elements)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 3}, 'CONFIDENCE': {'HIGH': 3}}\n",
"self.check_example('httplib_https.py', VAR_2)\n"
] | [
"def test_httplib_https(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'MEDIUM': 3}, 'CONFIDENCE': {'HIGH': 3}}\n",
"self.check_example('httplib_https.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
"VAR_85 = {}\n",
"VAR_86 = g.RATELIMIT * 60\n",
"if VAR_86 <= 0:\n",
"return\n",
"VAR_87 = datetime.now(g.tz) + timedelta(VAR_86=seconds)\n",
"if VAR_61 and VAR_101.user_is_loggedin:\n",
"VAR_85['user' + VAR_100(VAR_101.user._id36)] = VAR_87\n",
"if VAR_62:\n",
"VAR_85['ip' + ... | [
"@classmethod...\n",
"to_set = {}\n",
"seconds = g.RATELIMIT * 60\n",
"if seconds <= 0:\n",
"return\n",
"expire_time = datetime.now(g.tz) + timedelta(seconds=seconds)\n",
"if rate_user and c.user_is_loggedin:\n",
"to_set['user' + str(c.user._id36)] = expire_time\n",
"if rate_ip:\n",
"to_set['ip' +... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"import logging\n",
"from datetime import datetime\n",
"from dateutil.relativedelta import relativedelta\n",
"from odoo import fields, models, api\n",
"VAR_0 = logging.getLogger(__name__)\n",
"VAR_1 = 'event.event'\n",
"VAR_2 = ['event.event']\n",
"VAR_3 = fields.Boolean('Is Participating', compute=\n... | [
"import logging\n",
"from datetime import datetime\n",
"from dateutil.relativedelta import relativedelta\n",
"from odoo import fields, models, api\n",
"_logger = logging.getLogger(__name__)\n",
"_name = 'event.event'\n",
"_inherit = ['event.event']\n",
"fit_is_participating = fields.Boolean('Is Partic... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"FunctionDe... |
[
"def FUNC_8(self, VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"self.test_name = VAR_17 + ('jerky' if self.jerky else 'smooth')\n"
] | [
"def initFile(self, filename):...\n",
"\"\"\"docstring\"\"\"\n",
"self.test_name = filename + ('jerky' if self.jerky else 'smooth')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return dict(self._get_system_properties(self.java))\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return dict(self._get_system_properties(self.java))\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"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_5(self, VAR_5):...\n",
"VAR_6 = Agent(reactor, pool=self.connection_pool)\n",
"return VAR_6.request('GET', 'http://localhost:%s/events' % self.session.\n config.get_http_api_port(), Headers({'User-Agent': ['Tribler ' +\n version_id]}), None).addCallback(self.on_event_socket_opened)\n"
] | [
"def open_events_socket(self, _):...\n",
"agent = Agent(reactor, pool=self.connection_pool)\n",
"return agent.request('GET', 'http://localhost:%s/events' % self.session.\n config.get_http_api_port(), Headers({'User-Agent': ['Tribler ' +\n version_id]}), None).addCallback(self.on_event_socket_opened)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_29(self, VAR_15):...\n",
""
] | [
"def delete(self, item):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_6(VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"return '/login?' + urllib.parse.urlencode({'dest': VAR_8})\n"
] | [
"def make_login_url(dest_url):...\n",
"\"\"\"docstring\"\"\"\n",
"return '/login?' + urllib.parse.urlencode({'dest': dest_url})\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_13(VAR_4, VAR_5):...\n",
"VAR_18 = {}\n",
"for VAR_41 in VAR_4.keywords.all():\n",
"VAR_18[VAR_40(VAR_41.id)] = VAR_41\n",
"VAR_19 = []\n",
"for VAR_41 in VAR_5:\n",
"if VAR_41 in VAR_18:\n",
"VAR_20 = sorted([VAR_41.text for VAR_41 in VAR_18.values()])\n",
"VAR_19.append(VAR_18[VAR_41].te... | [
"def _user_keywords_changed(thesis, user_request_keywords):...\n",
"db_keywords_info = {}\n",
"for kw in thesis.keywords.all():\n",
"db_keywords_info[str(kw.id)] = kw\n",
"unsorted_user_keywords = []\n",
"for kw in user_request_keywords:\n",
"if kw in db_keywords_info:\n",
"db_keywords = sorted([kw.te... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@tornado.gen.coroutine...\n",
"VAR_17 = ('SELECT {} FROM boiler_rooms WHERE district_id = %s AND name = %s'\n .format(VAR_6))\n",
"VAR_18 = VAR_9, VAR_8\n",
"VAR_19 = yield VAR_1.execute(query=sql, VAR_18=params)\n",
"return VAR_19.fetchone()\n"
] | [
"@tornado.gen.coroutine...\n",
"sql = ('SELECT {} FROM boiler_rooms WHERE district_id = %s AND name = %s'.\n format(cols))\n",
"params = dist_id, name\n",
"cursor = yield tx.execute(query=sql, params=params)\n",
"return cursor.fetchone()\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@property...\n",
"if not self.current_user or not self.current_user.has_key('role'):\n",
"return self.current_user['role'] == 'wb'\n"
] | [
"@property...\n",
"if not self.current_user or not self.current_user.has_key('role'):\n",
"return self.current_user['role'] == 'wb'\n"
] | [
0,
0,
0
] | [
"Condition",
"Condition",
"Return'"
] |
[
"def FUNC_3(VAR_2, VAR_3):...\n",
"VAR_12 = VAR_2.replace('\\t', '')\n",
"VAR_12 = VAR_12.replace('\\r', '')\n",
"VAR_12 = VAR_12.replace('\\n', '')\n",
"VAR_12 = VAR_12.replace('₩', '')\n",
"VAR_12 = VAR_12.replace(',', '')\n",
"if VAR_12 == '':\n",
"return 0\n",
"VAR_12 = VAR_12.split()\n",
"if ... | [
"def cleanStr(str, isDiscounted):...\n",
"result = str.replace('\\t', '')\n",
"result = result.replace('\\r', '')\n",
"result = result.replace('\\n', '')\n",
"result = result.replace('₩', '')\n",
"result = result.replace(',', '')\n",
"if result == '':\n",
"return 0\n",
"result = result.split()\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'",
"Return'",
"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_0(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"self.primary_subscribe_client.subscribe(VAR_5)\n"
] | [
"def subscribe(self, channel):...\n",
"\"\"\"docstring\"\"\"\n",
"self.primary_subscribe_client.subscribe(channel)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_18(self, VAR_20, VAR_18):...\n",
"if VAR_20 is None and VAR_18 is not None:\n",
"VAR_18 = CLASS_0.path(VAR_18, '.sql')\n",
"VAR_20 = re.sub('\\\\{(\\\\w+?)\\\\}', '%(\\\\1)s', VAR_20)\n",
"VAR_0.debug('READ SQL FILE: ' + VAR_18)\n",
"return VAR_20\n",
"VAR_20 = file.read()\n"
] | [
"def __prepare(self, sql, filename):...\n",
"if sql is None and filename is not None:\n",
"filename = Connection.path(filename, '.sql')\n",
"sql = re.sub('\\\\{(\\\\w+?)\\\\}', '%(\\\\1)s', sql)\n",
"logger.debug('READ SQL FILE: ' + filename)\n",
"return sql\n",
"sql = file.read()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"return scrape.Document(content_bytes=response.content, url=None, status=\n response.status_code, message=None, headers=response, charset=const.\n CHARSET_UTF8)\n"
] | [
"def to_doc(self, response):...\n",
"\"\"\"docstring\"\"\"\n",
"return scrape.Document(content_bytes=response.content, url=None, status=\n response.status_code, message=None, headers=response, charset=const.\n CHARSET_UTF8)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"from flask import Blueprint, request, session, g, redirect, url_for, render_template, flash\n",
"from flask_login import login_user, logout_user, current_user\n",
"from flask_security import login_required\n",
"from benwaonline.database import db\n",
"from benwaonline.oauth import twitter\n",
"from benwa... | [
"from flask import Blueprint, request, session, g, redirect, url_for, render_template, flash\n",
"from flask_login import login_user, logout_user, current_user\n",
"from flask_security import login_required\n",
"from benwaonline.database import db\n",
"from benwaonline.oauth import twitter\n",
"from benwa... | [
6,
0,
0,
0,
0,
6,
0,
0,
0,
0,
6,
6,
6,
6
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"For",
"Assign'",
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1.value = beamr.interpreters.Escape(VAR_1.value)\n",
"return VAR_1\n"
] | [
"def t_ESCAPE(t):...\n",
"\"\"\"docstring\"\"\"\n",
"t.value = beamr.interpreters.Escape(t.value)\n",
"return t\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_18(VAR_37):...\n",
"VAR_37 = VAR_37.replace('[', '')\n",
"VAR_37 = VAR_37.replace(']', '')\n",
"VAR_45, VAR_46 = VAR_37.split(',')\n",
"VAR_37 = '{} - {}'.format(VAR_45, VAR_46)\n",
"return VAR_37\n"
] | [
"def reformat(score):...\n",
"score = score.replace('[', '')\n",
"score = score.replace(']', '')\n",
"win, loss = score.split(',')\n",
"score = '{} - {}'.format(win, loss)\n",
"return score\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.group.__acl__()\n"
] | [
"def get_task_line_acl(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.group.__acl__()\n"
] | [
0,
0,
1
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_57, VAR_58=True, **VAR_16):...\n",
"self.nav = VAR_57\n",
"self.remember = VAR_58\n",
"VAR_7 = VAR_57.get_param, VAR_7\n",
"CLASS_0.__init__(self, VAR_7, **kw)\n"
] | [
"def __init__(self, param, menu_cls, remember=True, **kw):...\n",
"self.nav = menu_cls\n",
"self.remember = remember\n",
"param = menu_cls.get_param, param\n",
"Validator.__init__(self, param, **kw)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_7 = BokChoyTestSuite('')\n",
"VAR_1 = 'tests'\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name))\n"
] | [
"def test_default(self):...\n",
"suite = BokChoyTestSuite('')\n",
"name = 'tests'\n",
"self.assertEqual(suite.cmd, self._expected_command(name=name))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if '\\\\' in VAR_16:\n",
"return False\n",
"VAR_24 = normpath(VAR_16)\n",
"if VAR_16.endswith('/') and VAR_16 != '/':\n",
"VAR_24 += '/'\n",
"return VAR_24 == VAR_16\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if '\\\\' in url:\n",
"return False\n",
"normalised = normpath(url)\n",
"if url.endswith('/') and url != '/':\n",
"normalised += '/'\n",
"return normalised == url\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_0, VAR_1):...\n",
"self.object_list = self.get_queryset(VAR_0, VAR_1)\n",
"VAR_19 = self.get_context_data()\n",
"return render(VAR_0, 'twitter_hunter/tweets.html', VAR_19)\n"
] | [
"def get(self, request, pk):...\n",
"self.object_list = self.get_queryset(request, pk)\n",
"context = self.get_context_data()\n",
"return render(request, 'twitter_hunter/tweets.html', context)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"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 __init__(self, VAR_0, VAR_3, VAR_2=None):...\n",
"GenericRequest.__init__(self, VAR_0, VAR_2)\n",
"self.user_test_id = VAR_3\n",
"self.url = '%suser_test/%s' % (self.base_url, VAR_3)\n"
] | [
"def __init__(self, browser, user_test_id, base_url=None):...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.user_test_id = user_test_id\n",
"self.url = '%suser_test/%s' % (self.base_url, user_test_id)\n"
] | [
0,
0,
0,
5
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_21):...\n",
"if VAR_21:\n",
"VAR_106 = int(VAR_21, 36)\n",
"if self.redirect:\n",
"return Link._byID(VAR_106, True)\n",
"abort(404, 'page not found')\n",
"return None\n"
] | [
"def run(self, link_id):...\n",
"if link_id:\n",
"aid = int(link_id, 36)\n",
"if self.redirect:\n",
"return Link._byID(aid, True)\n",
"abort(404, 'page not found')\n",
"return None\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_7 = bs4.BeautifulSoup(VAR_0, 'lxml')\n",
"return VAR_7.get_text()[:200]\n"
] | [
"def generate_summary(text):...\n",
"soup = bs4.BeautifulSoup(text, 'lxml')\n",
"return soup.get_text()[:200]\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"return ungettext_lazy(u'Delete Mapping', u'Delete Mappings', VAR_7)\n"
] | [
"@staticmethod...\n",
"return ungettext_lazy(u'Delete Mapping', u'Delete Mappings', count)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_26(VAR_16=FUNC_1('configs', 'haproxy_save_configs_dir'), VAR_17=...\n",
"import glob\n",
"VAR_11 = set()\n",
"VAR_62 = set()\n",
"for VAR_63 in glob.glob(os.path.join(VAR_16, '*.' + VAR_17)):\n",
"VAR_11.add(VAR_63.split('/')[-1])\n",
"VAR_63 = sorted(VAR_11, reverse=True)\n",
"if VAR_17 == ... | [
"def get_files(dir=get_config_var('configs', 'haproxy_save_configs_dir'),...\n",
"import glob\n",
"file = set()\n",
"return_files = set()\n",
"for files in glob.glob(os.path.join(dir, '*.' + format)):\n",
"file.add(files.split('/')[-1])\n",
"files = sorted(file, reverse=True)\n",
"if format == 'cfg':\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Import'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Condition",
"For",
"Return'",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"return self.schema.get_columns()\n"
] | [
"def get_columns(self):...\n",
"return self.schema.get_columns()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"return base64.b64encode((self.rule.name + ''.join(self.output)).encode('utf-8')\n ).decode('utf-8')\n"
] | [
"@property...\n",
"return base64.b64encode((self.rule.name + ''.join(self.output)).encode('utf-8')\n ).decode('utf-8')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"import logging\n",
"import os\n",
"import sys\n",
"import threading\n",
"VAR_0 = os.path.dirname(os.path.abspath(__file__))\n",
"VAR_1 = os.path.dirname(VAR_0)\n",
"sys.path.insert(0, VAR_1)\n",
"sys.path.insert(0, os.path.join(VAR_1, 'third_party'))\n",
"from depot_tools import auto_stub\n",
"fr... | [
"import logging\n",
"import os\n",
"import sys\n",
"import threading\n",
"TEST_DIR = os.path.dirname(os.path.abspath(__file__))\n",
"ROOT_DIR = os.path.dirname(TEST_DIR)\n",
"sys.path.insert(0, ROOT_DIR)\n",
"sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party'))\n",
"from depot_tools import auto... | [
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'",
"Import'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Assign'",
"Ret... |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = 3\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_3_processes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"process_count = 3\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_3(VAR_5, VAR_6, VAR_7, VAR_8=(), VAR_9=False, **VAR_10):...\n",
"if VAR_9:\n",
"run_main(VAR_5, VAR_6, VAR_7, *VAR_8, **kwargs)\n",
"debug_main(VAR_5, VAR_6, VAR_7, *VAR_8, **kwargs)\n"
] | [
"def main(addr, name, kind, extra=(), nodebug=False, **kwargs):...\n",
"if nodebug:\n",
"run_main(addr, name, kind, *extra, **kwargs)\n",
"debug_main(addr, name, kind, *extra, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'"
] |
[
"from django.shortcuts import render\n",
"from .models import Post\n",
"def FUNC_0(VAR_0):...\n",
"VAR_2 = Post.objects.order_by('pub_date')\n",
"return render(VAR_0, 'posts/home.html', {'posts': VAR_2})\n"
] | [
"from django.shortcuts import render\n",
"from .models import Post\n",
"def home(request):...\n",
"posts = Post.objects.order_by('pub_date')\n",
"return render(request, 'posts/home.html', {'posts': posts})\n"
] | [
6,
0,
0,
6,
0
] | [
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"from saml2 import BINDING_HTTP_REDIRECT\n",
"from saml2.ident import decode\n",
"from saml2.client import Saml2Client\n",
"from saml2.response import LogoutResponse\n",
"from saml2.metadata import entity_descriptor\n",
"from werkzeug.exceptions import Forbidden\n",
"from flask import request, session, ... | [
"from saml2 import BINDING_HTTP_REDIRECT\n",
"from saml2.ident import decode\n",
"from saml2.client import Saml2Client\n",
"from saml2.response import LogoutResponse\n",
"from saml2.metadata import entity_descriptor\n",
"from werkzeug.exceptions import Forbidden\n",
"from flask import request, session, ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
... |
[
"def __init__(self, VAR_16):...\n",
"self.string = VAR_16\n",
"self.position = -1\n",
"self.char = None\n",
"self.read()\n"
] | [
"def __init__(self, string):...\n",
"self.string = string\n",
"self.position = -1\n",
"self.char = None\n",
"self.read()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"remove_perm_from_user(self.tester, self.permission)\n",
"self.client.login(username=self.tester.username, password='password')\n",
"VAR_1 = self.client.post(self.case_update_url, {'target_field': 'priority',\n 'from_plan': self.plan.pk, 'case': [self.case_1.pk, self.case_3.pk],\n... | [
"def test_refuse_if_missing_permission(self):...\n",
"remove_perm_from_user(self.tester, self.permission)\n",
"self.client.login(username=self.tester.username, password='password')\n",
"response = self.client.post(self.case_update_url, {'target_field':\n 'priority', 'from_plan': self.plan.pk, 'case': [self... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.r_handler.session\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.r_handler.session\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.