lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"@VAR_0.route('/reset', methods=['GET'])...\n",
"VAR_1 = get_dataset_with_id(request.args.get('dataset_id'))\n",
"restore_original(VAR_1.working_copy)\n",
"create_action('restored dataset to original state', VAR_1.id, current_user.id)\n",
"return redirect(request.referrer)\n"
] | [
"@_transform.route('/reset', methods=['GET'])...\n",
"dataset = get_dataset_with_id(request.args.get('dataset_id'))\n",
"restore_original(dataset.working_copy)\n",
"create_action('restored dataset to original state', dataset.id, current_user.id\n )\n",
"return redirect(request.referrer)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@require_http_methods(['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = get_next_url_for_login_page(VAR_3)\n",
"if VAR_3.user.is_authenticated():\n",
"return redirect(VAR_7)\n",
"VAR_11 = FUNC_6(VAR_3)\n",
"VAR_12 = None\n",
"if '?' in VAR_7:\n",
"if is_request_in_themed_site() and not configurat... | [
"@require_http_methods(['GET'])...\n",
"\"\"\"docstring\"\"\"\n",
"redirect_to = get_next_url_for_login_page(request)\n",
"if request.user.is_authenticated():\n",
"return redirect(redirect_to)\n",
"form_descriptions = _get_form_descriptions(request)\n",
"third_party_auth_hint = None\n",
"if '?' in red... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",... |
[
"def FUNC_6():...\n",
"VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n"
] | [
"def _raise_exception():...\n",
"frappe.throw(_('Invalid Search Field'), frappe.DataError)\n"
] | [
0,
4
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_64):...\n",
"self._onsuccess = VAR_64\n"
] | [
"def onsuccess(self, func):...\n",
"self._onsuccess = func\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_44(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def test_latest_match_not_found(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_13(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14, VAR_15 = new_raylet_monitor_log_file(self._ray_params.redirect_output)\n",
"VAR_16 = ray.services.start_raylet_monitor(self._redis_address, VAR_14=\n stdout_file, VAR_15=stderr_file, redis_password=self._ray_params.\n redis_password, config=... | [
"def start_raylet_monitor(self):...\n",
"\"\"\"docstring\"\"\"\n",
"stdout_file, stderr_file = new_raylet_monitor_log_file(self._ray_params.\n redirect_output)\n",
"process_info = ray.services.start_raylet_monitor(self._redis_address,\n stdout_file=stdout_file, stderr_file=stderr_file, redis_password=se... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assert'",
"Assign'"
] |
[
"def FUNC_1(VAR_0, VAR_1, VAR_2, VAR_3):...\n",
"VAR_7 = psycopg2.connect(dbname=pg_connection['database'], user=\n pg_connection['user'], password=pg_connection['password'], host=\n pg_connection['host'])\n",
"VAR_8 = VAR_7.cursor()\n",
"VAR_8.execute('string', (VAR_1, VAR_2, VAR_3))\n",
"VAR_7.commi... | [
"def import_quest_data(pg_connection, quest_tier, quest_desc, creator):...\n",
"conn = psycopg2.connect(dbname=pg_connection['database'], user=\n pg_connection['user'], password=pg_connection['password'], host=\n pg_connection['host'])\n",
"cur = conn.cursor()\n",
"cur.execute(\n \"\"\"\n INSERT I... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getboolean(self.section, 'insecure_cookies')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getboolean(self.section, 'insecure_cookies')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_11(self, VAR_7):...\n",
"VAR_26 = super().get_transform(VAR_7)\n",
"if VAR_26:\n",
"return VAR_26\n",
"if '_' not in VAR_7:\n",
"VAR_18 = int(VAR_7)\n",
"VAR_18 += 1\n",
"VAR_20, VAR_21 = VAR_7.split('_')\n",
"return CLASS_10(VAR_20, VAR_21)\n",
"return CLASS_8(VAR_18, self.base_field)\n... | [
"def get_transform(self, name):...\n",
"transform = super().get_transform(name)\n",
"if transform:\n",
"return transform\n",
"if '_' not in name:\n",
"index = int(name)\n",
"index += 1\n",
"start, end = name.split('_')\n",
"return SliceTransformFactory(start, end)\n",
"return IndexTransformFactory... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"AugAssign'",
"Assign'",
"Return'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_9(self, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"return '%s' % FUNC_12(VAR_10)\n"
] | [
"def sqlForNonNone(self, value):...\n",
"\"\"\"docstring\"\"\"\n",
"return '%s' % QuotedString(value)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"if self._user_notified_about_crash or self._IsServerAlive():\n",
"return\n",
"self._user_notified_about_crash = True\n",
"if self._server_stderr:\n",
"VAR_27 = ''.join(server_stderr_file.readlines()[:-VAR_1])\n",
"vimsupport.PostVimMessage(VAR_3)\n",
"vimsupport.PostMultiLin... | [
"def _NotifyUserIfServerCrashed(self):...\n",
"if self._user_notified_about_crash or self._IsServerAlive():\n",
"return\n",
"self._user_notified_about_crash = True\n",
"if self._server_stderr:\n",
"error_output = ''.join(server_stderr_file.readlines()[:-\n NUM_YCMD_STDERR_LINES_ON_CRASH])\n",
"vimsup... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_22(VAR_18, VAR_31, VAR_30=60):...\n",
"VAR_50 = re.compile('Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.')\n",
"VAR_51 = re.compile('Compilation failed|Evaluated')\n",
"VAR_34 = FUNC_0()\n",
"VAR_52 = 0.1\n",
"while VAR_30 > 0:\n",
"VAR_30 -= VAR_52\n",
"VAR_49 = AWSUserTestViewRequest... | [
"def get_user_test_result(contest_id, user_test_id, timeout=60):...\n",
"WAITING_STATUSES = re.compile('Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.')\n",
"COMPLETED_STATUS = re.compile('Compilation failed|Evaluated')\n",
"browser = get_aws_browser()\n",
"sleep_interval = 0.1\n",
"while timeout > 0:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_47 = re.compile('^.*[,();].*')\n",
"VAR_48 = ['select', 'create', 'insert', 'delete', 'drop', 'update', 'case']\n",
"VAR_49 = ['concat', 'concat_ws', 'if', 'ifnull', 'nullif', 'coalesce',\n 'connection_id', 'current_user', 'database', 'last_insert... | [
"def sanitize_fields(self):...\n",
"\"\"\"docstring\"\"\"\n",
"regex = re.compile('^.*[,();].*')\n",
"blacklisted_keywords = ['select', 'create', 'insert', 'delete', 'drop',\n 'update', 'case']\n",
"blacklisted_functions = ['concat', 'concat_ws', 'if', 'ifnull', 'nullif',\n 'coalesce', 'connection_id'... | [
0,
0,
4,
0,
0,
0,
0,
0,
4,
4,
0,
4,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"For",
"Condition",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"@VAR_0.route('/level-1/index')...\n",
"VAR_3.emit('level-progress-update', {'level_progress': 'test'})\n",
"return render_template('level-1/index.html')\n"
] | [
"@app.route('/level-1/index')...\n",
"socketIO.emit('level-progress-update', {'level_progress': 'test'})\n",
"return render_template('level-1/index.html')\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"print('tag: %s' % self.tag_name)\n",
"print('value: %s' % self.value)\n",
"print('datetimestamp: %s' % self.dtstamp)\n"
] | [
"def log(self):...\n",
"print('tag: %s' % self.tag_name)\n",
"print('value: %s' % self.value)\n",
"print('datetimestamp: %s' % self.dtstamp)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
"VAR_22 = User().get_by_id(VAR_3)\n",
"if VAR_22 is None:\n",
"return VAR_22\n"
] | [
"@staticmethod...\n",
"user = User().get_by_id(user_id)\n",
"if user is None:\n",
"return user\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_26(VAR_5, VAR_8):...\n",
"api.reset_local_state()\n",
"VAR_11[0] = VAR_5\n",
"VAR_15 = VAR_7.get('/request', extra_environ={'REMOTE_ADDR': ip},\n expect_errors=True)\n",
"return VAR_15.status_int\n"
] | [
"def call(ident, ip):...\n",
"api.reset_local_state()\n",
"mocked_ident[0] = ident\n",
"response = app.get('/request', extra_environ={'REMOTE_ADDR': ip},\n expect_errors=True)\n",
"return response.status_int\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = self.get_all_ads()\n",
"[self.delete_ad(i) for t, i in VAR_19 if t.strip() == VAR_8.strip()]\n"
] | [
"def delete_ad_using_title(self, title):...\n",
"\"\"\"docstring\"\"\"\n",
"allAds = self.get_all_ads()\n",
"[self.delete_ad(i) for t, i in allAds if t.strip() == title.strip()]\n"
] | [
0,
0,
5,
5
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(VAR_14, VAR_15, VAR_18=True):...\n",
"VAR_26 = 0\n",
"VAR_27 = len(VAR_15)\n",
"for line in VAR_15:\n",
"if len(line) > VAR_26:\n",
"VAR_14 = (VAR_14[0][0] / VAR_26, VAR_14[0][1]) if VAR_14[0] else None, (\n VAR_14[1][0] / VAR_27, VAR_14[1][1]) if VAR_14[1] else None\n",
"VAR_26 = len(lin... | [
"def grid(dims, files, implicitFillWidth=True):...\n",
"x = 0\n",
"y = len(files)\n",
"for line in files:\n",
"if len(line) > x:\n",
"dims = (dims[0][0] / x, dims[0][1]) if dims[0] else None, (dims[1][0] / y,\n dims[1][1]) if dims[1] else None\n",
"x = len(line)\n",
"if not (dims[0] or dims[1]):\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Return'",
"AugAssign'",
"AugAssign'"
] |
[
"def FUNC_2():...\n",
"VAR_30 = VAR_10.find(' ')\n",
"VAR_24 = VAR_10[:VAR_30]\n",
"VAR_42 = ''\n",
"VAR_12 = VAR_10[VAR_30 + 1:]\n",
"self.emph = 1 if VAR_24.find('*') > -1 else 0\n",
"self.uncover = 2 if VAR_24.find('+') > -1 else 0\n",
"self.kind = 0\n",
"self.resume = False\n",
"if VAR_24.find... | [
"def innerFunc():...\n",
"i = txt.find(' ')\n",
"marker = txt[:i]\n",
"describee = ''\n",
"content = txt[i + 1:]\n",
"self.emph = 1 if marker.find('*') > -1 else 0\n",
"self.uncover = 2 if marker.find('+') > -1 else 0\n",
"self.kind = 0\n",
"self.resume = False\n",
"if marker.find('.') > -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'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Ass... |
[
"@property...\n",
"VAR_11 = await self.content\n",
"if not VAR_11:\n",
"return ''\n",
"return VAR_0(VAR_11)\n"
] | [
"@property...\n",
"content = await self.content\n",
"if not content:\n",
"return ''\n",
"return markdown(content)\n"
] | [
0,
3,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(VAR_27):...\n",
"VAR_38 = str(VAR_27.author)\n",
"VAR_36 = datetime.utcfromtimestamp(VAR_27.created_utc)\n",
"FUNC_2(VAR_14=str(message.author), VAR_18='message', VAR_25=message_time.\n strftime('%Y-%m-%d %H:%M:%S'), VAR_15='private_key', VAR_26=str(message\n .body)[:255])\n",
"VAR_13.exec... | [
"def handle_private_key(message):...\n",
"author = str(message.author)\n",
"message_time = datetime.utcfromtimestamp(message.created_utc)\n",
"add_history_record(username=str(message.author), comment_or_message=\n 'message', reddit_time=message_time.strftime('%Y-%m-%d %H:%M:%S'),\n action='private_key',... | [
0,
4,
0,
4,
4,
0,
0,
4,
4,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"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_3(self, VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"return webtest.TestApp(webapp2.WSGIApplication([(VAR_0, VAR_1)], debug=True\n ), extra_environ={'REMOTE_ADDR': '127.0.0.1'})\n"
] | [
"def make_test_app(self, path, request_handler):...\n",
"\"\"\"docstring\"\"\"\n",
"return webtest.TestApp(webapp2.WSGIApplication([(path, request_handler)],\n debug=True), extra_environ={'REMOTE_ADDR': '127.0.0.1'})\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self, VAR_10, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_10:\n",
"for rec in self:\n",
"VAR_36 = safe_eval(VAR_10, {'object': rec, 'env': self.env})\n",
"logging.error('CRAPO: Failed to validate transition %sconditions: %s',\n VAR_11, str(err))\n",
"if not VAR_36:\n",
"VAR_36 = ... | [
"def exec_conditions(self, conditions, prefix):...\n",
"\"\"\"docstring\"\"\"\n",
"if conditions:\n",
"for rec in self:\n",
"is_valid = safe_eval(conditions, {'object': rec, 'env': self.env})\n",
"logging.error('CRAPO: Failed to validate transition %sconditions: %s',\n prefix, str(err))\n",
"if not i... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"For",
"Assign'",
"Expr'",
"Condition",
"Assign'"
] |
[
"def FUNC_1(self, VAR_2, *VAR_5, **VAR_6):...\n",
"VAR_2 = db.get_dataset(VAR_2)\n",
"VAR_27 = db.User.select()\n",
"VAR_28 = db.DatasetAccessPending.select().where(db.DatasetAccessPending.\n dataset == VAR_2)\n",
"VAR_10 = peewee.prefetch(VAR_27, VAR_28)\n",
"self.finish({'data': self._build_json_resp... | [
"def get(self, dataset, *args, **kwargs):...\n",
"dataset = db.get_dataset(dataset)\n",
"users = db.User.select()\n",
"access = db.DatasetAccessPending.select().where(db.DatasetAccessPending.\n dataset == dataset)\n",
"query = peewee.prefetch(users, access)\n",
"self.finish({'data': self._build_json_re... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(VAR_2):...\n",
"VAR_7 = files.get_static_data('./static/files.html')\n",
"VAR_2 = FUNC_1(VAR_2)\n",
"VAR_2 = '/'\n",
"if not VAR_2:\n",
"VAR_2 = '/'\n",
"VAR_14 = VAR_2.split('/')\n",
"VAR_15 = list()\n",
"while '' in VAR_14:\n",
"VAR_14.remove('')\n",
"VAR_14 = [''] + VAR_14\n",
"... | [
"def get_final_html_async(target_path):...\n",
"file_temp = files.get_static_data('./static/files.html')\n",
"target_path = decode_hexed_b64_to_str(target_path)\n",
"target_path = '/'\n",
"if not target_path:\n",
"target_path = '/'\n",
"files_hierarchy = target_path.split('/')\n",
"files_hierarchy_lis... | [
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,
4,
4,
4,
4,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"Assign'",
"AugAssign'",
"For",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"... |
[
"def __getstate__(self):...\n",
"return self.serialize()\n"
] | [
"def __getstate__(self):...\n",
"return self.serialize()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self, VAR_8) ->str:...\n",
"return '<div class=\"nameparts-form-group\">%s</div>' % ''.join(VAR_8)\n"
] | [
"def format_output(self, rendered_widgets) ->str:...\n",
"return '<div class=\"nameparts-form-group\">%s</div>' % ''.join(rendered_widgets)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_13):...\n",
"VAR_26 = requests.get(VAR_13)\n",
"VAR_27 = VAR_26.content.decode('utf-8')\n",
"logging.info('GET %s responded with %s', VAR_13, VAR_27)\n",
"return json.loads(VAR_27)\n"
] | [
"def get_json_from_url(url):...\n",
"response = requests.get(url)\n",
"decoded_content = response.content.decode('utf-8')\n",
"logging.info('GET %s responded with %s', url, decoded_content)\n",
"return json.loads(decoded_content)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_16(self):...\n",
"if self.doctype not in VAR_54.local.valid_columns:\n",
"if self.doctype in ('DocField', 'DocPerm') and self.parent in ('DocType',\n",
"return VAR_54.local.valid_columns[self.doctype]\n",
"from frappe.model.meta import get_table_columns\n",
"VAR_65 = self.meta.get_valid_columns(... | [
"def get_valid_columns(self):...\n",
"if self.doctype not in frappe.local.valid_columns:\n",
"if self.doctype in ('DocField', 'DocPerm') and self.parent in ('DocType',\n",
"return frappe.local.valid_columns[self.doctype]\n",
"from frappe.model.meta import get_table_columns\n",
"valid = self.meta.get_valid... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_21():...\n",
"\"\"\"docstring\"\"\"\n",
"return 'bibclassify v%s' % (bconfig.VERSION,)\n"
] | [
"def _signature():...\n",
"\"\"\"docstring\"\"\"\n",
"return 'bibclassify v%s' % (bconfig.VERSION,)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"from grokcore.component import Adapter, implements, baseclass\n",
"from grokcore.security import require\n",
"from zope.interface import Interface\n",
"def FUNC_0(VAR_0):...\n",
"def FUNC_1(VAR_0, VAR_1):...\n",
"def FUNC_2(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"def FUNC_3(VAR_2):...\n",
"\"\"\... | [
"from grokcore.component import Adapter, implements, baseclass\n",
"from grokcore.security import require\n",
"from zope.interface import Interface\n",
"def render(request):...\n",
"def render_recursive(request, depth):...\n",
"def rw_transaction(request):...\n",
"\"\"\"docstring\"\"\"\n",
"def resolv... | [
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'",
"FunctionDef'",
"FunctionDef'",
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"For",
"Condition",
"Retur... |
[
"@eqlx.with_timeout...\n",
"return 'no timeout'\n"
] | [
"@eqlx.with_timeout...\n",
"return 'no timeout'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_32(self):...\n",
"VAR_33 = VAR_5.search(self.file)\n",
"if VAR_33:\n",
"return self.file[:VAR_33.start()]\n",
"return self.file\n"
] | [
"def constant_prefix(self):...\n",
"first_wildcard = _wildcard_regex.search(self.file)\n",
"if first_wildcard:\n",
"return self.file[:first_wildcard.start()]\n",
"return self.file\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0():...\n",
"print('\\nQuery options:')\n",
"print('1: List ETCs in the country __ having more than __ open beds.')\n",
"print(\n '2: List average age & education of respondents whose sex=__ and live in __.'\n )\n",
"print(\n '3: Count the respondents whose sex=__ and who have at least... | [
"def print_menu():...\n",
"print('\\nQuery options:')\n",
"print('1: List ETCs in the country __ having more than __ open beds.')\n",
"print(\n '2: List average age & education of respondents whose sex=__ and live in __.'\n )\n",
"print(\n '3: Count the respondents whose sex=__ and who have at l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_56 = in_f.readlines()\n",
"VAR_33 = set(VAR_13.keys())\n",
"for VAR_69, line in enumerate(VAR_56):\n",
"VAR_46 = re.match('^(\\\\s*)\"([^\"]+)\":', line)\n",
"for l in VAR_56:\n",
"if VAR_46:\n",
"out_f.write(l)\n",
"if VAR_33:\n",
"VAR... | [
"def configure_cms(options):...\n",
"\"\"\"docstring\"\"\"\n",
"lines = in_f.readlines()\n",
"unset = set(options.keys())\n",
"for i, line in enumerate(lines):\n",
"g = re.match('^(\\\\s*)\"([^\"]+)\":', line)\n",
"for l in lines:\n",
"if g:\n",
"out_f.write(l)\n",
"if unset:\n",
"whitespace, ke... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_27(self):...\n",
"self.compilation_ko(\n \"\"\"\nif header :is \"Sender\" \"Toto\" & header :contains \"Cc\" \"Tata\" {\n \n}\n\"\"\"\n )\n"
] | [
"def test_unknown_token(self):...\n",
"self.compilation_ko(\n \"\"\"\nif header :is \"Sender\" \"Toto\" & header :contains \"Cc\" \"Tata\" {\n \n}\n\"\"\"\n )\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_2, VAR_3, VAR_4, VAR_7={}):...\n",
"VAR_20 = {'parent_id': VAR_7.get('parent_id', False)}\n",
"for VAR_19 in VAR_4:\n",
"self.copy(VAR_2, VAR_3, VAR_19, VAR_20=default)\n",
"VAR_2.commit()\n"
] | [
"def duplicate_template(self, cr, uid, ids, context={}):...\n",
"default = {'parent_id': context.get('parent_id', False)}\n",
"for id in ids:\n",
"self.copy(cr, uid, id, default=default)\n",
"cr.commit()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self, *VAR_0, **VAR_1):...\n",
"VAR_3 = MetadataStore(os.path.join(self.temporary_directory(), '%d.db' %\n self.count), self.temporary_directory(), default_eccrypto.generate_key(\n u'curve25519'))\n",
"VAR_1['metadata_store'] = VAR_3\n",
"VAR_4 = super(CLASS_0, self).create_node(*VAR_0, **kw... | [
"def create_node(self, *args, **kwargs):...\n",
"metadata_store = MetadataStore(os.path.join(self.temporary_directory(), \n '%d.db' % self.count), self.temporary_directory(), default_eccrypto.\n generate_key(u'curve25519'))\n",
"kwargs['metadata_store'] = metadata_store\n",
"node = super(TestGigaChannel... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"Return'"
] |
[
"def __init__(self):...\n",
"VAR_12 = {}\n",
"self.session = requests.Session()\n"
] | [
"def __init__(self):...\n",
"config = {}\n",
"self.session = requests.Session()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"@property...\n",
"return self._attributes['state']\n"
] | [
"@property...\n",
"return self._attributes['state']\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from __future__ import unicode_literals\n",
"import frappe, json\n",
"from frappe import _\n",
"from frappe.utils import cint, formatdate\n",
"@frappe.whitelist(allow_guest=True)...\n",
"from frappe.www.contact import send_message as website_send_message\n",
"VAR_4 = VAR_5 = None\n",
"website_send_me... | [
"from __future__ import unicode_literals\n",
"import frappe, json\n",
"from frappe import _\n",
"from frappe.utils import cint, formatdate\n",
"@frappe.whitelist(allow_guest=True)...\n",
"from frappe.www.contact import send_message as website_send_message\n",
"lead = customer = None\n",
"website_send_... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Condition",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
... |
[
"def FUNC_6(self, VAR_16):...\n",
"if 'avatar_uploaded' in VAR_16[0] and VAR_16[0]['avatar_uploaded'] is True:\n",
"return\n",
"VAR_32 = []\n",
"for sd in os.walk(VAR_9.av_dir):\n",
"VAR_32.extend(sd[2])\n",
"VAR_33 = os.path.join(sd[0], random.choice(VAR_32))\n",
"self.log.info('Uploading %s as new a... | [
"def upload_avatar(self, ud):...\n",
"if 'avatar_uploaded' in ud[0] and ud[0]['avatar_uploaded'] is True:\n",
"return\n",
"files = []\n",
"for sd in os.walk(c.av_dir):\n",
"files.extend(sd[2])\n",
"av = os.path.join(sd[0], random.choice(files))\n",
"self.log.info('Uploading %s as new avatar', av)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"from django.test import Client\n",
"from dashboard.tests.loader import *\n",
"from django.test import TestCase, override_settings, RequestFactory\n",
"from dashboard.models import DataDocument, Script, ExtractedText, ExtractedChemical, QAGroup\n",
"from django.db.models import Count\n",
"VAR_0 = fixtures... | [
"from django.test import Client\n",
"from dashboard.tests.loader import *\n",
"from django.test import TestCase, override_settings, RequestFactory\n",
"from dashboard.models import DataDocument, Script, ExtractedText, ExtractedChemical, QAGroup\n",
"from django.db.models import Count\n",
"fixtures = fixtu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
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'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Ex... |
[
"@handled_slot(bool)...\n",
"VAR_19, VAR_18 = QInputDialog.getInt(self.window, title=\n 'Set BiFi Motor Position', label='Absolute Position:', value=self.\n matisse.query('MOTBI:POS?', numeric_result=True))\n",
"if VAR_18:\n",
"print(f'Setting BiFi motor position to {VAR_19}.')\n",
"self.matisse.set_b... | [
"@handled_slot(bool)...\n",
"target_pos, success = QInputDialog.getInt(self.window, title=\n 'Set BiFi Motor Position', label='Absolute Position:', value=self.\n matisse.query('MOTBI:POS?', numeric_result=True))\n",
"if success:\n",
"print(f'Setting BiFi motor position to {target_pos}.')\n",
"self.mat... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_2, VAR_1):...\n",
"VAR_5 = 'string' % (VAR_1, VAR_2)\n",
"VAR_6 = sql.queryDB(self.conn, VAR_5)\n",
"return VAR_6\n"
] | [
"def getCommentsByPostid(self, postid, userid):...\n",
"sqlText = (\n 'select (select Count(*) from comment_like where comments.commentid = comment_like.commentid) as like,(select Count(*) from comment_like where comments.commentid = comment_like.commentid and comment_like.userid=%d) as flag,commentid,name,com... | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_32(self, VAR_25):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_44 = self.host.sos_path_strip\n",
"if VAR_44:\n",
"VAR_25 = VAR_25.replace(VAR_44, '')\n",
"VAR_25 = VAR_25.split()[0]\n",
"self.log_debug('Final sos path: %s' % VAR_25)\n",
"self.sos_path = VAR_25\n",
"self.archive = VAR_25.split('/... | [
"def finalize_sos_path(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"pstrip = self.host.sos_path_strip\n",
"if pstrip:\n",
"path = path.replace(pstrip, '')\n",
"path = path.split()[0]\n",
"self.log_debug('Final sos path: %s' % path)\n",
"self.sos_path = path\n",
"self.archive = path.split('/')[-1]... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(VAR_24):...\n",
"for VAR_27 in VAR_24:\n",
"if VAR_27['submittable']:\n",
"VAR_27.update({'submission_count': 0, 'submissions': [], 'best_submission':\n None, 'points': 0, 'passed': VAR_27['points_to_pass'] == 0, 'graded': \n False, 'unofficial': False})\n",
"FUNC_7(VAR_27.get('children'))... | [
"def r_augment(children):...\n",
"for entry in children:\n",
"if entry['submittable']:\n",
"entry.update({'submission_count': 0, 'submissions': [], 'best_submission':\n None, 'points': 0, 'passed': entry['points_to_pass'] == 0, 'graded': \n False, 'unofficial': False})\n",
"r_augment(entry.get('childr... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_26(self, VAR_74):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.benchmark = VAR_74\n",
"return VAR_101\n"
] | [
"def benchmark(self, benchmark):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.benchmark = benchmark\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self, VAR_14):...\n",
"self.sleep_ticker.tick()\n",
"self.poll(VAR_14 * 1000)\n",
"while self.sleep_ticker.elapsed(False) < VAR_14:\n",
"self.poll(VAR_14 * 1000)\n",
"return\n"
] | [
"def inter_sleep(self, timeout):...\n",
"self.sleep_ticker.tick()\n",
"self.poll(timeout * 1000)\n",
"while self.sleep_ticker.elapsed(False) < timeout:\n",
"self.poll(timeout * 1000)\n",
"return\n"
] | [
0,
0,
7,
7,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_2=VAR_0, *VAR_3, **VAR_4):...\n",
"super(CLASS_0, self).__init__(*VAR_3, **kwargs)\n",
"self.max_length = VAR_2\n"
] | [
"def __init__(self, max_length=MAX_LENGTH, *args, **kwargs):...\n",
"super(CharField, self).__init__(*args, **kwargs)\n",
"self.max_length = max_length\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_4 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_8 = {'image': 'autotest/example', 'sha': 'a' *... | [
"def test_container_str(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example... | [
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'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_38(self, VAR_84):...\n",
"return [VAR_82 for job in VAR_84.jobs for VAR_82 in job.subworkflow_input if\n job.subworkflow_input[VAR_82] is self]\n"
] | [
"def targets(self, dag):...\n",
"return [f for job in dag.jobs for f in job.subworkflow_input if job.\n subworkflow_input[f] is self]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"return self._params\n"
] | [
"@property...\n",
"return self._params\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"VAR_5 = Mock()\n",
"VAR_5.sendmail.side_effect = lambda VAR_68: succeed(VAR_68)\n",
"return VAR_5\n"
] | [
"def _create_mail_sender(self):...\n",
"mail_sender = Mock()\n",
"mail_sender.sendmail.side_effect = lambda mail: succeed(mail)\n",
"return mail_sender\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"\"\"\"Volume driver for Dell EqualLogic Storage.\"\"\"\n",
"import functools\n",
"import random\n",
"import eventlet\n",
"from eventlet import greenthread\n",
"import greenlet\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\n",
... | [
"\"\"\"Volume driver for Dell EqualLogic Storage.\"\"\"\n",
"import functools\n",
"import random\n",
"import eventlet\n",
"from eventlet import greenthread\n",
"import greenlet\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\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
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Conditi... |
[
"def __init__(self, VAR_18, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"self.auth = VAR_18\n",
"self.data = None\n",
"self.station_data = None\n",
"self.station = VAR_19\n"
] | [
"def __init__(self, auth, station):...\n",
"\"\"\"docstring\"\"\"\n",
"self.auth = auth\n",
"self.data = None\n",
"self.station_data = None\n",
"self.station = station\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = []\n",
"for error in VAR_5:\n",
"if self.filepath not in error.get('path', ''):\n",
"return VAR_11\n",
"VAR_12 = error.get('severity', 'X').capitalize()[0]\n",
"if VAR_12 == 'X':\n",
"if VAR_12 not in ['E', 'W']:\n",
"VAR_12 = '... | [
"def _normalize(self, metaerrors):...\n",
"\"\"\"docstring\"\"\"\n",
"errors = []\n",
"for error in metaerrors:\n",
"if self.filepath not in error.get('path', ''):\n",
"return errors\n",
"error_type = error.get('severity', 'X').capitalize()[0]\n",
"if error_type == 'X':\n",
"if error_type not in ['E... | [
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Expr'"
] |
[
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"from collections import namedtuple\n",
"from pants.backend.jvm.subsystems.jvm_tool_mixin import JvmToolMixin\n",
"from pants.backend.jvm.subsystems.zinc_language_mixin import ZincLanguageMixin\n",
"from pants.backend.jv... | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"from collections import namedtuple\n",
"from pants.backend.jvm.subsystems.jvm_tool_mixin import JvmToolMixin\n",
"from pants.backend.jvm.subsystems.zinc_language_mixin import ZincLanguageMixin\n",
"from pants.backend.jv... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_4(self, **VAR_6):...\n",
"VAR_14 = super().get_context_data(**kwargs)\n",
"return VAR_14\n"
] | [
"def get_context_data(self, **kwargs):...\n",
"context = super().get_context_data(**kwargs)\n",
"return context\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = VAR_0[:]\n",
"if self.enabled():\n",
"VAR_11.append((Allow, self.login, ('view_user', 'edit_user',\n 'list_holidays', 'add_holiday', 'edit_holiday', 'list_competences')))\n",
"return VAR_11\n",
"VAR_11.append((Allow, Authenticated, 'visit... | [
"def get_user_acl(self):...\n",
"\"\"\"docstring\"\"\"\n",
"acl = DEFAULT_PERM[:]\n",
"if self.enabled():\n",
"acl.append((Allow, self.login, ('view_user', 'edit_user', 'list_holidays',\n 'add_holiday', 'edit_holiday', 'list_competences')))\n",
"return acl\n",
"acl.append((Allow, Authenticated, 'visi... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Expr'"
] |
[
"def FUNC_4(VAR_13, VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = 'string'\n",
"VAR_14.execute(VAR_25)\n",
"VAR_26 = []\n",
"for record in VAR_14:\n",
"VAR_35 = record[0]\n",
"return VAR_26\n",
"VAR_26.append(VAR_35)\n"
] | [
"def get_all_old_sources(conn, sqlite):...\n",
"\"\"\"docstring\"\"\"\n",
"query = \"\"\"\n SELECT\n source\n FROM\n source\n GROUP BY\n source\n \"\"\"\n",
"sqlite.execute(query)\n",
"old_sources = []\n",
"for record in sqlite:\n",
"old_source = ... | [
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_33):...\n",
"if not VAR_33:\n",
"VAR_101.errors.add(self.error)\n",
"VAR_33 = float(VAR_33)\n",
"VAR_101.errors.add(self.error)\n",
"return\n",
"if self.min is not None and VAR_33 < self.min:\n",
"VAR_33 = self.min\n",
"if self.max is not None and VAR_33 > self.max:\n",
"retu... | [
"def run(self, val):...\n",
"if not val:\n",
"c.errors.add(self.error)\n",
"val = float(val)\n",
"c.errors.add(self.error)\n",
"return\n",
"if self.min is not None and val < self.min:\n",
"val = self.min\n",
"if self.max is not None and val > self.max:\n",
"return val\n",
"val = self.max\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_2():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = {}\n",
"for arg in request.args:\n",
"VAR_8 = re.findall('psize_(.*)', arg)\n",
"return VAR_6\n",
"if VAR_8:\n",
"VAR_6[VAR_8[0]] = int(request.args.get(arg))\n"
] | [
"def get_page_size_args():...\n",
"\"\"\"docstring\"\"\"\n",
"page_sizes = {}\n",
"for arg in request.args:\n",
"re_match = re.findall('psize_(.*)', arg)\n",
"return page_sizes\n",
"if re_match:\n",
"page_sizes[re_match[0]] = int(request.args.get(arg))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def __init__(self, VAR_21=0):...\n",
"self.maxdepth = VAR_21\n"
] | [
"def __init__(self, maxdepth=0):...\n",
"self.maxdepth = maxdepth\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.message = VAR_73\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.message = message\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def __repr__(self):...\n",
"return u'Nullable({})'.format(repr(self.inner_type))\n"
] | [
"def __repr__(self):...\n",
"return u'Nullable({})'.format(repr(self.inner_type))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(*VAR_0, **VAR_1):...\n",
"VAR_2 = requests.Response()\n",
"VAR_2.status_code = 200\n",
"VAR_2._content_consumed = True\n",
"return VAR_2\n"
] | [
"def mock_import_repository_task(*args, **kwargs):...\n",
"resp = requests.Response()\n",
"resp.status_code = 200\n",
"resp._content_consumed = True\n",
"return resp\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@patch('invenio.ext.session.interface.SessionInterface.save_session')...\n",
"from invenio.modules.oauthclient.models import RemoteToken\n",
"from invenio.modules.oauthclient.handlers import token_getter\n",
"from invenio.modules.oauthclient.client import oauth\n",
"VAR_9 = MagicMock()\n",
"VAR_9.get_id ... | [
"@patch('invenio.ext.session.interface.SessionInterface.save_session')...\n",
"from invenio.modules.oauthclient.models import RemoteToken\n",
"from invenio.modules.oauthclient.handlers import token_getter\n",
"from invenio.modules.oauthclient.client import oauth\n",
"user = MagicMock()\n",
"user.get_id = ... | [
5,
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
] | [
"Condition",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Assert'",
"Expr'",
"Expr'",
"Assert'",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Expr'",
"Expr'",
"Assign'",
"Assert'",
"Assert'",
"Assign'",
"Assert'",
... |
[
"def FUNC_1(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
"def setUp(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
0,
5
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"return 'check submission %s' % self.submission_id\n"
] | [
"def describe(self):...\n",
"return 'check submission %s' % self.submission_id\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self, VAR_5, **VAR_6):...\n",
"self._cur = self._db.cursor()\n",
"self._cur.execute(VAR_5, **args)\n",
"VAR_58 = None\n",
"self._db.commit()\n",
"VAR_58 = self._cur.fetchall()\n",
"self._cur.close()\n",
"return VAR_58\n"
] | [
"def execute(self, command, **args):...\n",
"self._cur = self._db.cursor()\n",
"self._cur.execute(command, **args)\n",
"final_arr = None\n",
"self._db.commit()\n",
"final_arr = self._cur.fetchall()\n",
"self._cur.close()\n",
"return final_arr\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_65, VAR_7, *VAR_15, **VAR_16):...\n",
"self.cache_prefix = VAR_65\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n"
] | [
"def __init__(self, cache_prefix, param, *a, **kw):...\n",
"self.cache_prefix = cache_prefix\n",
"Validator.__init__(self, param, *a, **kw)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
""
] | [
"@classmethod...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_56(self):...\n",
"self._test_strtype('blob', VAR_13, VAR_23(VAR_13))\n"
] | [
"def t(self):...\n",
"self._test_strtype('blob', value, len(value))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@app.route('/metric/api/v1.0/metric/current')...\n",
"VAR_0 = getMetric(request.args.get('fromtime', None), request.args.get(\n 'totime', None), request.args.get('origin', None), request.args.get(\n 'key', None), 1, ('Time', True))\n",
"return jsonify({'results': VAR_0, 'resultcount': len(VAR_0)})\n"
] | [
"@app.route('/metric/api/v1.0/metric/current')...\n",
"res = getMetric(request.args.get('fromtime', None), request.args.get(\n 'totime', None), request.args.get('origin', None), request.args.get(\n 'key', None), 1, ('Time', True))\n",
"return jsonify({'results': res, 'resultcount': len(res)})\n"
] | [
0,
4,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_5(VAR_18, VAR_20, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_36 = VAR_3 if VAR_18 else VAR_2\n",
"return len(VAR_18) >= VAR_1 or VAR_20 - VAR_21 > VAR_36\n"
] | [
"def should_post_update(stdout, now, last_packet):...\n",
"\"\"\"docstring\"\"\"\n",
"packet_interval = MIN_PACKET_INTERNAL if stdout else MAX_PACKET_INTERVAL\n",
"return len(stdout) >= MAX_CHUNK_SIZE or now - last_packet > packet_interval\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_7, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = []\n",
"VAR_2 = VAR_1.view_submit(VAR_7)\n",
"for entry in VAR_12['file_selection']:\n",
"VAR_10 = copy.deepcopy(VAR_12['global'])\n",
"return VAR_17\n",
"VAR_10.update(entry)\n",
"VAR_11 = copy.deepcopy(VAR_12['global']['... | [
"def submit(self, submit_id, config):...\n",
"\"\"\"docstring\"\"\"\n",
"ret = []\n",
"submit = db.view_submit(submit_id)\n",
"for entry in config['file_selection']:\n",
"info = copy.deepcopy(config['global'])\n",
"return ret\n",
"info.update(entry)\n",
"options = copy.deepcopy(config['global']['opt... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
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'",
"For",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Expr'",
"... |
[
"from re import compile, UNICODE\n",
"from Acquisition import aq_base\n",
"from unidecode import unidecode\n",
"from collective.solr.interfaces import ISolrSchema\n",
"from zope.component import getUtility\n",
"from plone.registry.interfaces import IRegistry\n",
"import six\n",
"from six.moves import ... | [
"from re import compile, UNICODE\n",
"from Acquisition import aq_base\n",
"from unidecode import unidecode\n",
"from collective.solr.interfaces import ISolrSchema\n",
"from zope.component import getUtility\n",
"from plone.registry.interfaces import IRegistry\n",
"import six\n",
"from six.moves import ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"Condition",
"Assign'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"return self._doc['collections'].keys()\n"
] | [
"def get_collection_names(self):...\n",
"return self._doc['collections'].keys()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
""
] | [
"@property...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_1(VAR_8, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = os.path.abspath(VAR_8)\n",
"VAR_12 = FUNC_0(VAR_2, VAR_7='GET')\n",
"if VAR_12 is None:\n",
"return False\n",
"f.write(VAR_12)\n",
"logging.error(\"\"\"Failed to write to %s\n%s\"\"\", VAR_8, e)\n",
"return True\n",
"return Fals... | [
"def DownloadFile(local_file, url):...\n",
"\"\"\"docstring\"\"\"\n",
"local_file = os.path.abspath(local_file)\n",
"url_data = UrlOpen(url, method='GET')\n",
"if url_data is None:\n",
"return False\n",
"f.write(url_data)\n",
"logging.error(\"\"\"Failed to write to %s\n%s\"\"\", local_file, e)\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_4(VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"for directory in os.getenv('PATH').split(':'):\n",
"if os.path.exists(os.path.join(directory, VAR_7)):\n",
"return False\n",
"return True\n"
] | [
"def executable_exists(executable):...\n",
"\"\"\"docstring\"\"\"\n",
"for directory in os.getenv('PATH').split(':'):\n",
"if os.path.exists(os.path.join(directory, executable)):\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_34(self):...\n",
"return self.replace(self.dynamic_fill, '{*}')\n"
] | [
"def format_dynamic(self):...\n",
"return self.replace(self.dynamic_fill, '{*}')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_23 = {}\n",
"VAR_46 = reader.KeywordToken\n",
"for VAR_76, v in acronymer.get_acronyms(VAR_17).items():\n",
"VAR_23[VAR_46(VAR_76, type='acronym')] = v\n",
"return VAR_23\n"
] | [
"def extract_abbreviations(fulltext):...\n",
"\"\"\"docstring\"\"\"\n",
"acronyms = {}\n",
"K = reader.KeywordToken\n",
"for k, v in acronymer.get_acronyms(fulltext).items():\n",
"acronyms[K(k, type='acronym')] = v\n",
"return acronyms\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7, VAR_12 = self.make_xsrf_handling_app()\n",
"VAR_17 = VAR_7.get('/request').body\n",
"VAR_7.post('/request?xsrf_token=%s' % VAR_17)\n",
"self.assertEqual([('POST', True)], VAR_12)\n"
] | [
"def test_xsrf_token_get_param(self):...\n",
"\"\"\"docstring\"\"\"\n",
"app, calls = self.make_xsrf_handling_app()\n",
"token = app.get('/request').body\n",
"app.post('/request?xsrf_token=%s' % token)\n",
"self.assertEqual([('POST', True)], calls)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_1):...\n",
"@functools.wraps(VAR_1)...\n",
"if g.user is None:\n",
"return redirect(url_for('auth.login'))\n",
"if g.user['admin'] != 1:\n",
"return redirect(url_for('blog.feedpage', VAR_3=0))\n",
"return VAR_1(**kwargs)\n"
] | [
"def admin_required(view):...\n",
"@functools.wraps(view)...\n",
"if g.user is None:\n",
"return redirect(url_for('auth.login'))\n",
"if g.user['admin'] != 1:\n",
"return redirect(url_for('blog.feedpage', page=0))\n",
"return view(**kwargs)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"from saker.fuzzers.fuzzer import Fuzzer\n",
"\"\"\"CmdInjection\"\"\"\n",
"def __init__(self):...\n",
"super(CLASS_0, self).__init__()\n",
"@staticmethod...\n",
"return ['|id', \"=cmd|'cmd'!''\", ';id', '\\n\\rid', '`id`', '${id}', '\\x00`id`']\n"
] | [
"from saker.fuzzers.fuzzer import Fuzzer\n",
"\"\"\"CmdInjection\"\"\"\n",
"def __init__(self):...\n",
"super(CmdInjection, self).__init__()\n",
"@staticmethod...\n",
"return ['|id', \"=cmd|'cmd'!''\", ';id', '\\n\\rid', '`id`', '${id}', '\\x00`id`']\n"
] | [
0,
0,
0,
0,
2,
2
] | [
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Expr'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_5, VAR_6):...\n",
"tk.Frame.__init__(self, VAR_5)\n",
"VAR_12 = tk.Label(self, text='Login Page', font=controller.titleFont)\n",
"VAR_12.pack(pady=10, padx=10)\n",
"VAR_13 = tk.Button(self, text='Start Using Raspi-Telxon!', font=controller.\n itemFont, command=lambda : controller.... | [
"def __init__(self, parent, controller):...\n",
"tk.Frame.__init__(self, parent)\n",
"label = tk.Label(self, text='Login Page', font=controller.titleFont)\n",
"label.pack(pady=10, padx=10)\n",
"enterAppButton = tk.Button(self, text='Start Using Raspi-Telxon!', font=\n controller.itemFont, command=lambda ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_24(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_57 = self.getfile(VAR_21, VAR_23=False)\n",
"if VAR_57 == False:\n",
"self.get_path(os.path.dirname(VAR_21)).remove(VAR_57)\n",
"return\n"
] | [
"def remove(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"p = self.getfile(path, follow_symlinks=False)\n",
"if p == False:\n",
"self.get_path(os.path.dirname(path)).remove(p)\n",
"return\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_18(VAR_32, VAR_33, VAR_5=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_60 = {}\n",
"VAR_52 = {}\n",
"for VAR_93, _ in VAR_32:\n",
"for VAR_83 in VAR_93.fieldcodes:\n",
"for VAR_94, _ in VAR_33:\n",
"VAR_60.setdefault(VAR_83, set()).add(VAR_93.output(VAR_5))\n",
"if len(VAR_94.fieldcodes):... | [
"def _get_fieldcodes(skw_matches, ckw_matches, spires=False):...\n",
"\"\"\"docstring\"\"\"\n",
"fieldcodes = {}\n",
"output = {}\n",
"for skw, _ in skw_matches:\n",
"for fieldcode in skw.fieldcodes:\n",
"for ckw, _ in ckw_matches:\n",
"fieldcodes.setdefault(fieldcode, set()).add(skw.output(spires))\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Expr'",
"Condition",
"For",
"For",
"For",
"Assign'",
"Return'",
"Expr'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_18(self, VAR_3):...\n",
"print('ERROR: database connection is down (error: {0})'.format(VAR_3.value))\n",
"return DeadConnectionDetector.startReconnecting(self, VAR_3)\n"
] | [
"def startReconnecting(self, f):...\n",
"print('ERROR: database connection is down (error: {0})'.format(f.value))\n",
"return DeadConnectionDetector.startReconnecting(self, f)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_20(self, VAR_25, VAR_26, *VAR_1, **VAR_2):...\n",
"self.ctx = VAR_25\n",
"self.sig_addr = VAR_26\n",
"threading.Thread.start(self, *VAR_1, **kvargs)\n"
] | [
"def start(self, ctx, sig_addr, *args, **kvargs):...\n",
"self.ctx = ctx\n",
"self.sig_addr = sig_addr\n",
"threading.Thread.start(self, *args, **kvargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, *VAR_11, **VAR_12):...\n",
"super(CLASS_0, self).__init__(*VAR_11, **kwargs)\n",
"self.set_distribution(jdk=True)\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super(JavacCompile, self).__init__(*args, **kwargs)\n",
"self.set_distribution(jdk=True)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_18(VAR_5, VAR_6):...\n",
"VAR_8 = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"VAR_9 = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"VAR_11 = requests.get(VAR_5['diff_url'], VAR_8=headers, VAR_9=auth)\n",
"VAR_20 = unidiff.PatchSet(VAR_11.content.splitlines(), encodi... | [
"def autopep8ify(data, config):...\n",
"headers = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"auth = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"r = requests.get(data['diff_url'], headers=headers, auth=auth)\n",
"patch = unidiff.PatchSet(r.content.splitlines(), encoding=r.e... | [
0,
0,
0,
0,
0,
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'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"For",
"For",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
... |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = self.bindings\n",
"VAR_7 = VAR_1['TEST_APP_COMPONENT_NAME']\n",
"VAR_15 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"VAR_8 = VAR_1['TEST_AWS_REGION']\n",
"VAR_9 = [VAR_8 + 'a', VAR_8 + 'b']\n",
"... | [
"def create_server_group(self):...\n",
"\"\"\"docstring\"\"\"\n",
"bindings = self.bindings\n",
"load_balancer_name = bindings['TEST_APP_COMPONENT_NAME']\n",
"group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"region = bindings['TEST_AWS_REGION']\n",
"av... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self, VAR_8):...\n",
"VAR_0.info('Handling monthly repeating event')\n",
"VAR_16 = datetime.strptime(VAR_8.date_end, '%Y-%m-%d %H:%M:00')\n",
"VAR_17 = datetime.now()\n",
"if VAR_17 >= VAR_16:\n",
"VAR_10 = datetime.strptime(VAR_8.date_begin, '%Y-%m-%d %H:%M:00'\n ) + relativedelta(months=+... | [
"def _handle_monthly_event_repetition(self, old_repeating_event):...\n",
"_logger.info('Handling monthly repeating event')\n",
"end_date = datetime.strptime(old_repeating_event.date_end, '%Y-%m-%d %H:%M:00')\n",
"present = datetime.now()\n",
"if present >= end_date:\n",
"new_start_date = datetime.strptime... | [
0,
0,
0,
0,
0,
6,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_6(self, VAR_64):...\n",
"if not VAR_64:\n",
"return None\n",
"VAR_88 = [int(i, 36) for i in VAR_64.split(',')]\n",
"VAR_89 = Comment._byID(VAR_88, data=True, return_dict=False)\n",
"return VAR_89\n"
] | [
"def run(self, id_str):...\n",
"if not id_str:\n",
"return None\n",
"cids = [int(i, 36) for i in id_str.split(',')]\n",
"comments = Comment._byID(cids, data=True, return_dict=False)\n",
"return comments\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_2.route('/tournament_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",
"if VAR_5 and VAR_19:\n",
"VAR_8 = 'string'.format(VAR_5, VAR_5, VAR_19)\n",
"return ''\n",
"VAR_7 = VAR_0.exec(VAR... | [
"@endpoints.route('/tournament_losses')...\n",
"if db == None:\n",
"init()\n",
"tag = request.args.get('tag', default=None)\n",
"date = request.args.get('date', default=None)\n",
"if tag and date:\n",
"sql = (\n \"select player1, place, date, score from matches join placings on matches.url=placings.u... | [
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.