lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_20(self, VAR_12, VAR_2):...\n",
"return self.make_req_msg(VAR_12[0], VAR_12[1], VAR_12[2], VAR_2, VAR_12[3])\n"
] | [
"def req_from_data(self, d, fun):...\n",
"return self.make_req_msg(d[0], d[1], d[2], fun, d[3])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@gallery.route('/gallery/benwa/<int:post_id>')...\n",
"VAR_5 = Post.query.paginate(VAR_1, 1, False)\n",
"if VAR_5.items:\n",
"return render_template('show.html', VAR_5=post, VAR_6=CommentForm())\n",
"flash(\"That Benwa doesn't exist yet\")\n",
"return redirect(url_for('gallery.show_posts'))\n"
] | [
"@gallery.route('/gallery/benwa/<int:post_id>')...\n",
"post = Post.query.paginate(post_id, 1, False)\n",
"if post.items:\n",
"return render_template('show.html', post=post, form=CommentForm())\n",
"flash(\"That Benwa doesn't exist yet\")\n",
"return redirect(url_for('gallery.show_posts'))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"import sqlite3, os\n",
"VAR_0 = os.path.dirname(__file__)\n",
"VAR_1 = 'database/main.db'\n",
"VAR_2 = sqlite3.connect(os.path.join(VAR_0, VAR_1), timeout=1)\n",
"VAR_2.row_factory = sqlite3.Row\n",
"VAR_3 = VAR_2.cursor()\n",
"def FUNC_0(VAR_4):...\n",
"VAR_3.execute(\"SELECT * FROM players WHERE Na... | [
"import sqlite3, os\n",
"script_dir = os.path.dirname(__file__)\n",
"rel_path = 'database/main.db'\n",
"database = sqlite3.connect(os.path.join(script_dir, rel_path), timeout=1)\n",
"database.row_factory = sqlite3.Row\n",
"db = database.cursor()\n",
"def getPlayer(player):...\n",
"db.execute(\"SELECT ... | [
0,
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_12=None, VAR_13=None, VAR_14=None, VAR_15=None, VAR_16...\n",
"VAR_29 = self.search_exercises(VAR_12=number, VAR_13=category_id, VAR_14=\n module_id, VAR_15=exercise_id, VAR_16=filter_for_assistant)\n",
"VAR_30 = []\n",
"if VAR_17:\n",
"for VAR_27 in VAR_29:\n",
"for VAR_27 in VAR... | [
"def submission_ids(self, number=None, category_id=None, module_id=None,...\n",
"exercises = self.search_exercises(number=number, category_id=category_id,\n module_id=module_id, exercise_id=exercise_id, filter_for_assistant=\n filter_for_assistant)\n",
"submissions = []\n",
"if best:\n",
"for entry in... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"For",
"Assign'",
"Return'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"VAR_4 = self.redis_client.pubsub()\n",
"VAR_4.subscribe('__keyspace@0__:Exports')\n",
"VAR_5 = 0\n",
"VAR_9 = self.redis_client.lrange('Exports', 0, -1)\n",
"for VAR_2 in VAR_9:\n",
"VAR_5 += 1\n",
"for msg in VAR_4.listen():\n",
"self._process_key(VAR_2)\n",
"if msg['ty... | [
"def _run(self):...\n",
"import_pubsub_client = self.redis_client.pubsub()\n",
"import_pubsub_client.subscribe('__keyspace@0__:Exports')\n",
"num_imported = 0\n",
"export_keys = self.redis_client.lrange('Exports', 0, -1)\n",
"for key in export_keys:\n",
"num_imported += 1\n",
"for msg in import_pubsub... | [
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"For",
"Expr'",
"Condition",
"Assert'",
"Assign'",
"Assert'",
"For",
"AugAssign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_24(self):...\n",
"VAR_0 = [SleepCheck(0.5) for i in range(5)]\n",
"VAR_7 = len(VAR_0) - 2\n",
"self.set_max_jobs(VAR_7)\n",
"self.runall(VAR_0)\n",
"self.assertEqual(len(VAR_0), self.runner.stats.num_cases())\n",
"self.assertEqual(0, len(self.runner.stats.failures()))\n",
"self.assertEqual(V... | [
"def test_concurrency_limited(self):...\n",
"checks = [SleepCheck(0.5) for i in range(5)]\n",
"max_jobs = len(checks) - 2\n",
"self.set_max_jobs(max_jobs)\n",
"self.runall(checks)\n",
"self.assertEqual(len(checks), self.runner.stats.num_cases())\n",
"self.assertEqual(0, len(self.runner.stats.failures())... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"return self.result\n"
] | [
"def get_result(self):...\n",
"return self.result\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_7, VAR_12):...\n",
"VAR_3.execute('UPDATE games set GamesPlayed = %i WHERE ID = %i' % (VAR_7,\n VAR_12))\n",
"VAR_2.commit()\n"
] | [
"def GameNewPlayed(Played, ID):...\n",
"db.execute('UPDATE games set GamesPlayed = %i WHERE ID = %i' % (Played, ID))\n",
"database.commit()\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"VAR_5 = [{'cloudProvider': 'gce', 'asgName': self.__server_group_name,\n 'serverGroupName': self.__server_group_name, 'region': self.TEST_REGION,\n 'zone': self.TEST_ZONE, 'type': 'enableServerGroup', 'regions': [self.\n TEST_REGION], 'zones': [self.TEST_ZONE], 'credentials': s... | [
"def enable_server_group(self):...\n",
"job = [{'cloudProvider': 'gce', 'asgName': self.__server_group_name,\n 'serverGroupName': self.__server_group_name, 'region': self.TEST_REGION,\n 'zone': self.TEST_ZONE, 'type': 'enableServerGroup', 'regions': [self.\n TEST_REGION], 'zones': [self.TEST_ZONE], 'cred... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"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'"
] |
[
"def FUNC_18(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = \"SELECT meta FROM {0} WHERE path='{1}';\".format(VAR_2, VAR_8)\n",
"VAR_4 = self._run_command(VAR_7)\n",
"VAR_4 = VAR_4[0][0]\n",
"VAR_4 = None\n",
"return VAR_4\n"
] | [
"def getCaption(self, pth):...\n",
"\"\"\"docstring\"\"\"\n",
"command = \"SELECT meta FROM {0} WHERE path='{1}';\".format(TABLE_NAME, pth)\n",
"data = self._run_command(command)\n",
"data = data[0][0]\n",
"data = None\n",
"return data\n"
] | [
0,
0,
4,
4,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@login_required...\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_46 = True\n",
"VAR_27.update({'content_type': get_ct(VAR_8), 'object_id': VAR_8.id})\n",
"if not VAR_46:\n",
"VAR_46 = FUN... | [
"@login_required...\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_slug})\n",
"allow_read = True\n",
"article_args.update({'content_type': get_ct(group), 'object_id': group.id})\n",
"if not allo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_4(VAR_15, VAR_16):...\n",
"VAR_33 = {}\n",
"for in_file, VAR_45 in VAR_15:\n",
"VAR_33[VAR_45] = FUNC_5(in_file, VAR_16)\n",
"return VAR_33\n"
] | [
"def build_tree(templates, config):...\n",
"res = {}\n",
"for in_file, out_file in templates:\n",
"res[out_file] = render_template(in_file, config)\n",
"return res\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = {}\n",
"VAR_14['userInfo'] = VAR_6.to_json()\n",
"VAR_9 = VAR_14['userInfo'].pop('tasks')\n",
"return VAR_9\n"
] | [
"def make_todo_list(verified_user):...\n",
"\"\"\"docstring\"\"\"\n",
"todo_list = {}\n",
"todo_list['userInfo'] = verified_user.to_json()\n",
"all_tasks = todo_list['userInfo'].pop('tasks')\n",
"return all_tasks\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_2[0] == '0':\n",
"return self.cursor.execute('select * from item')\n",
"return self.cursor.execute('string' % VAR_2[0])\n"
] | [
"def find_all_items(self, langid):...\n",
"\"\"\"docstring\"\"\"\n",
"if langid[0] == '0':\n",
"return self.cursor.execute('select * from item')\n",
"return self.cursor.execute(\n 'select item.id, item.shoppinglistid, item.name, itemtranslation.id, itemtranslation.itemid, itemtranslation.... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"\"\"\"\nCreated on 6 Feb 2018\n\n@author: Teodor Gherasim Nistor\n\"\"\"\n",
"import yaml\n",
"import subprocess\n",
"import os\n",
"import re\n",
"from beamr.debug import warn, err\n",
"VAR_0 = os.path.expanduser('~/.beamrrc')\n",
"VAR_1 = 'string'\n",
"VAR_2 = {'docclass': 'beamer', 'packages': [... | [
"\"\"\"\nCreated on 6 Feb 2018\n\n@author: Teodor Gherasim Nistor\n\"\"\"\n",
"import yaml\n",
"import subprocess\n",
"import os\n",
"import re\n",
"from beamr.debug import warn, err\n",
"userConfigPath = os.path.expanduser('~/.beamrrc')\n",
"userConfigTemplate = \"\"\"---\n# Beam configuration file. ... | [
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Condition",
"For",
"For",
"For",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"... |
[
"def FUNC_26(self, VAR_14):...\n",
""
] | [
"def get_max_length(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0(self):...\n",
"if not GenericRequest.test_success(self):\n",
"return False\n",
"self.get_submission_info()\n",
"return False\n",
"return True\n"
] | [
"def test_success(self):...\n",
"if not GenericRequest.test_success(self):\n",
"return False\n",
"self.get_submission_info()\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"def __call__(self, *VAR_12, **VAR_9):...\n",
"return CLASS_1(self.key_name, *VAR_12, **kwargs)\n"
] | [
"def __call__(self, *args, **kwargs):...\n",
"return KeyTransform(self.key_name, *args, **kwargs)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8():...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_10(VAR_9, VAR_10, VAR_11=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15 = [iter(VAR_9)] * VAR_10\n",
"return izip_longest(*VAR_15, VAR_11=fillvalue)\n"
] | [
"def swissPairings():...\n",
"\"\"\"docstring\"\"\"\n",
"def grouper(iterable, n, fillvalue=None):...\n",
"\"\"\"docstring\"\"\"\n",
"args = [iter(iterable)] * n\n",
"return izip_longest(*args, fillvalue=fillvalue)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"from crimemap.dbhelper import DBHelper\n",
"from flask import Flask, render_template, request\n",
"VAR_0 = Flask(__name__)\n",
"VAR_1 = DBHelper()\n",
"@VAR_0.route('/')...\n",
"VAR_2 = VAR_1.get_all_inputs()\n",
"print(e)\n",
"return render_template('home.html', VAR_2=data)\n",
"VAR_2 = None\n"
] | [
"from crimemap.dbhelper import DBHelper\n",
"from flask import Flask, render_template, request\n",
"app = Flask(__name__)\n",
"DB = DBHelper()\n",
"@app.route('/')...\n",
"data = DB.get_all_inputs()\n",
"print(e)\n",
"return render_template('home.html', data=data)\n",
"data = None\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Assign'"
] |
[
"def FUNC_6(self):...\n",
"self.login()\n",
"while True:\n",
"VAR_30 = random.choice(self.tasks)\n",
"self.do_step(SubmitRandomRequest(self.browser, VAR_30, VAR_10=self.base_url,\n VAR_11=self.submissions_path))\n"
] | [
"def act(self):...\n",
"self.login()\n",
"while True:\n",
"task = random.choice(self.tasks)\n",
"self.do_step(SubmitRandomRequest(self.browser, task, base_url=self.base_url,\n submissions_path=self.submissions_path))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_17(self, VAR_14):...\n",
""
] | [
"def is_relation(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_2(VAR_7=None, VAR_8=0, VAR_9=0):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_7 is None:\n",
"return True\n",
"return False\n",
"VAR_21 = re.match('^([^;]+)(; length=([0-9]+))?$', VAR_7, re.IGNORECASE)\n",
"VAR_22 = parse_http_date(VAR_21.group(1))\n",
"VAR_23 = VAR_21.group(3)\n",
"if VAR_23... | [
"def was_modified_since(header=None, mtime=0, size=0):...\n",
"\"\"\"docstring\"\"\"\n",
"if header is None:\n",
"return True\n",
"return False\n",
"matches = re.match('^([^;]+)(; length=([0-9]+))?$', header, re.IGNORECASE)\n",
"header_mtime = parse_http_date(matches.group(1))\n",
"header_len = matche... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition"
] |
[
"from sup.net import NetError\n",
"from wzworkers import WorkerInterrupt\n",
"from wipeskel import WipeSkel, WipeState, cstate\n",
"from beon import exc, regexp\n",
"import re\n",
"def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, *VAR_4, **VAR_5):...\n",
"self.sbjfun = VAR_2\n",
"self.msgfun = VAR_3\n",... | [
"from sup.net import NetError\n",
"from wzworkers import WorkerInterrupt\n",
"from wipeskel import WipeSkel, WipeState, cstate\n",
"from beon import exc, regexp\n",
"import re\n",
"def __init__(self, forums, targets, sbjfun, msgfun, *args, **kvargs):...\n",
"self.sbjfun = sbjfun\n",
"self.msgfun = msg... | [
0,
0,
0,
0,
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,
0,
0,
0,
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,
7... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Return'",
"Expr'",
"FunctionDef'",
"For",
"Expr'",
"Condition",
"Expr'",
"Expr'",
... |
[
"def FUNC_40(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return list(self.list_properties.keys())\n"
] | [
"def get_columns_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return list(self.list_properties.keys())\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_6(self, VAR_38):...\n",
"if not VAR_38:\n",
"if self.emp_error is not None:\n",
"if len(VAR_38) > self.length:\n",
"VAR_101.errors.add(self.emp_error)\n",
"VAR_101.errors.add(self.len_error)\n",
"return VAR_38\n"
] | [
"def run(self, title):...\n",
"if not title:\n",
"if self.emp_error is not None:\n",
"if len(title) > self.length:\n",
"c.errors.add(self.emp_error)\n",
"c.errors.add(self.len_error)\n",
"return title\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"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'"
] |
[
"@property...\n",
"VAR_65 = '.' if self._workdir is None else self._workdir\n",
"if not os.path.isabs(VAR_65):\n",
"return os.path.abspath(os.path.join(self.workflow.basedir, VAR_65))\n",
"return VAR_65\n"
] | [
"@property...\n",
"workdir = '.' if self._workdir is None else self._workdir\n",
"if not os.path.isabs(workdir):\n",
"return os.path.abspath(os.path.join(self.workflow.basedir, workdir))\n",
"return workdir\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(self, VAR_48):...\n",
"VAR_80 = CLASS_5.run(self, VAR_48)\n",
"if VAR_80 and not (VAR_101.user_is_loggedin and VAR_80.can_submit(VAR_101.user)\n",
"abort(403, 'forbidden')\n",
"return VAR_80\n"
] | [
"def run(self, link_name):...\n",
"link = VLink.run(self, link_name)\n",
"if link and not (c.user_is_loggedin and link.can_submit(c.user)):\n",
"abort(403, 'forbidden')\n",
"return link\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_11(self, VAR_7):...\n",
"VAR_22 = ''\n",
"if VAR_7._where:\n",
"VAR_27 = 0\n",
"VAR_7 = 'DELETE FROM {0} {1};'.format(VAR_7.model_class._meta.table_name,\n VAR_22)\n",
"if isinstance(VAR_7._where, VAR_39):\n",
"return VAR_7\n",
"VAR_22 = 'WHERE {0}'.format(VAR_7._where)\n",
"for value i... | [
"def generate_delete(self, query):...\n",
"where = ''\n",
"if query._where:\n",
"i = 0\n",
"query = 'DELETE FROM {0} {1};'.format(query.model_class._meta.table_name, where\n )\n",
"if isinstance(query._where, str):\n",
"return query\n",
"where = 'WHERE {0}'.format(query._where)\n",
"for value in ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"AugAssign'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.get(self.section, 'password_reset_link')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.get(self.section, 'password_reset_link')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.curated_chemical.sid\n",
"return False\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.curated_chemical.sid\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'",
"Return'"
] |
[
"import json\n",
"from django.conf import settings\n",
"from django.test import TestCase, Client\n",
"from django.urls import reverse\n",
"from experiences.models import ORMExperience\n",
"from people.models import ORMPerson\n",
"from profiles.models import ORMProfile\n",
"def FUNC_0(self):...\n",
"... | [
"import json\n",
"from django.conf import settings\n",
"from django.test import TestCase, Client\n",
"from django.urls import reverse\n",
"from experiences.models import ORMExperience\n",
"from people.models import ORMPerson\n",
"from profiles.models import ORMProfile\n",
"def test_when_called_redirec... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_read_json(%s, %s)', VAR_3[:500], str(VAR_6)[:500])\n",
"if not self._requests:\n",
"return None\n",
"VAR_6.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == VAR_3:\n",
"self.fail('Unknown request %s' % VAR_3)\n"... | [
"def _url_read_json(self, url, **kwargs):...\n",
"logging.warn('url_read_json(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_5(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = VAR_3.type\n",
"return VAR_3\n"
] | [
"def t_LPAR(self, tok):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = tok.type\n",
"return tok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_8, VAR_9, VAR_10=None, VAR_11=None, VAR_12=(...\n",
"get_and_check_project(VAR_9, VAR_11, VAR_12)\n",
"VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n",
"VAR_28.pending_action = VAR_8\n",
"VAR_28.last_error = None\n",
"VAR_28.save()\n",
"scheduler.process_pending_tasks(ba... | [
"def set_pending_action(self, pending_action, request, pk=None, project_pk=...\n",
"get_and_check_project(request, project_pk, perms)\n",
"task = self.queryset.get(pk=pk, project=project_pk)\n",
"task.pending_action = pending_action\n",
"task.last_error = None\n",
"task.save()\n",
"scheduler.process_pen... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_19 = self.common.get_volume_stats(VAR_5)\n",
"VAR_19['storage_protocol'] = 'iSCSI'\n",
"VAR_20 = self.configuration.safe_get('volume_backend_name')\n",
"VAR_19['volume_backend_name'] = VAR_20 or self.__class__.__name__... | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"stats = self.common.get_volume_stats(refresh)\n",
"stats['storage_protocol'] = 'iSCSI'\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_8(VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = []\n",
"VAR_26 = []\n",
"VAR_27 = CommerceConfiguration.current()\n",
"VAR_28 = {'username': VAR_10.username}\n",
"VAR_29 = VAR_27.is_cache_enabled\n",
"VAR_30 = VAR_27.CACHE_KEY + '.' + str(VAR_10.id) if VAR_29 else None\n",
"VAR_31 =... | [
"def get_user_orders(user):...\n",
"\"\"\"docstring\"\"\"\n",
"no_data = []\n",
"user_orders = []\n",
"commerce_configuration = CommerceConfiguration.current()\n",
"user_query = {'username': user.username}\n",
"use_cache = commerce_configuration.is_cache_enabled\n",
"cache_key = commerce_configuration... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_1, VAR_2):...\n",
"if VAR_2:\n",
"VAR_15 = self.DOMAIN + '/wiki/' + VAR_1\n",
"VAR_15 = self.DOMAIN + VAR_1\n",
"return VAR_15\n"
] | [
"def build_url(self, wiki_topic, add_wiki_text):...\n",
"if add_wiki_text:\n",
"url = self.DOMAIN + '/wiki/' + wiki_topic\n",
"url = self.DOMAIN + wiki_topic\n",
"return url\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"assert self.response.status_code == 302\n",
"assert self.response['Location'] == '{}{}?token=ABXZ'.format(settings.\n APP_DEEPLINK_DOMAIN, '/people/me/login')\n",
"return self\n"
] | [
"def then_response_should_be_a_redirect_to_app_deeplink_with_params(self):...\n",
"assert self.response.status_code == 302\n",
"assert self.response['Location'] == '{}{}?token=ABXZ'.format(settings.\n APP_DEEPLINK_DOMAIN, '/people/me/login')\n",
"return self\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Assert'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"CLASS_5.ScenarioMaker().given_an_apple_appid('ASDF.com.myapp.ios'\n ).when_call_aasa().then_response_should_be_json(\n '{\"applinks\": {\"apps\": [], \"details\": [{\"appID\": \"ASDF.com.myapp.ios\", \"paths\": [\"*\"]}]}}'\n )\n"
] | [
"def test_aasa_returns_json_with_appid(self):...\n",
"AASATestCase.ScenarioMaker().given_an_apple_appid('ASDF.com.myapp.ios'\n ).when_call_aasa().then_response_should_be_json(\n '{\"applinks\": {\"apps\": [], \"details\": [{\"appID\": \"ASDF.com.myapp.ios\", \"paths\": [\"*\"]}]}}'\n )\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_8 = 'test_foo.py'\n",
"VAR_7 = BokChoyTestSuite('', test_spec=spec)\n",
"VAR_1 = 'tests/{}'.format(VAR_8)\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name))\n"
] | [
"def test_suite_spec(self):...\n",
"spec = 'test_foo.py'\n",
"suite = BokChoyTestSuite('', test_spec=spec)\n",
"name = 'tests/{}'.format(spec)\n",
"self.assertEqual(suite.cmd, self._expected_command(name=name))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.use_instance_names = ['katotest%sa' % self.test_id, 'katotest%sb' %\n self.test_id, 'katotest%sc' % self.test_id]\n",
"self.use_instance_zones = [self.bindings['TEST_GCE_ZONE'], 'us-central1-b',\n self.bindings['TEST_GCE_ZONE']]\n",
"if self.u... | [
"def create_instances(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.use_instance_names = ['katotest%sa' % self.test_id, 'katotest%sb' %\n self.test_id, 'katotest%sc' % self.test_id]\n",
"self.use_instance_zones = [self.bindings['TEST_GCE_ZONE'], 'us-central1-b',\n self.bindings['TEST_GCE_ZONE']]\n",
... | [
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'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_17(self, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"self._eql_execute('volume', 'select', VAR_18['volume_name'], 'snapshot',\n 'delete', VAR_18['name'])\n",
"VAR_0.error(_('Failed to delete snapshot %(snap)s of volume %(vol)s'), {\n 'snap': VAR_18['name'], 'vol': VAR_18['volume_name']})\n"
] | [
"def delete_snapshot(self, snapshot):...\n",
"\"\"\"docstring\"\"\"\n",
"self._eql_execute('volume', 'select', snapshot['volume_name'], 'snapshot',\n 'delete', snapshot['name'])\n",
"LOG.error(_('Failed to delete snapshot %(snap)s of volume %(vol)s'), {\n 'snap': snapshot['name'], 'vol': snapshot['volum... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_5=''):...\n",
"VAR_8 = get_surveys_by_email(self.current_user, 10)\n",
"self.render('index.html', message=msg, VAR_8=surveys)\n"
] | [
"def get(self, msg=''):...\n",
"surveys = get_surveys_by_email(self.current_user, 10)\n",
"self.render('index.html', message=msg, surveys=surveys)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_4, VAR_5):...\n",
"if VAR_4 == 'ansible_group_priority':\n",
"self.set_priority(int(VAR_5))\n",
"self.vars[VAR_4] = VAR_5\n"
] | [
"def set_variable(self, key, value):...\n",
"if key == 'ansible_group_priority':\n",
"self.set_priority(int(value))\n",
"self.vars[key] = value\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = jc.Contract()\n",
"return st.OperationContract(self.agent.make_delete_app_operation(VAR_1=self\n .bindings, application=self.TEST_APP), VAR_6=contract)\n"
] | [
"def delete_app(self):...\n",
"\"\"\"docstring\"\"\"\n",
"contract = jc.Contract()\n",
"return st.OperationContract(self.agent.make_delete_app_operation(bindings=\n self.bindings, application=self.TEST_APP), contract=contract)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"return True\n"
] | [
"def is_active(self):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"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'"
] |
[
"@classmethod...\n",
"if not VAR_15 or VAR_15 == '*':\n",
"return []\n",
"VAR_32 = raw_sql(\n 'SELECT rowid FROM FtsIndex WHERE FtsIndex MATCH $query ORDER BY bm25(FtsIndex) LIMIT $lim'\n )\n",
"return VAR_14.select(lambda g: g.rowid in VAR_32)\n"
] | [
"@classmethod...\n",
"if not query or query == '*':\n",
"return []\n",
"fts_ids = raw_sql(\n 'SELECT rowid FROM FtsIndex WHERE FtsIndex MATCH $query ORDER BY bm25(FtsIndex) LIMIT $lim'\n )\n",
"return cls.select(lambda g: g.rowid in fts_ids)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_4 = self.live_server_url + '/datagroups/'\n",
"self.browser.get(VAR_4)\n",
"self.browser.find_element_by_xpath('//*[@title=\"edit\"]').click()\n",
"VAR_6 = self.browser.find_element_by_name('cancel')\n",
"self.assertEqual(VAR_6.get_attribute('href'), VAR_4,\n 'User should... | [
"def test_datagroup(self):...\n",
"list_url = self.live_server_url + '/datagroups/'\n",
"self.browser.get(list_url)\n",
"self.browser.find_element_by_xpath('//*[@title=\"edit\"]').click()\n",
"btn = self.browser.find_element_by_name('cancel')\n",
"self.assertEqual(btn.get_attribute('href'), list_url,\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_16(self, VAR_25, VAR_26='', VAR_21=True):...\n",
"VAR_20 = request_mock(VAR_25)\n",
"VAR_20.args = VAR_26\n",
"return self._render(VAR_20, VAR_21)\n"
] | [
"def get(self, path, get_args='', as_json=True):...\n",
"request = request_mock(path)\n",
"request.args = get_args\n",
"return self._render(request, as_json)\n"
] | [
0,
5,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_32(self):...\n",
"VAR_44 = VAR_54.get_doc(self.doctype, self.name).as_dict()\n",
"for VAR_7 in self.as_dict():\n",
"VAR_25 = self.meta.get_field(VAR_7)\n",
"VAR_60 = VAR_44.get(VAR_7)\n",
"if VAR_25 and not VAR_25.allow_on_submit and (self.get(VAR_7) or VAR_60):\n",
"if VAR_25.fieldtype == 'Ta... | [
"def _validate_update_after_submit(self):...\n",
"db_values = frappe.get_doc(self.doctype, self.name).as_dict()\n",
"for key in self.as_dict():\n",
"df = self.meta.get_field(key)\n",
"db_value = db_values.get(key)\n",
"if df and not df.allow_on_submit and (self.get(key) or db_value):\n",
"if df.fieldtyp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_1(self, VAR_2, **VAR_1):...\n",
"if VAR_2.GET.get('keyword'):\n",
"VAR_4 = VAR_2.GET.get('keyword')\n",
"VAR_3 = self.get_context_data()\n",
"return HttpResponseRedirect(VAR_4)\n",
"return self.render_to_response(VAR_3)\n"
] | [
"def get(self, request, **kwargs):...\n",
"if request.GET.get('keyword'):\n",
"domain = request.GET.get('keyword')\n",
"context = self.get_context_data()\n",
"return HttpResponseRedirect(domain)\n",
"return self.render_to_response(context)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_6(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"return dump_cookie(self.app.config.get('SESSION_COOKIE_NAME'), VAR_8,\n max_age=float(self.app.config.get('PERMANENT_SESSION_LIFETIME')), path=\n self.app.config.get('SESSION_COOKIE_PATH'), domain=self.app.config.get(\n 'SESSION_COOKIE_DOMAIN... | [
"def dump_session_cookie(self, session_id):...\n",
"\"\"\"docstring\"\"\"\n",
"return dump_cookie(self.app.config.get('SESSION_COOKIE_NAME'), session_id,\n max_age=float(self.app.config.get('PERMANENT_SESSION_LIFETIME')), path=\n self.app.config.get('SESSION_COOKIE_PATH'), domain=self.app.config.get(\n ... | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_17(self, VAR_9=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(VAR_13.PROCESS_TYPE_PLASMA_STORE, VAR_9=check_alive)\n"
] | [
"def kill_plasma_store(self, check_alive=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(ray_constants.PROCESS_TYPE_PLASMA_STORE,\n check_alive=check_alive)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_1(self, VAR_4):...\n",
"VAR_4 = u\"'{0}'\".format(VAR_4)\n",
"return VAR_4\n"
] | [
"def insert_format(self, value):...\n",
"value = u\"'{0}'\".format(value)\n",
"return value\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_15 = self.path\n",
"if VAR_15.startswith('/chromium/src/+/master'):\n",
"VAR_15 = VAR_15[len('/chromium/src/+/master'):]\n",
"VAR_16 = os.path.realpath(os.path.join(self.server.top_level, VAR_15[1:]))\n",
"if not VAR_16.startswith(self.server.top_level):\n",
"self._DoUnkno... | [
"def do_GET(self):...\n",
"path = self.path\n",
"if path.startswith('/chromium/src/+/master'):\n",
"path = path[len('/chromium/src/+/master'):]\n",
"full_path = os.path.realpath(os.path.join(self.server.top_level, path[1:]))\n",
"if not full_path.startswith(self.server.top_level):\n",
"self._DoUnknown()... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@functools.wraps(VAR_3)...\n",
"VAR_23 = VAR_5.pop('timeout', None)\n",
"VAR_24 = eventlet.spawn(VAR_3, self, *VAR_4, **kwargs)\n",
"if VAR_23 is None:\n",
"return VAR_24.wait()\n",
"VAR_36 = eventlet.spawn_after(VAR_23, VAR_24.kill)\n",
"VAR_48 = VAR_24.wait()\n",
"VAR_36.cancel()\n",
"return VAR_... | [
"@functools.wraps(f)...\n",
"timeout = kwargs.pop('timeout', None)\n",
"gt = eventlet.spawn(f, self, *args, **kwargs)\n",
"if timeout is None:\n",
"return gt.wait()\n",
"kill_thread = eventlet.spawn_after(timeout, gt.kill)\n",
"res = gt.wait()\n",
"kill_thread.cancel()\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"\"\"\"\nThis module contains ...\n\"\"\"\n",
"from __future__ import division, absolute_import\n",
"import cPickle as pickle\n",
"import pickle\n",
"import os\n",
"import time\n",
"import fnmatch\n",
"import hashlib\n",
"import re\n",
"import stat\n",
"import errno\n",
"from twisted.python im... | [
"\"\"\"\nThis module contains ...\n\"\"\"\n",
"from __future__ import division, absolute_import\n",
"import cPickle as pickle\n",
"import pickle\n",
"import os\n",
"import time\n",
"import fnmatch\n",
"import hashlib\n",
"import re\n",
"import stat\n",
"import errno\n",
"from twisted.python im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'... |
[
"def FUNC_11(VAR_1, **VAR_6):...\n",
"import sql\n",
"VAR_43 = 'install_haproxy.sh'\n",
"VAR_44 = sql.get_setting('tmp_config_path')\n",
"VAR_45 = sql.get_setting('haproxy_sock_port')\n",
"VAR_46 = sql.get_setting('stats_port')\n",
"VAR_47 = sql.get_setting('server_state_file')\n",
"VAR_48 = sql.get_s... | [
"def install_haproxy(serv, **kwargs):...\n",
"import sql\n",
"script = 'install_haproxy.sh'\n",
"tmp_config_path = sql.get_setting('tmp_config_path')\n",
"haproxy_sock_port = sql.get_setting('haproxy_sock_port')\n",
"stats_port = sql.get_setting('stats_port')\n",
"server_state_file = sql.get_setting('se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_13(self):...\n",
"VAR_4 = {'r': u'not ascii £ һ'}\n",
"VAR_1 = 'http://my.url.com'\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(VAR_1), mox.IgnoreArg(), timeout\n =mox.IgnoreArg()).AndReturn(StringIO.StringIO(VAR_2))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(ur... | [
"def testNonAcsiiData(self):...\n",
"data = {'r': u'not ascii £ һ'}\n",
"url = 'http://my.url.com'\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(mox.StrContains(url), mox.IgnoreArg(), timeout=\n mox.IgnoreArg()).AndReturn(StringIO.StringIO(response))\n",
"self._mox.ReplayAll()\n",
"self.asse... | [
0,
0,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(VAR_16, VAR_18, VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_47 = {}\n",
"VAR_46 = reader.KeywordToken\n",
"for VAR_76, v in keyworder.get_author_keywords(VAR_16, VAR_18, VAR_17).items():\n",
"VAR_47[VAR_46(VAR_76, type='author-kw')] = v\n",
"return VAR_47\n"
] | [
"def extract_author_keywords(skw_db, ckw_db, fulltext):...\n",
"\"\"\"docstring\"\"\"\n",
"akw = {}\n",
"K = reader.KeywordToken\n",
"for k, v in keyworder.get_author_keywords(skw_db, ckw_db, fulltext).items():\n",
"akw[K(k, type='author-kw')] = v\n",
"return akw\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_31(self, VAR_35, VAR_32):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_60 = {p for val in VAR_35 for p in val.split(',')}\n",
"if not VAR_60:\n",
"return {}\n",
"VAR_61 = {}\n",
"VAR_62 = get_buildroot()\n",
"VAR_63 = self.context.products.get_data('runtime_classpath')\n",
"for VAR_36 in VAR_32:... | [
"def _find_scalac_plugins(self, scalac_plugins, classpath):...\n",
"\"\"\"docstring\"\"\"\n",
"plugin_names = {p for val in scalac_plugins for p in val.split(',')}\n",
"if not plugin_names:\n",
"return {}\n",
"active_plugins = {}\n",
"buildroot = get_buildroot()\n",
"cp_product = self.context.products... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_25(self, VAR_32):...\n",
"VAR_25 = self.marks[0][0]\n",
"VAR_71 = self.finish()\n",
"VAR_32.timing(VAR_25, VAR_71['duration_ms'])\n",
"for FUNC_22, duration in six.iteritems(VAR_71['marks_ms']):\n",
"VAR_32.timing('{}.{}'.format(VAR_25, FUNC_22), duration)\n"
] | [
"def send_metrics_to(self, metrics):...\n",
"name = self.marks[0][0]\n",
"final = self.finish()\n",
"metrics.timing(name, final['duration_ms'])\n",
"for mark, duration in six.iteritems(final['marks_ms']):\n",
"metrics.timing('{}.{}'.format(name, mark), duration)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_4(self, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_4.id is None:\n",
"if VAR_4.id in self.__id_map:\n",
"if not self.__allow_none_id:\n",
"self.__id_map[VAR_4.id] = VAR_4\n",
"if hasattr(VAR_4, 'slug') and not VAR_4.slug is None:\n",
"if VAR_4.slug in self.__slug_map:\n",
"self.... | [
"def add(self, entity):...\n",
"\"\"\"docstring\"\"\"\n",
"if not entity.id is None:\n",
"if entity.id in self.__id_map:\n",
"if not self.__allow_none_id:\n",
"self.__id_map[entity.id] = entity\n",
"if hasattr(entity, 'slug') and not entity.slug is None:\n",
"if entity.slug in self.__slug_map:\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_5):...\n",
"if self.table_view.verticalScrollBar().value(\n",
"self.load_channels()\n"
] | [
"def _on_list_scroll(self, event):...\n",
"if self.table_view.verticalScrollBar().value(\n",
"self.load_channels()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"self.uut.gives_corrected = True\n",
"VAR_1 = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a', 'b']))\n",
"self.assertEqual((), VAR_1)\n",
"VAR_1 = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a']))\n",
"self.assertEqual(len(VAR_1), 1)\n"
] | [
"def test_gives_corrected(self):...\n",
"self.uut.gives_corrected = True\n",
"out = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a', 'b']))\n",
"self.assertEqual((), out)\n",
"out = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a']))\n",
"self.assertEqual(len(out), 1)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"VAR_14 = ['http://8.9.10.11:8080', 'https://9.10.11.12:4433']\n",
"VAR_15 = self.new_mocked_cluster(VAR_14, FUNC_0)\n",
"self._assert_providers(VAR_15, [(urlparse.urlparse(p).netloc, p) for p in\n VAR_14])\n"
] | [
"def test_conf_providers_with_scheme(self):...\n",
"conf_managers = ['http://8.9.10.11:8080', 'https://9.10.11.12:4433']\n",
"api = self.new_mocked_cluster(conf_managers, _validate_conn_up)\n",
"self._assert_providers(api, [(urlparse.urlparse(p).netloc, p) for p in\n conf_managers])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_17, VAR_18):...\n",
"self.name = VAR_18\n",
"self.path = VAR_17 + '/scripts/' + VAR_18\n",
"self.exists = FUNC_6(self.path)\n",
"if not self.exists:\n",
"return\n",
"self.lines = list(self.read_file())\n"
] | [
"def __init__(self, app_path, name):...\n",
"self.name = name\n",
"self.path = app_path + '/scripts/' + name\n",
"self.exists = file_exists(self.path)\n",
"if not self.exists:\n",
"return\n",
"self.lines = list(self.read_file())\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_13(self, VAR_2, VAR_3, VAR_4, *VAR_5):...\n",
"self.write_data({'type': 'market_ask', 'event': VAR_5[0]})\n"
] | [
"def on_market_ask(self, subject, changetype, objectID, *args):...\n",
"self.write_data({'type': 'market_ask', 'event': args[0]})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_8, VAR_9):...\n",
"for line in VAR_8:\n",
"if line.startswith(VAR_9):\n",
"return\n",
"return line[len(VAR_9):]\n"
] | [
"def _get_prefixed_value(self, lines, prefix):...\n",
"for line in lines:\n",
"if line.startswith(prefix):\n",
"return\n",
"return line[len(prefix):]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_1):...\n",
"for key in VAR_6.__all__:\n",
"if not hasattr(VAR_1, key):\n",
"setattr(VAR_1, key, getattr(VAR_6, key))\n"
] | [
"def _include_filters(obj):...\n",
"for key in filters.__all__:\n",
"if not hasattr(obj, key):\n",
"setattr(obj, key, getattr(filters, key))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_5(self) ->'Report':...\n",
"\"\"\"docstring\"\"\"\n",
"self.body = []\n",
"self.data = SharedCache()\n",
"self.files = SharedCache()\n",
"self._last_update_time = time.time()\n",
"return self\n"
] | [
"def clear(self) ->'Report':...\n",
"\"\"\"docstring\"\"\"\n",
"self.body = []\n",
"self.data = SharedCache()\n",
"self.files = SharedCache()\n",
"self._last_update_time = time.time()\n",
"return self\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_9, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def ensure_export(self, context, volume):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_0(VAR_2):...\n",
"if VAR_2[2] == '':\n",
"VAR_8 = VAR_2[0] + ' is ' + VAR_2[1] + '.'\n",
"if VAR_2[0][2] != '' and VAR_2[2]:\n",
"return VAR_8\n",
"VAR_8 = VAR_2[0] + ' brewed in ' + VAR_2[2] + ' is ' + VAR_2[1] + '.'\n"
] | [
"def formatReply(result):...\n",
"if result[2] == '':\n",
"reply = result[0] + ' is ' + result[1] + '.'\n",
"if result[0][2] != '' and result[2]:\n",
"return reply\n",
"reply = result[0] + ' brewed in ' + result[2] + ' is ' + result[1] + '.'\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_0(self):...\n",
"VAR_1, VAR_2 = 'firstuser', 'password'\n",
"VAR_3 = 'autotest@deis.io'\n",
"VAR_4 = {'username': VAR_1, 'password': VAR_2, 'email': VAR_3}\n",
"VAR_5 = '/api/auth/register'\n",
"VAR_6 = self.client.post(VAR_5, json.dumps(VAR_4), content_type=\n 'application/json')\n",
"self... | [
"def test_first_signup(self):...\n",
"username, password = 'firstuser', 'password'\n",
"email = 'autotest@deis.io'\n",
"submit = {'username': username, 'password': password, 'email': email}\n",
"url = '/api/auth/register'\n",
"response = self.client.post(url, json.dumps(submit), content_type=\n 'applic... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self, VAR_11):...\n",
"return VAR_11.name\n"
] | [
"def get_object_id(self, keypair):...\n",
"return keypair.name\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_7=3, VAR_8='peek', VAR_9=256, **VAR_1):...\n",
"super().__init__(VAR_8, **kwargs)\n",
"self.timeout = VAR_7\n",
"self.maxlen = VAR_9\n",
"self.argparse.add_argument('-u', '--udp', action='store_true', dest='udp',\n default=False, help='Use UDP instead of TCP')\n",
"self.argparse... | [
"def __init__(self, timeout=3, command_name='peek', maxlen=256, **kwargs):...\n",
"super().__init__(command_name, **kwargs)\n",
"self.timeout = timeout\n",
"self.maxlen = maxlen\n",
"self.argparse.add_argument('-u', '--udp', action='store_true', dest='udp',\n default=False, help='Use UDP instead of TCP')... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_42, VAR_43):...\n",
"if not VAR_101.user_is_loggedin or VAR_101.user.needs_captcha():\n",
"if not captcha.valid_solution(VAR_42, VAR_43):\n",
"VAR_101.errors.add(errors.BAD_CAPTCHA)\n"
] | [
"def run(self, iden, solution):...\n",
"if not c.user_is_loggedin or c.user.needs_captcha():\n",
"if not captcha.valid_solution(iden, solution):\n",
"c.errors.add(errors.BAD_CAPTCHA)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Expr'"
] |
[
"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'"
] |
[
"def FUNC_2(self, VAR_8, VAR_9, VAR_10=None, VAR_11=None, VAR_12=(...\n",
"get_and_check_project(VAR_9, VAR_11, VAR_12)\n",
"VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n",
"VAR_28.pending_action = VAR_8\n",
"VAR_28.last_error = None\n",
"VAR_28.save()\n",
"scheduler.process_pending_tasks(ba... | [
"def set_pending_action(self, pending_action, request, pk=None, project_pk=...\n",
"get_and_check_project(request, project_pk, perms)\n",
"task = self.queryset.get(pk=pk, project=project_pk)\n",
"task.pending_action = pending_action\n",
"task.last_error = None\n",
"task.save()\n",
"scheduler.process_pen... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_5(self, VAR_0, VAR_1):...\n",
"VAR_1 = self.kwargs['pk']\n",
"VAR_15 = Event.objects.filter(Q(id__in=Hunt(id=pk).events.all())).order_by(\n '-publish_timestamp')\n",
"return VAR_15\n"
] | [
"def get_queryset(self, request, pk):...\n",
"pk = self.kwargs['pk']\n",
"query = Event.objects.filter(Q(id__in=Hunt(id=pk).events.all())).order_by(\n '-publish_timestamp')\n",
"return query\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"if VAR_6:\n",
"VAR_15 = Announce.by_id(VAR_6, self.sql_session).scalar()\n",
"self._['user_groups'] = GroupList.get_user_groups(self.current_user.key,\n self.sql_session)\n",
"if not VAR_15:\n",
"self.page_render(self._)\n",
"self._['a... | [
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"if ann_id:\n",
"ann = Announce.by_id(ann_id, self.sql_session).scalar()\n",
"self._['user_groups'] = GroupList.get_user_groups(self.current_user.key,\n self.sql_session)\n",
"if not ann:\n",
"self.page_render(self._)\n",
"self._['ann_i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"VAR_14 = 'select comment from comments where userid=%d order by date;'\n",
"VAR_15 = sql.queryDB(self.conn, VAR_14)\n",
"return VAR_15\n"
] | [
"def getAllComments(self):...\n",
"sqlText = 'select comment from comments where userid=%d order by date;'\n",
"allposts = sql.queryDB(self.conn, sqlText)\n",
"return allposts\n"
] | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, *VAR_7, **VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_9 in VAR_7:\n",
"self._set_inoutput_item(VAR_9, VAR_7=True)\n",
"for VAR_10, VAR_9 in VAR_8.items():\n",
"self._set_inoutput_item(VAR_9, VAR_7=True, VAR_10=name)\n",
"for VAR_9 in self.output:\n",
"if self.dynamic_output an... | [
"def set_output(self, *output, **kwoutput):...\n",
"\"\"\"docstring\"\"\"\n",
"for item in output:\n",
"self._set_inoutput_item(item, output=True)\n",
"for name, item in kwoutput.items():\n",
"self._set_inoutput_item(item, output=True, name=name)\n",
"for item in self.output:\n",
"if self.dynamic_outp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'",
"For",
"Expr'",
"For",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'"
] |
[
"def FUNC_6(self, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_4 is None:\n",
"VAR_4 = self.login_data.get('username')\n",
"if '+86' not in VAR_4:\n",
"if not VAR_4:\n",
"VAR_4 = '+86' + VAR_4\n",
"if VAR_5 is None:\n",
"VAR_4 = input('请输入手机号:')\n",
"VAR_5 = self.login_data.get('passwo... | [
"def _check_user_pass(self, username, password):...\n",
"\"\"\"docstring\"\"\"\n",
"if username is None:\n",
"username = self.login_data.get('username')\n",
"if '+86' not in username:\n",
"if not username:\n",
"username = '+86' + username\n",
"if password is None:\n",
"username = input('请输入手机号:')\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def FUNC_5(self, VAR_1, VAR_2, VAR_8=None, VAR_9='form', VAR_4=None, VAR_14...\n",
"VAR_29 = super(CLASS_0, self).fields_view_get(VAR_1, VAR_2, VAR_8, VAR_9,\n VAR_4, VAR_14=toolbar, VAR_15=submenu)\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"if 'location' in VAR_4 and VAR_4['location']:\n",
"VAR_51 =... | [
"def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=...\n",
"res = super(product_product, self).fields_view_get(cr, uid, view_id,\n view_type, context, toolbar=toolbar, submenu=submenu)\n",
"if context is None:\n",
"context = {}\n",
"if 'location' in context and context['location'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"For",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition... |
[
"def FUNC_6(self, VAR_41):...\n",
"if VAR_41:\n",
"return self.error()\n",
"return Thing._by_fullname(VAR_41, False, data=True)\n"
] | [
"def run(self, fullname):...\n",
"if fullname:\n",
"return self.error()\n",
"return Thing._by_fullname(fullname, False, data=True)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"@VAR_2.route('/<string:filename>')...\n",
"VAR_16 = os.path.join(VAR_1, VAR_16)\n",
"if os.path.exists(VAR_16):\n",
"VAR_86 = f.read()\n",
"abort(404)\n",
"return VAR_86\n"
] | [
"@app.route('/<string:filename>')...\n",
"filename = os.path.join(static_path, filename)\n",
"if os.path.exists(filename):\n",
"response_body = f.read()\n",
"abort(404)\n",
"return response_body\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def filter_queryset(self, request, queryset, view):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_16(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = VAR_19(VAR_16, 'dynamic')\n",
"VAR_31 = [VAR_30] if FUNC_10(VAR_30) else VAR_30\n",
"for VAR_3 in VAR_31:\n",
"VAR_52 = list(VAR_5.finditer(VAR_3))\n",
"return VAR_30\n",
"for VAR_29 in VAR_52:\n",
"if VAR_29.group('constraint'):\n"
] | [
"def dynamic(value):...\n",
"\"\"\"docstring\"\"\"\n",
"annotated = flag(value, 'dynamic')\n",
"tocheck = [annotated] if not_iterable(annotated) else annotated\n",
"for file in tocheck:\n",
"matches = list(_wildcard_regex.finditer(file))\n",
"return annotated\n",
"for match in matches:\n",
"if match... | [
0,
0,
7,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"For",
"Condition"
] |
[
"def FUNC_15(VAR_28, VAR_29):...\n",
"VAR_29.setFormatter(logging.Formatter(VAR_26, datefmt=DATE_FORMAT))\n",
"VAR_28.addHandler(VAR_29)\n"
] | [
"def add_handler(logger, handler):...\n",
"handler.setFormatter(logging.Formatter(LOG_FORMAT, datefmt=DATE_FORMAT))\n",
"logger.addHandler(handler)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"VAR_1 = psycopg2.connect('dbname=forum')\n",
"VAR_2 = VAR_1.cursor()\n",
"\"\"\"Return all posts from the 'database', most recent first.\"\"\"\n",
"VAR_2.execute('SELECT time, content FROM posts order by time DESC')\n",
"VAR_3 = ({'content': str(row[1]), 'time': str(row[0])} for row... | [
"def get_posts():...\n",
"db = psycopg2.connect('dbname=forum')\n",
"c = db.cursor()\n",
"\"\"\"Return all posts from the 'database', most recent first.\"\"\"\n",
"c.execute('SELECT time, content FROM posts order by time DESC')\n",
"posts = ({'content': str(row[1]), 'time': str(row[0])} for row in c.fetch... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_11(VAR_7, VAR_8=None):...\n",
"if isinstance(VAR_7, UserExerciseSummary):\n",
"VAR_3 = VAR_7.exercise\n",
"if isinstance(VAR_7, Submission):\n",
"VAR_26 = {'points': VAR_7.get_points(), 'max': VAR_3.max_points,\n 'difficulty': VAR_3.difficulty, 'required': VAR_3.points_to_pass,\n 'confirm_th... | [
"def _points_data(obj, classes=None):...\n",
"if isinstance(obj, UserExerciseSummary):\n",
"exercise = obj.exercise\n",
"if isinstance(obj, Submission):\n",
"data = {'points': obj.get_points(), 'max': exercise.max_points,\n 'difficulty': exercise.difficulty, 'required': exercise.points_to_pass,\n 'con... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_41(self, VAR_27):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = 'chmod o+r %s' % VAR_27\n",
"VAR_33 = self.run_command(VAR_6, VAR_17=10, VAR_19=True)\n",
"if VAR_33['status'] == 0:\n",
"return True\n",
"VAR_4 = 'Exception while making %s readable. Return code was %s'\n",
"self.log_error(VAR_4 %... | [
"def make_archive_readable(self, filepath):...\n",
"\"\"\"docstring\"\"\"\n",
"cmd = 'chmod o+r %s' % filepath\n",
"res = self.run_command(cmd, timeout=10, need_root=True)\n",
"if res['status'] == 0:\n",
"return True\n",
"msg = 'Exception while making %s readable. Return code was %s'\n",
"self.log_err... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Expr'"
] |
[
"from database_writer import get_db\n",
"from process_data import processData\n",
"from threading import Thread\n",
"import logger\n",
"import bracket_utils\n",
"import constants\n",
"import time\n",
"from tweet import tweet\n",
"VAR_0 = False\n",
"VAR_1 = True\n",
"VAR_2 = True\n",
"VAR_3 = l... | [
"from database_writer import get_db\n",
"from process_data import processData\n",
"from threading import Thread\n",
"import logger\n",
"import bracket_utils\n",
"import constants\n",
"import time\n",
"from tweet import tweet\n",
"analyzed_scenes = False\n",
"run_pros = True\n",
"should_tweet = T... | [
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign... |
[
"def FUNC_27(self):...\n",
"VAR_4 = 'hubba-bubba'\n",
"VAR_3 = '/afterlogin/'\n",
"VAR_8 = self.add_outstanding_query(VAR_3)\n",
"VAR_10 = self.dump_session_cookie(VAR_8)\n",
"VAR_11 = auth_response(VAR_8, VAR_4)\n",
"VAR_31 = self.app.dispatch_request()\n",
"VAR_31 = self.app.dispatch_request()\n",
... | [
"def test_logout_service_startingIDP(self):...\n",
"eppn = 'hubba-bubba'\n",
"came_from = '/afterlogin/'\n",
"session_id = self.add_outstanding_query(came_from)\n",
"cookie = self.dump_session_cookie(session_id)\n",
"saml_response = auth_response(session_id, eppn)\n",
"response = self.app.dispatch_reque... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.