lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"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... |
[
"@cached_property...\n",
"return {VAR_46.attname: VAR_46 for VAR_46 in self.fields}\n"
] | [
"@cached_property...\n",
"return {f.attname: f for f in self.fields}\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.BAD_SR_NAME, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.BAD_SR_NAME, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self\n",
"VAR_12 = []\n",
"def FUNC_29(VAR_13):...\n",
"def FUNC_30(VAR_13):...\n",
"self.fail('authenticate should not be called')\n",
"@classmethod...\n",
"return [FUNC_29, FUNC_30]\n"
] | [
"def test_authentication_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"test = self\n",
"calls = []\n",
"def failing(request):...\n",
"def skipped(request):...\n",
"self.fail('authenticate should not be called')\n",
"@classmethod...\n",
"return [failing, skipped]\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"FunctionDef'",
"Expr'",
"Condition",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_9 = '10.1.2.3'\n",
"for feature in ('confirmation', 'paging', 'events', 'formatoutput'):\n",
"self.driver._eql_execute('cli-settings', feature, 'off')\n",
"self.driver._eql_execute('grpparams', 's... | [
"def test_do_setup(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"fake_group_ip = '10.1.2.3'\n",
"for feature in ('confirmation', 'paging', 'events', 'formatoutput'):\n",
"self.driver._eql_execute('cli-settings', feature, 'off')\n",
"self.driver._eql_execute('... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_2 = ''.join([chr(random.randint(33, 126)) for _ in range(9)])\n",
"VAR_0 = requests.get('http://127.0.0.1:5000/profiles')\n",
"self.assertEqual(VAR_0.status_code, 200)\n",
"self.assertIsNotNone(VAR_0.text)\n",
"VAR_1 = json.loads(VAR_0.text)\n",
"for user in VAR_1:\n",
"... | [
"def test_d_update_user(self):...\n",
"string = ''.join([chr(random.randint(33, 126)) for _ in range(9)])\n",
"resp = requests.get('http://127.0.0.1:5000/profiles')\n",
"self.assertEqual(resp.status_code, 200)\n",
"self.assertIsNotNone(resp.text)\n",
"users = json.loads(resp.text)\n",
"for user in users... | [
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"return bool(self._latest_file_parse_request and self.\n _latest_file_parse_request.Done())\n"
] | [
"def DiagnosticsForCurrentFileReady(self):...\n",
"return bool(self._latest_file_parse_request and self.\n _latest_file_parse_request.Done())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"os_ext.rmtree(rt.runtime().resources.prefix)\n"
] | [
"def tearDown(self):...\n",
"os_ext.rmtree(rt.runtime().resources.prefix)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_14(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_13(VAR_16)\n"
] | [
"def temporary(value):...\n",
"\"\"\"docstring\"\"\"\n",
"return temp(value)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"@VAR_0.inclusion_tag('exercise/_user_results.html', takes_context=True)...\n",
"VAR_17 = FUNC_2(VAR_1, VAR_2)\n",
"VAR_17['total_json'] = json.dumps(VAR_17['total'])\n",
"if VAR_2:\n",
"VAR_17['is_course_staff'] = False\n",
"return VAR_17\n"
] | [
"@register.inclusion_tag('exercise/_user_results.html', takes_context=True)...\n",
"values = _get_toc(context, student)\n",
"values['total_json'] = json.dumps(values['total'])\n",
"if student:\n",
"values['is_course_staff'] = False\n",
"return values\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.update()\n",
"return self.data.keys()\n"
] | [
"def get_module_names(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.update()\n",
"return self.data.keys()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Return'"
] |
[
"def FUNC_2(VAR_3, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = VAR_5.copy()\n",
"VAR_19 = FUNC_4(VAR_3)\n",
"if VAR_19:\n",
"VAR_5['data']['registration_form_desc']['fields'] = FUNC_3(VAR_5['data'][\n 'registration_form_desc'])\n",
"VAR_5['enable_enterprise_sidebar'] = False\n",
"VAR_5.updat... | [
"def update_context_for_enterprise(request, context):...\n",
"\"\"\"docstring\"\"\"\n",
"context = context.copy()\n",
"sidebar_context = enterprise_sidebar_context(request)\n",
"if sidebar_context:\n",
"context['data']['registration_form_desc']['fields'] = enterprise_fields_only(\n context['data']['reg... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Assign'"
] |
[
"from time import strftime, time\n",
"from pretty_date import prettify_date\n",
"import sqlite3\n",
"VAR_0 = 'robodb.sqlite'\n",
"VAR_1 = 'robotb'\n",
"VAR_2 = 'timestamp INTEGER, name TEXT, location TEXT, description TEXT'\n",
"VAR_3 = 'timestamp, name, location, description'\n",
"VAR_4 = 604800\n",
... | [
"from time import strftime, time\n",
"from pretty_date import prettify_date\n",
"import sqlite3\n",
"db_name = 'robodb.sqlite'\n",
"tb_name = 'robotb'\n",
"mapping = 'timestamp INTEGER, name TEXT, location TEXT, description TEXT'\n",
"columns = 'timestamp, name, location, description'\n",
"one_week = ... | [
0,
0,
0,
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'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'"... |
[
"def FUNC_31(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.deletePlayer(player='38471237401238')\n"
] | [
"def test_delete_invalid_player_id(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.deletePlayer(player='38471237401238')\n"
] | [
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"if self.status_code not in [200, 302]:\n",
"return False\n",
"if self.status_code == 200 and self.res_data is None:\n",
"return False\n",
"if self.status_code == 200 and len(self.res_data) < CLASS_1.MINIMUM_LENGTH:\n",
"return False\n",
"return True\n"
] | [
"def test_success(self):...\n",
"if self.status_code not in [200, 302]:\n",
"return False\n",
"if self.status_code == 200 and self.res_data is None:\n",
"return False\n",
"if self.status_code == 200 and len(self.res_data\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"@classmethod...\n",
"return [FUNC_29, FUNC_30]\n"
] | [
"@classmethod...\n",
"return [failing, skipped]\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from datetime import datetime, timedelta\n",
"from django.conf import settings\n",
"from django.shortcuts import redirect\n",
"from django.views.generic import View\n",
"def FUNC_0(self, VAR_0, *VAR_1, **VAR_2):...\n",
"VAR_3 = VAR_0.GET.get('locale')\n",
"VAR_4 = redirect(VAR_0.GET.get('next', VAR_0.M... | [
"from datetime import datetime, timedelta\n",
"from django.conf import settings\n",
"from django.shortcuts import redirect\n",
"from django.views.generic import View\n",
"def get(self, request, *args, **kwargs):...\n",
"locale = request.GET.get('locale')\n",
"resp = redirect(request.GET.get('next', requ... | [
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.course_instance = VAR_2\n",
"self.exercises = list(self.__get_exercises())\n",
"self.categories = VAR_2.categories.all()\n",
"self.students = list(VAR_2.get_student_profiles())\n",
"self.results = {student.id: {VAR_0.id: None for VAR_0 ... | [
"def __init__(self, course_instance):...\n",
"\"\"\"docstring\"\"\"\n",
"self.course_instance = course_instance\n",
"self.exercises = list(self.__get_exercises())\n",
"self.categories = course_instance.categories.all()\n",
"self.students = list(course_instance.get_student_profiles())\n",
"self.results =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __virtual__():...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return False\n",
"return 'disk'\n"
] | [
"def __virtual__():...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return False\n",
"return 'disk'\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"VAR_0 = 'pos.close.statement'\n",
"VAR_1 = 'Close Statements'\n",
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n",
"VAR_7 = []\... | [
"from osv import osv\n",
"from tools.translate import _\n",
"_name = 'pos.close.statement'\n",
"_description = 'Close Statements'\n",
"def close_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n",
"li... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Conditi... |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.session.get('https://www.kijiji.ca/m-logout.html')\n"
] | [
"def logout(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.session.get('https://www.kijiji.ca/m-logout.html')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_3(self, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.terminal.write(VAR_2)\n",
"self.insert_buffer(list(VAR_2))\n"
] | [
"def insert_text(self, text):...\n",
"\"\"\"docstring\"\"\"\n",
"self.terminal.write(text)\n",
"self.insert_buffer(list(text))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_8, VAR_9, VAR_3):...\n",
"VAR_13 = ORMPerson.objects.create()\n",
"VAR_15 = ORMProfile.objects.create(VAR_8=username, VAR_9=bio, person=orm_person\n )\n",
"VAR_15.picture = VAR_3\n",
"VAR_15.save()\n",
"return self\n"
] | [
"def given_a_profile(self, username, bio, pic):...\n",
"orm_person = ORMPerson.objects.create()\n",
"profile = ORMProfile.objects.create(username=username, bio=bio, person=\n orm_person)\n",
"profile.picture = pic\n",
"profile.save()\n",
"return self\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __str__(self):...\n",
"return str(self.title)\n"
] | [
"def __str__(self):...\n",
"return str(self.title)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.input_channel.basic_consume(self.handle_message, queue=self.\n INPUT_QUEUE_NAME, no_ack=True)\n",
"self.input_channel.start_consuming()\n",
"log.info(' Exiting')\n",
"self.exit()\n"
] | [
"def run(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.input_channel.basic_consume(self.handle_message, queue=self.\n INPUT_QUEUE_NAME, no_ack=True)\n",
"self.input_channel.start_consuming()\n",
"log.info(' Exiting')\n",
"self.exit()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.format_wildcards(self.rule.message) if self.rule.message else None\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.format_wildcards(self.rule.message) if self.rule.message else None\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@classmethod...\n",
"return '-C-deprecation', '-C-Xlint:all', '-C-Xlint:-serial', '-C-Xlint:-path', '-S-deprecation', '-S-unchecked', '-S-Xlint'\n"
] | [
"@classmethod...\n",
"return '-C-deprecation', '-C-Xlint:all', '-C-Xlint:-serial', '-C-Xlint:-path', '-S-deprecation', '-S-unchecked', '-S-Xlint'\n"
] | [
0,
0
] | [
"Condition",
"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'"
] |
[
"def FUNC_2(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_31 = users.get_current_user()\n",
"return model.Identity(model.IDENTITY_USER, VAR_31.email()) if VAR_31 else None\n"
] | [
"def gae_cookie_authentication(_request):...\n",
"\"\"\"docstring\"\"\"\n",
"user = users.get_current_user()\n",
"return model.Identity(model.IDENTITY_USER, user.email()) if user else None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"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_5(VAR_3):...\n",
"VAR_3.close()\n"
] | [
"def closeDB(conn):...\n",
"conn.close()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"string\"\"\"\n",
"VAR_24 = request.json.get('id')\n",
"VAR_25 = request.json.get('likes')\n",
"VAR_26 = request.json.get('comment')\n",
"print(VAR_24)\n",
"print(VAR_25)\n",
"print(str(VAR_26))\n",
"if VAR_26 is not None:\n",
"if {'cont... | [
"def put(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"\n # Check the request comes from appropriate location.\n if not utils.validate_ip(request.remote_addr)\n return {}, 403\n \"\"\"\n",
"message_id = request.json.get('id')\n",
"likes = request.json.get('likes')\n",
"co... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"self.total += VAR_3.total\n",
"self.success += VAR_3.success\n",
"self.failure += VAR_3.failure\n",
"self.error += VAR_3.error\n",
"self.undecided += VAR_3.undecided\n",
"self.total_time += VAR_3.total_time\n",
"self.max_time = max(self.max_time, VAR_3.max_time)\n"
] | [
"def merge(self, log2):...\n",
"self.total += log2.total\n",
"self.success += log2.success\n",
"self.failure += log2.failure\n",
"self.error += log2.error\n",
"self.undecided += log2.undecided\n",
"self.total_time += log2.total_time\n",
"self.max_time = max(self.max_time, log2.max_time)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.run_local:\n",
"if not (self.configuration.san_password or self.configuration.san_private_key):\n",
"if not self.configuration.san_ip:\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.run_local:\n",
"if not (self.configuration.san_password or self.configuration.san_private_key):\n",
"if not self.configuration.san_ip:\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Condition"
] |
[
"@VAR_2.user_loader...\n",
"return User.get(VAR_6)\n"
] | [
"@login_manager.user_loader...\n",
"return User.get(user_id)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._icon\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._icon\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@api.depends('transitions_from', 'automaton')...\n",
"for record in self:\n",
"if len(record.transitions_to) == 0 or record.transitions_to is False:\n",
"record.is_end_state = True\n",
"record.is_end_state = False\n"
] | [
"@api.depends('transitions_from', 'automaton')...\n",
"for record in self:\n",
"if len(record.transitions_to) == 0 or record.transitions_to is False:\n",
"record.is_end_state = True\n",
"record.is_end_state = False\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"For",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_21(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"for key, value in self.iscsi_ips.items():\n",
"if value['nsp'] == VAR_15:\n",
"return key\n"
] | [
"def _get_ip_using_nsp(self, nsp):...\n",
"\"\"\"docstring\"\"\"\n",
"for key, value in self.iscsi_ips.items():\n",
"if value['nsp'] == nsp:\n",
"return key\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'"
] |
[
"def FUNC_6():...\n",
"VAR_35 = FUNC_3(VAR_18, VAR_19)\n",
"return CLASS_16, VAR_35\n"
] | [
"def three():...\n",
"HnPFormSet = make_formset(parent, child)\n",
"return ExtractedTextForm, HnPFormSet\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_16):...\n",
"if isinstance(VAR_16, CLASS_2) and (self.url, self.ref, self.conf.get(\n",
"return True\n",
"return False\n"
] | [
"def same_checkout(self, other):...\n",
"if isinstance(other, GitSubproject) and (self.url, self.ref, self.conf.get(\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_flags()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_0(VAR_0=None):...\n",
"VAR_1 = FUNC_1()\n",
"VAR_2 = FUNC_2(VAR_0)\n",
"return VAR_1, VAR_2\n"
] | [
"def execute(filters=None):...\n",
"columns = get_columns()\n",
"data = get_data(filters)\n",
"return columns, data\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"VAR_5 = {'id': 'myid'}\n",
"VAR_3 = self.client.post('/api/apps', json.dumps(VAR_5), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_3.status_code, 201)\n",
"VAR_5 = {'id': VAR_3.data['id']}\n",
"VAR_3 = self.client.post('/api/apps', json.dumps(VAR_5), content_t... | [
"def test_app_override_id(self):...\n",
"body = {'id': 'myid'}\n",
"response = self.client.post('/api/apps', json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"body = {'id': response.data['id']}\n",
"response = self.client.post('/api/apps', json.... | [
0,
0,
5,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self, VAR_1, VAR_7, VAR_8, VAR_9, VAR_4=None):...\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"VAR_29 = super(CLASS_0, self).view_header_get(VAR_1, VAR_7, VAR_8, VAR_9, VAR_4\n )\n",
"if VAR_29:\n",
"return VAR_29\n",
"if VAR_4.get('active_id', False) and VAR_4.get('active_model'\n",
"re... | [
"def view_header_get(self, cr, user, view_id, view_type, context=None):...\n",
"if context is None:\n",
"context = {}\n",
"res = super(product_product, self).view_header_get(cr, user, view_id,\n view_type, context)\n",
"if res:\n",
"return res\n",
"if context.get('active_id', False) and context.get('... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_19(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.registerPlayer(VAR_1='1')\n"
] | [
"def test_name_contains_integer(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.registerPlayer(player_name='1')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_3(VAR_4, VAR_5=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = requests.get(VAR_4, VAR_5=allow_redirects)\n",
"VAR_6 = requests.get('https://{}'.format(VAR_4), VAR_5=allow_redirects)\n",
"return VAR_6, VAR_23\n",
"VAR_23 = BeautifulSoup(VAR_6.content, 'lxml')\n",
"VAR_23 = BeautifulSoup(VAR_... | [
"def request_and_scrape_page(url, allow_redirects=True):...\n",
"\"\"\"docstring\"\"\"\n",
"page = requests.get(url, allow_redirects=allow_redirects)\n",
"page = requests.get('https://{}'.format(url), allow_redirects=allow_redirects)\n",
"return page, soup\n",
"soup = BeautifulSoup(page.content, 'lxml')\n... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(VAR_0=None):...\n",
"VAR_1 = FUNC_1()\n",
"VAR_2 = FUNC_2(VAR_0)\n",
"return VAR_1, VAR_2\n"
] | [
"def execute(filters=None):...\n",
"columns = get_columns()\n",
"data = get_data(filters)\n",
"return columns, data\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_21(self, VAR_68):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.docstring = VAR_68\n",
"return VAR_101\n"
] | [
"def docstring(self, string):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.docstring = string\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"import praw\n",
"import re\n",
"from datetime import datetime\n",
"from CreateAndUploadPlots import createAndUploadPlots\n",
"from CreateTableFromDatabase import getRankingsFromDatabase\n",
"from AddScoresToDatabase import getTitle\n",
"from AddScoresToDatabase import getDate\n",
"from AddScoresToDat... | [
"import praw\n",
"import re\n",
"from datetime import datetime\n",
"from CreateAndUploadPlots import createAndUploadPlots\n",
"from CreateTableFromDatabase import getRankingsFromDatabase\n",
"from AddScoresToDatabase import getTitle\n",
"from AddScoresToDatabase import getDate\n",
"from AddScoresToDat... | [
0,
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,
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
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign... |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = VAR_1 + '-'\n",
"if int(VAR_12) > 0:\n",
"VAR_21 += '%s:' % VAR_12\n",
"VAR_21 += '%s-%s.%s' % (VAR_13, VAR_14, VAR_15)\n",
"return VAR_21\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"package_name = name + '-'\n",
"if int(epoch) > 0:\n",
"package_name += '%s:' % epoch\n",
"package_name += '%s-%s.%s' % (version, release, arch)\n",
"return package_name\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"AugAssign'",
"AugAssign'",
"Return'"
] |
[
"def FUNC_5(VAR_3, VAR_7, VAR_8=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {'currentProvider': None, 'providers': [], 'secondaryProviders': [],\n 'finishAuthUrl': None, 'errorMessage': None,\n 'registerFormSubmitButtonText': _('Create Account')}\n",
"if third_party_auth.is_enabled():\n",
"VAR_2... | [
"def _third_party_auth_context(request, redirect_to, tpa_hint=None):...\n",
"\"\"\"docstring\"\"\"\n",
"context = {'currentProvider': None, 'providers': [], 'secondaryProviders':\n [], 'finishAuthUrl': None, 'errorMessage': None,\n 'registerFormSubmitButtonText': _('Create Account')}\n",
"if third_party... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_19(self):...\n",
"VAR_56 = frappe.get_hooks('permission_query_conditions', {}).get(self.\n doctype, [])\n",
"if VAR_56:\n",
"VAR_33 = []\n",
"for method in VAR_56:\n",
"VAR_70 = frappe.call(frappe.get_attr(method), self.user)\n",
"return ' and '.join(VAR_33) if VAR_33 else None\n",
"if VA... | [
"def get_permission_query_conditions(self):...\n",
"condition_methods = frappe.get_hooks('permission_query_conditions', {}).get(\n self.doctype, [])\n",
"if condition_methods:\n",
"conditions = []\n",
"for method in condition_methods:\n",
"c = frappe.call(frappe.get_attr(method), self.user)\n",
"retu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_13 = api.nova.instance_action_list(VAR_1, VAR_3)\n",
"return {'items': [s.to_dict() for s in VAR_13]}\n"
] | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"actions = api.nova.instance_action_list(request, server_id)\n",
"return {'items': [s.to_dict() for s in actions]}\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_10(VAR_13, VAR_14, VAR_11, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = FUNC_6(VAR_11, VAR_12)\n",
"VAR_30 = FUNC_7(VAR_13, VAR_14)\n",
"VAR_32 = len(VAR_30) > 10\n",
"for VAR_37 in VAR_30:\n",
"if VAR_32 and VAR_37 not in VAR_29:\n",
"for current_institution in VAR_29:\n",
"VAR_7 ... | [
"def update_institutions(conn, sqlite, k10plus, ai):...\n",
"\"\"\"docstring\"\"\"\n",
"current_institutions = get_all_current_institutions(k10plus, ai)\n",
"old_institutions = get_all_old_institutions(conn, sqlite)\n",
"institution_table_is_filled = len(old_institutions) > 10\n",
"for old_institution in ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"For",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_30(self, *VAR_33):...\n",
"self._run_tracker.log(Report.ERROR, *VAR_33)\n"
] | [
"def error(self, *msg_elements):...\n",
"self._run_tracker.log(Report.ERROR, *msg_elements)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24 = VAR_9.args.get('mode', [None])[0]\n",
"if VAR_24 == 'init':\n",
"return self.mode_init(VAR_9)\n",
"if VAR_24 == 'input':\n",
"return self.mode_input(VAR_9)\n",
"if VAR_24 == 'receive':\n",
"return self.mode_receive(VAR_9)\n",
"... | [
"def render_POST(self, request):...\n",
"\"\"\"docstring\"\"\"\n",
"dmode = request.args.get('mode', [None])[0]\n",
"if dmode == 'init':\n",
"return self.mode_init(request)\n",
"if dmode == 'input':\n",
"return self.mode_input(request)\n",
"if dmode == 'receive':\n",
"return self.mode_receive(reques... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
""
] | [
"def Start(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(self, VAR_8):...\n",
"if VAR_8 is True:\n",
"return 'Yes'\n",
"if VAR_8 is False:\n",
"return 'No'\n",
"if VAR_8 is None:\n",
"return ''\n",
"return str(VAR_8)\n"
] | [
"def _val_to_str(self, val):...\n",
"if val is True:\n",
"return 'Yes'\n",
"if val is False:\n",
"return 'No'\n",
"if val is None:\n",
"return ''\n",
"return str(val)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_39(self, VAR_20):...\n",
"for VAR_14 in self.list_properties.keys():\n",
"if self.is_relation(VAR_14):\n",
"if VAR_20 == self.get_related_model(VAR_14):\n",
"return VAR_14\n"
] | [
"def get_related_fk(self, model):...\n",
"for col_name in self.list_properties.keys():\n",
"if self.is_relation(col_name):\n",
"if model == self.get_related_model(col_name):\n",
"return col_name\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Condition",
"Return'"
] |
[
"def FUNC_13(self, VAR_25='default.yaml'):...\n",
"self.config = load(data_file, Loader)\n"
] | [
"def load_config(self, filename='default.yaml'):...\n",
"self.config = load(data_file, Loader)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_9(VAR_17):...\n",
"VAR_1 = self.window.active_view()\n",
"VAR_13 = self.sorted_menu[VAR_17][2]\n",
"VAR_19 = self.sorted_menu[VAR_17][0]\n",
"VAR_1.run_command('insert', {'characters': VAR_19 + ' -> ' + VAR_23.\n filename + ' | '})\n"
] | [
"def link_to_the_file(index):...\n",
"view = self.window.active_view()\n",
"file = self.sorted_menu[index][2]\n",
"title = self.sorted_menu[index][0]\n",
"view.run_command('insert', {'characters': title + ' -> ' + file_info.\n filename + ' | '})\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_17(self, VAR_18):...\n",
""
] | [
"def select(self, target):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_21(VAR_10, VAR_11, VAR_12):...\n",
"self.log.info('Termination signal %s recieved', repr((VAR_10, VAR_11, VAR_12)))\n",
"self.term()\n"
] | [
"def term_handler(interface, method, data):...\n",
"self.log.info('Termination signal %s recieved', repr((interface, method, data))\n )\n",
"self.term()\n"
] | [
0,
7,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(VAR_0, VAR_1, VAR_3=False, **VAR_2):...\n",
"if VAR_3:\n",
"CLASS_0.invalidate(VAR_1.user)\n",
"for VAR_7 in VAR_1.members.all():\n",
"CLASS_0.invalidate(VAR_7.user)\n"
] | [
"def invalidate_members(sender, instance, reverse=False, **kwargs):...\n",
"if reverse:\n",
"CachedTopMenu.invalidate(instance.user)\n",
"for profile in instance.members.all():\n",
"CachedTopMenu.invalidate(profile.user)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"For",
"Expr'"
] |
[
"import os\n",
"import vim\n",
"import tempfile\n",
"import json\n",
"import signal\n",
"from subprocess import PIPE\n",
"from ycm import vimsupport\n",
"from ycm import utils\n",
"from ycm.diagnostic_interface import DiagnosticInterface\n",
"from ycm.completers.all.omni_completer import OmniCompl... | [
"import os\n",
"import vim\n",
"import tempfile\n",
"import json\n",
"import signal\n",
"from subprocess import PIPE\n",
"from ycm import vimsupport\n",
"from ycm import utils\n",
"from ycm.diagnostic_interface import DiagnosticInterface\n",
"from ycm.completers.all.omni_completer import OmniCompl... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
7,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'"... |
[
"def FUNC_6(self):...\n",
"for att in self._['tmpatts']:\n",
"os.makedirs('file/%s' % att.key)\n",
"os.rename('file/tmp/%s' % att.key, 'file/%s/%s' % (att.key, att.filename))\n",
"VAR_29 = AttachmentList(key=att.key, VAR_6=self.ann_id, content_type=att.\n content_type, filename=att.filename)\n",
"self.... | [
"def parse_att(self):...\n",
"for att in self._['tmpatts']:\n",
"os.makedirs('file/%s' % att.key)\n",
"os.rename('file/tmp/%s' % att.key, 'file/%s/%s' % (att.key, att.filename))\n",
"new_att = AttachmentList(key=att.key, ann_id=self.ann_id, content_type=att.\n content_type, filename=att.filename)\n",
"... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"from flask import jsonify, request\n",
"import db\n",
"def FUNC_0(VAR_0):...\n",
"return jsonify(output=t)\n"
] | [
"from flask import jsonify, request\n",
"import db\n",
"def j(t):...\n",
"return jsonify(output=t)\n"
] | [
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_1:\n",
"if not VAR_8:\n",
"VAR_8 = CLASS_0.get_report(VAR_1)['signatures']\n",
"VAR_9 = collections.OrderedDict()\n",
"for signature in VAR_8:\n",
"VAR_25 = signature['severity']\n",
"return VAR_9\n",
"if VAR_25 > 3:\n",
"VAR_25 = 3\n"... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"if not task_id:\n",
"if not signatures:\n",
"signatures = AnalysisController.get_report(task_id)['signatures']\n",
"data = collections.OrderedDict()\n",
"for signature in signatures:\n",
"severity = signature['severity']\n",
"return data\n",
"if se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_0=None, VAR_1=None):...\n",
"super(CLASS_0, self).__init__(VAR_0, VAR_1)\n"
] | [
"def __init__(self, server=None, port=None):...\n",
"super(RdpPollInput, self).__init__(server, port)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_4.teardown_appcontext...\n",
"\"\"\"docstring\"\"\"\n",
"if hasattr(g, 'sqlite_db'):\n",
"g.sqlite_db.close()\n"
] | [
"@app.teardown_appcontext...\n",
"\"\"\"docstring\"\"\"\n",
"if hasattr(g, 'sqlite_db'):\n",
"g.sqlite_db.close()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Expr'"
] |
[
"import sys\n",
"import os\n",
"sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')\n",
"from demo import QueryInfo\n",
"VAR_0 = QueryInfo(query=\n 'MATCH (e) RETURN e.name, LABELS(e) as label ORDER BY label, e.name',\n description='Returns each node in the graph, specifing node la... | [
"import sys\n",
"import os\n",
"sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')\n",
"from demo import QueryInfo\n",
"graph_entities = QueryInfo(query=\n 'MATCH (e) RETURN e.name, LABELS(e) as label ORDER BY label, e.name',\n description='Returns each node in the graph, specifin... | [
0,
0,
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
] | [
"Import'",
"Import'",
"Expr'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"A... |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = []\n",
"VAR_7 = self.pool.get('ir.model.data')\n",
"VAR_8 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n",
"VAR_9 = self.pool.get('account.bank.statement')\n",
"VAR_10 = self.pool.get('ir.... | [
"def open_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\n",
"company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n",
"statement_obj = self.pool.get('account.bank.statement')\n",
"sequenc... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_26(VAR_20=None):...\n",
"return json.loads(VAR_7.get('/request', VAR_20=headers).body)\n"
] | [
"def call(headers=None):...\n",
"return json.loads(app.get('/request', headers=headers).body)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_33(VAR_39):...\n",
"return True\n"
] | [
"def acquire(self2):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_28(self, VAR_23):...\n",
"return self.mtime > VAR_23\n"
] | [
"def is_newer(self, time):...\n",
"return self.mtime > time\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_27 = os.path.join(VAR_4, VAR_0)\n",
"f.write(VAR_5.classname)\n"
] | [
"@staticmethod...\n",
"javac_plugin_info_file = os.path.join(resources_dir, _JAVAC_PLUGIN_INFO_FILE)\n",
"f.write(javac_plugin_target.classname)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'"
] |
[
"async def FUNC_2(VAR_6):...\n",
"VAR_7 = {'username': VAR_0, 'password': 'testing123G'}\n",
"VAR_8 = await VAR_6.post('/users', VAR_7=json.dumps(data))\n",
"assert VAR_8.status == 201\n"
] | [
"async def test_positive_register_(test_cli):...\n",
"data = {'username': username, 'password': 'testing123G'}\n",
"resp = await test_cli.post('/users', data=json.dumps(data))\n",
"assert resp.status == 201\n"
] | [
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Assign'",
"Assert'"
] |
[
"def FUNC_6(self):...\n",
""
] | [
"def do_delete(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_7(self):...\n",
"self.assert404(self.client.get(url_for('oauthclient.authorized', remote_app\n ='invalid')))\n",
"self.assert404(self.client.get(url_for('oauthclient.disconnect', remote_app\n ='invalid')))\n"
] | [
"def test_no_remote_app(self):...\n",
"self.assert404(self.client.get(url_for('oauthclient.authorized', remote_app\n ='invalid')))\n",
"self.assert404(self.client.get(url_for('oauthclient.disconnect', remote_app\n ='invalid')))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(VAR_4):...\n",
"if not os.path.exists('D:' + VAR_4):\n",
"return VAR_4\n",
"VAR_28 = 1\n",
"while VAR_28 < 101:\n",
"VAR_32 = re.sub('\\\\.(.*?)$', ' (%d).\\\\1' % VAR_28, VAR_4)\n",
"return ''\n",
"if not os.path.exists('D:' + VAR_32):\n",
"return VAR_32\n",
"VAR_28 = VAR_28 + 1\n"
] | [
"def get_non_duplicate_path(file_path):...\n",
"if not os.path.exists('D:' + file_path):\n",
"return file_path\n",
"duplicate = 1\n",
"while duplicate < 101:\n",
"new_path = re.sub('\\\\.(.*?)$', ' (%d).\\\\1' % duplicate, file_path)\n",
"return ''\n",
"if not os.path.exists('D:' + new_path):\n",
"r... | [
0,
4,
4,
4,
4,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.eng is not None and self.backend == 'Simulator' or self.backend == 'IBMBackend':\n",
"for qubit in self.reg:\n",
"self.eng.deallocate_qubit(qubit)\n"
] | [
"def _deallocate2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.eng is not None and self.backend == 'Simulator' or self.backend == 'IBMBackend':\n",
"for qubit in self.reg:\n",
"self.eng.deallocate_qubit(qubit)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"For",
"Expr'"
] |
[
"def FUNC_4(self, VAR_5='/'):...\n",
"VAR_6 = os.path.join(self.namespace, VAR_5)\n",
"if VAR_6 != '/':\n",
"VAR_6 = VAR_6.rstrip('/')\n",
"VAR_7 = self.etcd.read(VAR_6, recursive=True)\n",
"return None\n",
"VAR_3 = FUNC_2()\n",
"for entry in VAR_7.get_subtree():\n",
"if entry.key == VAR_6:\n",
"r... | [
"def list(self, keyfilter='/'):...\n",
"path = os.path.join(self.namespace, keyfilter)\n",
"if path != '/':\n",
"path = path.rstrip('/')\n",
"result = self.etcd.read(path, recursive=True)\n",
"return None\n",
"value = set()\n",
"for entry in result.get_subtree():\n",
"if entry.key == path:\n",
"re... | [
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Expr'"
] |
[
"@VAR_0.route('/peti/write/', methods=['GET', 'POST'])...\n",
"VAR_9 = ''\n",
"if request.method == 'POST':\n",
"VAR_12 = request.form['form_display_name']\n",
"VAR_9 += open('templates/petitions.html', encoding='utf-8').read()\n",
"VAR_17 = request.form['form_author_name']\n",
"return render_template('... | [
"@app.route('/peti/write/', methods=['GET', 'POST'])...\n",
"BODY_CONTENT = ''\n",
"if request.method == 'POST':\n",
"form_display_name = request.form['form_display_name']\n",
"BODY_CONTENT += open('templates/petitions.html', encoding='utf-8').read()\n",
"form_author_name = request.form['form_author_name'... | [
0,
0,
0,
4,
0,
4,
0,
4,
4,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_12 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n",
"def FUNC_6():...\n",
"VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n",
"if len(VAR_0) >= 3:\n",
"if '=' in VAR_0:\n",
"FUNC_6()\n",
"if ' --' in VAR_0:\n",
"FUNC_6()\n",
"if a... | [
"def sanitize_searchfield(searchfield):...\n",
"blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n 'or', 'like']\n",
"def _raise_exception():...\n",
"frappe.throw(_('Invalid Search Field'), frappe.DataError)\n",
"if len(searchfield) >= 3:\n",
"if '=' in searchfield:\n",
"_... | [
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_9(self, VAR_7):...\n",
"self._stop_events[VAR_7].set()\n"
] | [
"def copy_stop(self, job_id):...\n",
"self._stop_events[job_id].set()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_11(self):...\n",
"VAR_29 = []\n",
"for col in self.column_order:\n",
"VAR_29.append(self.columns[col].select())\n",
"VAR_11 = (\n \"\"\"\n SELECT {1} FROM goflow_records {0} ORDER BY last_switched DESC\n \"\"\"\n .format(self.build_filter_string(), ', '.join(VAR_29)))\n",
"pr... | [
"def flows(self):...\n",
"c = []\n",
"for col in self.column_order:\n",
"c.append(self.columns[col].select())\n",
"q = (\n \"\"\"\n SELECT {1} FROM goflow_records {0} ORDER BY last_switched DESC\n \"\"\"\n .format(self.build_filter_string(), ', '.join(c)))\n",
"print(q)\n",
"return s... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_13(self, VAR_19, VAR_20, VAR_17, VAR_13=False):...\n",
"if VAR_19.status_code not in VAR_20:\n",
"VAR_18 = VAR_19.json() if VAR_19.content else ''\n",
"if not VAR_13:\n",
"VAR_0.warning('string', {'result': VAR_19.status_code, 'expected': '/'.join\n ([str(code) for code in VAR_20]), 'body': VAR... | [
"def _validate_result(self, result, expected, operation, silent=False):...\n",
"if result.status_code not in expected:\n",
"result_msg = result.json() if result.content else ''\n",
"if not silent:\n",
"LOG.warning(\n 'The HTTP request returned error code %(result)s, whereas %(expected)s response codes we... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'"
] |
[
"def __init__(self, VAR_18, VAR_35=100, **VAR_16):...\n",
"CLASS_17.__init__(self, VAR_18, VAR_35=length, VAR_37=errors.\n LOCATION_TOO_LONG, VAR_36=None, **kw)\n"
] | [
"def __init__(self, item, length=100, **kw):...\n",
"VLength.__init__(self, item, length=length, length_error=errors.\n LOCATION_TOO_LONG, empty_error=None, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = FUNC_1()\n",
"VAR_12, VAR_13, VAR_14 = VAR_11.exec_command('shrubbery ' + VAR_2)\n",
"print('***stdout: ' + VAR_13.read().decode('utf-8'))\n",
"print('***stderr: ' + VAR_14.read().decode('utf-8'))\n",
"return VAR_13.read().decode('utf-8')\n... | [
"def send_unauthenticated_cmd(command_string):...\n",
"\"\"\"docstring\"\"\"\n",
"client = open_ssh_client()\n",
"stdin, stdout, stderr = client.exec_command('shrubbery ' + command_string)\n",
"print('***stdout: ' + stdout.read().decode('utf-8'))\n",
"print('***stderr: ' + stderr.read().decode('utf-8'))\n... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"if api.base.is_service_enabled(VAR_1, 'compute'):\n",
"VAR_45 = api.nova.default_quota_get(VAR_1, VAR_1.user.tenant_id)\n",
"VAR_35 = quotas.get_disabled_quotas(VAR_1)\n",
"VAR_46 = [quota for quota in VAR_45 if quota.name not in VAR_35]\n",
"VAR_10... | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"if api.base.is_service_enabled(request, 'compute'):\n",
"quota_set = api.nova.default_quota_get(request, request.user.tenant_id)\n",
"disabled_quotas = quotas.get_disabled_quotas(request)\n",
"filtered_quotas = [quota for quota in quota_set if quota.n... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(VAR_17):...\n",
"@receiver(VAR_5, **decorator_kwargs)...\n",
"if settings.SUSPEND_SIGNALS:\n",
"return\n",
"return VAR_17(VAR_23, **kwargs)\n"
] | [
"def our_wrapper(func):...\n",
"@receiver(signal, **decorator_kwargs)...\n",
"if settings.SUSPEND_SIGNALS:\n",
"return\n",
"return func(sender, **kwargs)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_3 = VAR_0.lower()\n",
"if VAR_3 in ('yes', 'true', 't', '1', 'y'):\n",
"return True\n",
"if VAR_3 in ('no', 'false', 'f', 'n', '0'):\n",
"return False\n"
] | [
"def str2bool(value):...\n",
"v = value.lower()\n",
"if v in ('yes', 'true', 't', '1', 'y'):\n",
"return True\n",
"if v in ('no', 'false', 'f', 'n', '0'):\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = CLASS_1.get_user_by_username(VAR_15)\n",
"return User.get_mapped_projects(VAR_22.id, VAR_16)\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"user = UserService.get_user_by_username(user_name)\n",
"return User.get_mapped_projects(user.id, preferred_locale)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_37(VAR_33, VAR_8):...\n",
"VAR_58 = (\n \"<a href='{}'><button type='button' class='btn btn-sm'>{}</button></a>\"\n .format(VAR_8, VAR_33))\n",
"return VAR_58\n"
] | [
"def action_button(label, url):...\n",
"action = (\n \"<a href='{}'><button type='button' class='btn btn-sm'>{}</button></a>\"\n .format(url, label))\n",
"return action\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_19(self, VAR_14):...\n",
""
] | [
"def is_relation_many_to_many(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@property...\n",
"return FUNC_0(self.file).st_mtime\n"
] | [
"@property...\n",
"return lstat(self.file).st_mtime\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_16(self, VAR_66):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_99 = snakemake.io.load_configfile(VAR_66)\n",
"update_config(VAR_85, VAR_99)\n",
"update_config(VAR_85, self.overwrite_config)\n"
] | [
"def configfile(self, jsonpath):...\n",
"\"\"\"docstring\"\"\"\n",
"c = snakemake.io.load_configfile(jsonpath)\n",
"update_config(config, c)\n",
"update_config(config, self.overwrite_config)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_24(VAR_36):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_66 = {}\n",
"for VAR_76, v in VAR_36:\n",
"VAR_66[VAR_76] = v\n",
"return VAR_66\n"
] | [
"def _kw(keywords):...\n",
"\"\"\"docstring\"\"\"\n",
"r = {}\n",
"for k, v in keywords:\n",
"r[k] = v\n",
"return r\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = time.time()\n",
"if VAR_20 > VAR_6:\n",
"VAR_6 = VAR_20\n",
"return VAR_6\n"
] | [
"def monotonic_time():...\n",
"\"\"\"docstring\"\"\"\n",
"now = time.time()\n",
"if now > _last_now:\n",
"_last_now = now\n",
"return _last_now\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.