lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@VAR_1.route('/get_cuisines')...\n", "VAR_18 = VAR_3.get_cuisines()\n", "if VAR_18 == -1:\n", "return None\n", "VAR_0.info('GET get_cuisines query')\n", "return VAR_18\n" ]
[ "@app.route('/get_cuisines')...\n", "query_res = database.get_cuisines()\n", "if query_res == -1:\n", "return None\n", "logger.info('GET get_cuisines query')\n", "return query_res\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_4(VAR_6, VAR_8, VAR_7, VAR_9):...\n", "VAR_19 = ''\n", "print('Linking : discordId : ' + str(VAR_6) + ', osuName : ' + VAR_8 +\n ', osuId : ' + str(VAR_7) + ' to Database.', end=' ')\n", "VAR_16 = sqlite3.connect(VAR_5)\n", "VAR_17 = VAR_16.cursor()\n", "VAR_17.execute('SELECT * FROM users WH...
[ "def link_user(discordId, osuName, osuId, rank):...\n", "result = ''\n", "print('Linking : discordId : ' + str(discordId) + ', osuName : ' + osuName +\n ', osuId : ' + str(osuId) + ' to Database.', end=' ')\n", "conn = sqlite3.connect(databasePath)\n", "cursor = conn.cursor()\n", "cursor.execute('SELEC...
[ 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "@api_post...\n", "VAR_7 = VAR_3.get('submit_id', 0)\n", "VAR_8 = VAR_3.get('password', None)\n", "VAR_9 = VAR_3.get('astree', True)\n", "VAR_6 = VAR_0.get_files(VAR_7=submit_id, VAR_8=password, VAR_9=astree)\n", "return JsonResponse({'status': True, 'data': VAR_6, 'defaults': FUNC_0()},\n encoder=Json...
[ "@api_post...\n", "submit_id = body.get('submit_id', 0)\n", "password = body.get('password', None)\n", "astree = body.get('astree', True)\n", "data = submit_manager.get_files(submit_id=submit_id, password=password,\n astree=astree)\n", "return JsonResponse({'status': True, 'data': data, 'defaults': def...
[ 0, 0, 0, 0, 1, 1 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_0=['POST', 'GET', 'PUT', 'DELETE']):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_5(VAR_1, *VAR_2, **VAR_3):...\n", "def FUNC_6():...\n", "if not request.method in VAR_0:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('sk...
[ "def RequireInternalRequest(methods=['POST', 'GET', 'PUT', 'DELETE']):...\n", "\"\"\"docstring\"\"\"\n", "def _decorate(f, *a, **kw):...\n", "def check():...\n", "if not request.method in methods:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if con...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Condition", "AugAssign'", "Condition", "Condition", "Return'" ]
[ "def FUNC_36(self, VAR_14):...\n", "return self.__class__(self.get_related_model(VAR_14), self.session)\n" ]
[ "def get_related_interface(self, col_name):...\n", "return self.__class__(self.get_related_model(col_name), self.session)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/queries', methods=['GET', 'POST'])...\n", "if request.method == 'GET':\n", "return render_template('queries-form.html', queries=get_queries(app, g))\n", "VAR_5 = request.form['query-selector']\n", "VAR_6 = get_queries(VAR_0, g)[VAR_5]\n", "VAR_7, VAR_4 = execute_query(VAR_0, g, VAR_6)\n", ...
[ "@app.route('/queries', methods=['GET', 'POST'])...\n", "if request.method == 'GET':\n", "return render_template('queries-form.html', queries=get_queries(app, g))\n", "query_key = request.form['query-selector']\n", "query = get_queries(app, g)[query_key]\n", "schema, data = execute_query(app, g, query)\n"...
[ 0, 0, 4, 0, 4, 4, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_12(self, VAR_14):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_14\n" ]
[ "def write(self, value):...\n", "\"\"\"docstring\"\"\"\n", "return value\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'listen_addr')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'listen_addr')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "from __future__ import unicode_literals\n", "from django.db import models, migrations\n", "VAR_0 = [('userprofile', '0002_auto_20150427_1717'), ('exercise',\n '0014_ltiexercise')]\n", "VAR_1 = [migrations.CreateModel(name='LearningObjectDisplay', fields=[('id',\n models.AutoField(verbose_name='ID', ser...
[ "from __future__ import unicode_literals\n", "from django.db import models, migrations\n", "dependencies = [('userprofile', '0002_auto_20150427_1717'), ('exercise',\n '0014_ltiexercise')]\n", "operations = [migrations.CreateModel(name='LearningObjectDisplay', fields=[\n ('id', models.AutoField(verbose_n...
[ 0, 0, 0, 4 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "Assign'" ]
[ "def FUNC_20(VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_35 = 'disk', 'partition'\n", "if not isinstance(VAR_6, (list, tuple)):\n", "VAR_6 = [VAR_6]\n", "VAR_6 = [block.sys_block_path(VAR_15) for VAR_15 in VAR_6]\n", "for VAR_4 in [FUNC_16(p) for p in VAR_6]:\n", "if any(holder_type not in VAR_35 a...
[ "def assert_clear(base_paths):...\n", "\"\"\"docstring\"\"\"\n", "valid = 'disk', 'partition'\n", "if not isinstance(base_paths, (list, tuple)):\n", "base_paths = [base_paths]\n", "base_paths = [block.sys_block_path(path) for path in base_paths]\n", "for holders_tree in [gen_holders_tree(p) for p in bas...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "For", "For" ]
[ "def FUNC_0(self, VAR_3):...\n", "return '{:,}'.format(VAR_3.num_cycles)\n" ]
[ "def render_num_cycles(self, record):...\n", "return '{:,}'.format(record.num_cycles)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_7(self, VAR_17):...\n", "self._WriteHeader('text/css')\n", "self._WriteTemplate(VAR_17)\n" ]
[ "def _DoCSS(self, template):...\n", "self._WriteHeader('text/css')\n", "self._WriteTemplate(template)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "@api.depends('state')...\n", "for rec in self:\n", "if rec.state.readonly_fields:\n", "rec.crapo_readonly_fields = ',{},'.format(rec.state.readonly_fields)\n", "rec.crapo_readonly_fields = ',0,'\n" ]
[ "@api.depends('state')...\n", "for rec in self:\n", "if rec.state.readonly_fields:\n", "rec.crapo_readonly_fields = ',{},'.format(rec.state.readonly_fields)\n", "rec.crapo_readonly_fields = ',0,'\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "For", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_36(VAR_11):...\n", "for VAR_51, VAR_58 in VAR_11.items():\n", "if isinstance(VAR_58, str) or not isinstance(VAR_58, Iterable):\n", "VAR_58 = [VAR_58]\n", "yield [(VAR_51, VAR_16) for VAR_16 in VAR_58]\n" ]
[ "def flatten(wildcards):...\n", "for wildcard, values in wildcards.items():\n", "if isinstance(values, str) or not isinstance(values, Iterable):\n", "values = [values]\n", "yield [(wildcard, value) for value in values]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_43(self, VAR_21=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_32 = list()\n", "VAR_21 = VAR_21 or self.get_columns_list()\n", "for VAR_14 in VAR_21:\n", "if not self.is_relation(VAR_14):\n", "return VAR_32\n", "if hasattr(self.obj, VAR_14):\n", "if not hasattr(getattr(self.obj, VAR_14), '_...
[ "def get_order_columns_list(self, list_columns=None):...\n", "\"\"\"docstring\"\"\"\n", "ret_lst = list()\n", "list_columns = list_columns or self.get_columns_list()\n", "for col_name in list_columns:\n", "if not self.is_relation(col_name):\n", "return ret_lst\n", "if hasattr(self.obj, col_name):\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Condition", "Return'", "Condition", "Condition", "Expr'", "Expr'" ]
[ "@app.route('/achievements/<achievement_id>')...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = request.args.get('language', 'en')\n", "VAR_6 = request.args.get('region', 'US')\n", "VAR_11 = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "VAR_11.execute(VAR_0 + 'WHERE ach.id = %(achievement_id)s', {'lan...
[ "@app.route('/achievements/<achievement_id>')...\n", "\"\"\"docstring\"\"\"\n", "language = request.args.get('language', 'en')\n", "region = request.args.get('region', 'US')\n", "cursor = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "cursor.execute(SELECT_ACHIEVEMENTS_QUERY +\n 'WHERE ach.id...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.norun = True\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.norun = True\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_7(self):...\n", "VAR_7 = BokChoyTestSuite('', default_store='invalid')\n", "VAR_1 = 'tests'\n", "self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name, VAR_2='invalid')\n )\n" ]
[ "def test_invalid_default_store(self):...\n", "suite = BokChoyTestSuite('', default_store='invalid')\n", "name = 'tests'\n", "self.assertEqual(suite.cmd, self._expected_command(name=name, store='invalid'))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "@defer.inlineCallbacks...\n", "VAR_58 = []\n", "yield self.mail_store.add_mailbox(VAR_31)\n", "for VAR_63 in range(VAR_30):\n", "VAR_82 = MailBuilder().with_status(VAR_32).with_tags(VAR_33).with_to(VAR_34\n ).with_cc(VAR_35).with_bcc(VAR_36)\n", "defer.returnValue(VAR_58)\n", "VAR_82.with_body(str(r...
[ "@defer.inlineCallbacks...\n", "mails = []\n", "yield self.mail_store.add_mailbox(mailbox)\n", "for _ in range(num):\n", "builder = MailBuilder().with_status(flags).with_tags(tags).with_to(to).with_cc(\n cc).with_bcc(bcc)\n", "defer.returnValue(mails)\n", "builder.with_body(str(random.random()))\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "For", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "AugAssign'", "Condition", "For", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_4(self):...\n", "self.client.login(username=self.tester.username, password='password')\n", "VAR_1 = self.client.post(self.many_comments_url, {'run': [self.case_run_1.\n pk, self.case_run_2.pk]})\n", "self.assertJSONEqual(str(VAR_1.content, encoding=settings.DEFAULT_CHARSET),\n {'rc': 1, 'respo...
[ "def test_refuse_if_missing_comment(self):...\n", "self.client.login(username=self.tester.username, password='password')\n", "response = self.client.post(self.many_comments_url, {'run': [self.\n case_run_1.pk, self.case_run_2.pk]})\n", "self.assertJSONEqual(str(response.content, encoding=settings.\n DEF...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_2(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = 'og' + VAR_0[2:]\n", "print('FAILED TO RESTORE ORIGINAL')\n", "db.engine.execute('DROP TABLE \"{0}\"'.format(VAR_0))\n", "db.engine.execute('CREATE TABLE \"{0}\" AS SELECT * FROM \"{1}\"'.format(VAR_0,\n VAR_18))\n" ]
[ "def restore_original(table_name):...\n", "\"\"\"docstring\"\"\"\n", "original = 'og' + table_name[2:]\n", "print('FAILED TO RESTORE ORIGINAL')\n", "db.engine.execute('DROP TABLE \"{0}\"'.format(table_name))\n", "db.engine.execute('CREATE TABLE \"{0}\" AS SELECT * FROM \"{1}\"'.format(\n table_name, or...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "@app.route('/experiment', methods=['GET'])...\n", "VAR_1 = ProcessingForm(request.form)\n", "return render_template('experiment/index.html', title='Try it Out!',\n sitekey=app.config['G_CAPTCHA_SITEKEY'], VAR_1=form, files=utils.\n SAMPLE_FILES)\n" ]
[ "@app.route('/experiment', methods=['GET'])...\n", "form = ProcessingForm(request.form)\n", "return render_template('experiment/index.html', title='Try it Out!',\n sitekey=app.config['G_CAPTCHA_SITEKEY'], form=form, files=utils.\n SAMPLE_FILES)\n" ]
[ 0, 0, 2 ]
[ "Condition", "Assign'", "Return'" ]
[ "def FUNC_1(self):...\n", "VAR_16 = 0\n", "VAR_17 = FUNC_0(CLASS_0.objects.filter(VAR_12=self.qa_group, VAR_8=False),\n self, 'next')\n", "if VAR_17:\n", "VAR_16 = VAR_17.pk\n", "if VAR_17 == self:\n", "VAR_16 = 0\n", "return VAR_16\n" ]
[ "def next_extracted_text_in_qa_group(self):...\n", "nextid = 0\n", "extextnext = get_next_or_prev(ExtractedText.objects.filter(qa_group=self.\n qa_group, qa_checked=False), self, 'next')\n", "if extextnext:\n", "nextid = extextnext.pk\n", "if extextnext == self:\n", "nextid = 0\n", "return nextid\n...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'" ]
[ "@mock.patch('requests.post', FUNC_0)...\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}/containers'.format(**locals())\n", "VAR_5 = self.client.get(VAR_4)\n", "self.assertEqual(V...
[ "@mock.patch('requests.post', mock_import_repository_task)...\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}/containers'.format(**locals())\n", "response = self.client.get(url)...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr...
[ "def FUNC_21(self, VAR_14):...\n", "" ]
[ "def is_relation_one_to_many(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_20(self, VAR_7):...\n", "if '%(key)s' in VAR_7:\n", "VAR_7 = VAR_7.replace('%(key)s', 'name')\n", "return frappe.db.sql(VAR_7, as_dict=not self.as_list)\n" ]
[ "def run_custom_query(self, query):...\n", "if '%(key)s' in query:\n", "query = query.replace('%(key)s', 'name')\n", "return frappe.db.sql(query, as_dict=not self.as_list)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_6(VAR_10):...\n", "self.assertEqual(VAR_10, VAR_11)\n" ]
[ "def on_callback(response):...\n", "self.assertEqual(response, magnet_link)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_3(VAR_14, VAR_15):...\n", "return FUNC_6(VAR_14, [[VAR_16] for line in VAR_15 for VAR_16 in line], False)\n" ]
[ "def vStrip(dims, files):...\n", "return smartGrid(dims, [[file] for line in files for file in line], False)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_3=None):...\n", "if VAR_3 is None:\n", "VAR_3 = []\n", "self.nodes = VAR_3\n" ]
[ "def __init__(self, nodes=None):...\n", "if nodes is None:\n", "nodes = []\n", "self.nodes = nodes\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.create_snapshot(VAR_8)\n", "self.common.client_logout()\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.create_snapshot(snapshot)\n", "self.common.client_logout()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "\"\"\"Tests for the XSRF tool.\"\"\"\n", "import datetime\n", "import unittest\n", "import config\n", "import utils\n", "\"\"\"Test cases for utils.XsrfTool.\"\"\"\n", "VAR_0 = datetime.datetime(2010, 1, 31, 18, 0, 0)\n", "def FUNC_0(self):...\n", "utils.set_utcnow_for_test(CLASS_0.TEST_NOW)\n", ...
[ "\"\"\"Tests for the XSRF tool.\"\"\"\n", "import datetime\n", "import unittest\n", "import config\n", "import utils\n", "\"\"\"Test cases for utils.XsrfTool.\"\"\"\n", "TEST_NOW = datetime.datetime(2010, 1, 31, 18, 0, 0)\n", "def setUp(self):...\n", "utils.set_utcnow_for_test(XsrfToolTests.TEST_NOW...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "Expr'", "Assign'", "FunctionDef'", "Expr'", "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Expr...
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import re\n", "from bs4 import BeautifulSoup\n", "from cmstestsuite.web import GenericRequest, LoginRequest\n", "def FUNC_0(self):...\n", "if not LoginRequest.test_succe...
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import re\n", "from bs4 import BeautifulSoup\n", "from cmstestsuite.web import GenericRequest, LoginRequest\n", "def test_success(self):...\n", "if not LoginRequest.test...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_9():...\n", "for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n", "os.rename('temp_' + filename, filename)\n", "os.remove(filename)\n" ]
[ "def tearDownClass():...\n", "for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n", "os.rename('temp_' + filename, filename)\n", "os.remove(filename)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'" ]
[ "def FUNC_19(self, VAR_9=True):...\n", "\"\"\"docstring\"\"\"\n", "self._kill_process_type(VAR_13.PROCESS_TYPE_LOG_MONITOR, VAR_9=check_alive)\n" ]
[ "def kill_log_monitor(self, check_alive=True):...\n", "\"\"\"docstring\"\"\"\n", "self._kill_process_type(ray_constants.PROCESS_TYPE_LOG_MONITOR, check_alive\n =check_alive)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_14(self, VAR_21, VAR_11):...\n", "if VAR_0(VAR_11):\n", "VAR_37, VAR_41 = self.process_lhs(VAR_21, VAR_11)\n", "VAR_42, VAR_43 = self.process_rhs(VAR_21, VAR_11)\n", "assert len(VAR_43) == 1, _('A dictionary must be provided as argument')\n", "VAR_4, *VAR_44 = VAR_43\n", "return '%s %s %s::jso...
[ "def as_sql(self, compiler, connection):...\n", "if is_postgresql(connection):\n", "lhs, lhs_params = self.process_lhs(compiler, connection)\n", "rhs, rhs_params = self.process_rhs(compiler, connection)\n", "assert len(rhs_params) == 1, _('A dictionary must be provided as argument')\n", "value, *junk = rh...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assert'", "Assign'", "Return'" ]
[ "def FUNC_5(self):...\n", "return reverse(self.success_url, VAR_4={'step': 0, 'uuid': self.object.uuid})\n" ]
[ "def get_success_url(self):...\n", "return reverse(self.success_url, kwargs={'step': 0, 'uuid': self.object.uuid})\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_13(self):...\n", "self.run_test_case(self.scenario.upsert_load_balancer())\n" ]
[ "def test_a_upsert_load_balancer(self):...\n", "self.run_test_case(self.scenario.upsert_load_balancer())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4(VAR_4):...\n", "VAR_9 = FUNC_0()\n", "VAR_10 = VAR_9.cursor()\n", "VAR_10.execute(\" SELECT karma FROM people WHERE name='{}' \".format(VAR_4))\n", "VAR_2.error('Execution failed with error: {}'.format(e))\n", "VAR_11 = VAR_10.fetchone()\n", "if VAR_11 is None:\n", "VAR_2.debug('No karma f...
[ "def karma_ask(name):...\n", "db = db_connect()\n", "cursor = db.cursor()\n", "cursor.execute(\" SELECT karma FROM people WHERE name='{}' \".format(name))\n", "logger.error('Execution failed with error: {}'.format(e))\n", "karma = cursor.fetchone()\n", "if karma is None:\n", "logger.debug('No karma fo...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Return'", "Expr'", "Return'" ]
[ "@VAR_0.route('/quiz')...\n", "VAR_13 = request.args.get('varga')\n", "VAR_14 = []\n", "con.close()\n", "con.row_factory = sql.Row\n", "VAR_15 = con.cursor()\n", "VAR_15.execute('string' % VAR_13)\n", "VAR_14 = VAR_15.fetchall()\n", "VAR_18 = VAR_14[0]['artha']\n", "VAR_15.execute(\n \"select p...
[ "@app.route('/quiz')...\n", "varga = request.args.get('varga')\n", "rows = []\n", "con.close()\n", "con.row_factory = sql.Row\n", "cur = con.cursor()\n", "cur.execute(\n \"select * from pada inner join mula on pada.sloka_line = mula.sloka_line where pada.varga = '%s' order by random() limit 1;\"\n ...
[ 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_16(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 3}, 'CONFIDENCE': {'HIGH': 3}}\n", "self.check_example('imports-from.py', VAR_2)\n" ]
[ "def test_imports_from(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 3}, 'CONFIDENCE': {'HIGH': 3}}\n", "self.check_example('imports-from.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_0(self, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_4.is_course_staff:\n", "return True\n", "if not VAR_5.visible_to_students:\n", "self.error_msg(_('The resource is not currently visible.'))\n", "VAR_6 = VAR_3.user\n", "return False\n", "VAR_11 = VAR_5.view_content_to\...
[ "def is_object_visible(self, request, view, course):...\n", "\"\"\"docstring\"\"\"\n", "if view.is_course_staff:\n", "return True\n", "if not course.visible_to_students:\n", "self.error_msg(_('The resource is not currently visible.'))\n", "user = request.user\n", "return False\n", "show_for = course...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Condition", "Return'", "Expr'", "Condition", "Return'", "Return'", "Condition", "Condition", "Condition", "Expr'", "Return'", "Return'" ]
[ "def FUNC_6(self, VAR_18, VAR_13=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_18.isdigit():\n", "return CLASS_0.INVALID_ID\n", "VAR_19 = self.__con.cursor()\n", "if VAR_13 == None:\n", "VAR_13 = 'NULL'\n", "VAR_23 = CLASS_0.__format_date(VAR_13)\n", "return CLASS_0.SUCCESS if VAR_19.execute(...
[ "def update_date(self, taskid, date=None):...\n", "\"\"\"docstring\"\"\"\n", "if not taskid.isdigit():\n", "return Database.INVALID_ID\n", "cur = self.__con.cursor()\n", "if date == None:\n", "date = 'NULL'\n", "valid_date = Database.__format_date(date)\n", "return Database.SUCCESS if cur.execute(\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Condition", "Return'", "Assign'" ]
[ "def FUNC_24(VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_40 = [VAR_5['name']]\n", "VAR_27 = VAR_5['holders']\n", "for holder_no, holder in enumerate(VAR_27):\n", "VAR_43 = VAR_33[min(len(VAR_27) - (holder_no + 1), 1)]\n", "return VAR_40\n", "VAR_44 = FUNC_24(holder)\n", "for line_no, line in enum...
[ "def format_tree(tree):...\n", "\"\"\"docstring\"\"\"\n", "result = [tree['name']]\n", "holders = tree['holders']\n", "for holder_no, holder in enumerate(holders):\n", "spacer_style = spacers[min(len(holders) - (holder_no + 1), 1)]\n", "return result\n", "subtree_lines = format_tree(holder)\n", "for...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Assign'", "Return'", "Assign'", "For", "Expr'" ]
[ "def FUNC_6(self, VAR_14):...\n", "if PY2:\n", "return {VAR_40: k for k, VAR_40 in VAR_14.iteritems()}\n", "return {VAR_40: k for k, VAR_40 in VAR_14.items()}\n" ]
[ "def invert(self, orig):...\n", "if PY2:\n", "return {v: k for k, v in orig.iteritems()}\n", "return {v: k for k, v in orig.items()}\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return [os.path.join(self.bin_dir_path, self.executable)] + self.args\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return [os.path.join(self.bin_dir_path, self.executable)] + self.args\n" ]
[ 0, 0, 2 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_9(self):...\n", "if not VAR_0:\n", "self.redirect('/')\n", "self.write('string'.format(self.xsrf_form_html()))\n" ]
[ "def get(self):...\n", "if not enable_authentication:\n", "self.redirect('/')\n", "self.write(\n '<html><head><title>Liked Saved Downloader</title><link rel=\"stylesheet\" type=\"text/css\" href=\"webInterfaceNoAuth/index.css\"></head><body><h1>Login Required</h1><form action=\"/login\" method=\"post\">Nam...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_8(self, VAR_9, VAR_10=None, VAR_11=None):...\n", "get_and_check_project(VAR_9, VAR_11)\n", "VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n", "VAR_26 = CLASS_1(VAR_28)\n", "return Response(VAR_26.data)\n" ]
[ "def retrieve(self, request, pk=None, project_pk=None):...\n", "get_and_check_project(request, project_pk)\n", "task = self.queryset.get(pk=pk, project=project_pk)\n", "serializer = TaskSerializer(task)\n", "return Response(serializer.data)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(self, VAR_1, VAR_2, VAR_3=None, VAR_4=None, VAR_5=0):...\n", "VAR_3 = VAR_3 or [NTFY_UPDATE, NTFY_INSERT, NTFY_DELETE]\n", "\"\"\"string\"\"\"\n", "assert isinstance(VAR_3, list)\n", "assert VAR_2 in self.SUBJECTS, 'Subject %s not in SUBJECTS' % VAR_2\n", "VAR_9 = VAR_1, VAR_2, VAR_3, VAR_4, V...
[ "def add_observer(self, func, subject, changeTypes=None, id=None, cache=0):...\n", "changeTypes = changeTypes or [NTFY_UPDATE, NTFY_INSERT, NTFY_DELETE]\n", "\"\"\"\n Add observer function which will be called upon certain event\n Example:\n addObserver(NTFY_TORRENTS, [NTFY_INSERT,NTFY_DELE...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assert'", "Assert'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(VAR_2: HttpRequest):...\n", "\"\"\"docstring\"\"\"\n", "u: Profile = get_current_user(VAR_2)\n", "VAR_5 = '/admin?success'\n", "if u.rights > 0:\n", "VAR_5 = '/admin/reservations'\n", "if VAR_2.GET.get('redirect'):\n", "VAR_5 = VAR_2.GET['redirect']\n", "if 'payload' not in VAR_2.GET:\n"...
[ "def write_db_reservation_action(request: HttpRequest):...\n", "\"\"\"docstring\"\"\"\n", "u: Profile = get_current_user(request)\n", "forward_url = '/admin?success'\n", "if u.rights > 0:\n", "forward_url = '/admin/reservations'\n", "if request.GET.get('redirect'):\n", "forward_url = request.GET['redi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "AnnAssign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "AnnAssign'", "Return'" ]
[ "def __init__(self, *VAR_12, VAR_13=VAR_1, VAR_14=dict, **VAR_4):...\n", "self._sep = VAR_13\n", "self._data = {}\n", "self._create_on_missing = FUNC_1(VAR_14)\n", "self.update(*VAR_12, **kwargs)\n" ]
[ "def __init__(self, *args, path_separator=DEFAULT_PATH_SEPARATOR,...\n", "self._sep = path_separator\n", "self._data = {}\n", "self._create_on_missing = create_on_missing(path_factory)\n", "self.update(*args, **kwargs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = 'katotestlb' + self.test_id\n", "self.__use_lb_name = VAR_4\n", "VAR_2 = self.bindings\n", "VAR_5 = VAR_2['TEST_AWS_REGION']\n", "VAR_6 = [VAR_5 + 'a', VAR_5 + 'b']\n", "VAR_7 = {'Listener': {'InstancePort': 7001, 'LoadBalancerPort': 80}}\n...
[ "def upsert_load_balancer(self):...\n", "\"\"\"docstring\"\"\"\n", "detail_raw_name = 'katotestlb' + self.test_id\n", "self.__use_lb_name = detail_raw_name\n", "bindings = self.bindings\n", "region = bindings['TEST_AWS_REGION']\n", "avail_zones = [region + 'a', region + 'b']\n", "listener = {'Listener...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_0(self):...\n", "VAR_0.debug('Retrieving connection from the pool')\n", "VAR_11 = self._pool.get()\n", "VAR_0.debug('Type checking connection')\n", "if not isinstance(VAR_11, MySQLdb.connections.Connection):\n", "return -1\n", "VAR_0.info('Successful MySQL connection get request')\n", "retur...
[ "def get_connection(self):...\n", "logger.debug('Retrieving connection from the pool')\n", "db = self._pool.get()\n", "logger.debug('Type checking connection')\n", "if not isinstance(db, MySQLdb.connections.Connection):\n", "return -1\n", "logger.info('Successful MySQL connection get request')\n", "re...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_5(VAR_1='', VAR_2=''):...\n", "VAR_5 = tournament.registerPlayer(VAR_1=player_name, VAR_2=country)\n", "return VAR_5\n" ]
[ "def dummy_player(player_name='', country=''):...\n", "s = tournament.registerPlayer(player_name=player_name, country=country)\n", "return s\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._node_ip_address\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._node_ip_address\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "@property...\n", "return self.step.project if self.step else None\n" ]
[ "@property...\n", "return self.step.project if self.step else None\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "VAR_16 = self.common.get_volume_stats(VAR_4)\n", "VAR_16['storage_protocol'] = 'FC'\n", "VAR_17 = self.configuration.safe_get('volume_backend_name')\n", "VAR_16['volume_backend_name'] = VAR_17 or self.__class__.__name__\n"...
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "stats = self.common.get_volume_stats(refresh)\n", "stats['storage_protocol'] = 'FC'\n", "backend_name = self.configuration.safe_get('volume_backend_name')\n", "stats['volume_backend_name'] = backend_name or self.__class__....
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def __init__(self, *VAR_1, **VAR_2):...\n", "super(CLASS_0, self).__init__(*VAR_1, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super(TimestampField, self).__init__(*args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_24(self):...\n", "VAR_13 = 1234\n", "self.cursor.execute('create table t1(n int)')\n", "self.cursor.execute('insert into t1 values (?)', VAR_13)\n", "VAR_20 = self.cursor.execute('select n from t1').fetchone()[0]\n", "self.assertEqual(VAR_20, VAR_13)\n" ]
[ "def test_int(self):...\n", "value = 1234\n", "self.cursor.execute('create table t1(n int)')\n", "self.cursor.execute('insert into t1 values (?)', value)\n", "result = self.cursor.execute('select n from t1').fetchone()[0]\n", "self.assertEqual(result, value)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_18(self):...\n", "VAR_47 = Sanic(__name__)\n", "VAR_48 = str(VAR_0 / 'datasette' / 'templates')\n", "VAR_49 = []\n", "if self.template_dir:\n", "VAR_49.append(self.template_dir)\n", "VAR_49.extend([plugin['templates_path'] for plugin in get_plugins(pm) if\n plugin['templates_path']])\n", ...
[ "def app(self):...\n", "app = Sanic(__name__)\n", "default_templates = str(app_root / 'datasette' / 'templates')\n", "template_paths = []\n", "if self.template_dir:\n", "template_paths.append(self.template_dir)\n", "template_paths.extend([plugin['templates_path'] for plugin in get_plugins(\n pm) if p...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "For", "Expr'", "For", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", ...
[ "def FUNC_0(VAR_0):...\n", "VAR_1 = VAR_0.GET.get('url', None)\n", "VAR_6 = FUNC_1(VAR_1)\n", "while VAR_6 != VAR_1:\n", "VAR_1 = VAR_6\n", "return JsonResponse({'url': VAR_6})\n", "VAR_6 = FUNC_1(VAR_1)\n" ]
[ "def expand_url(request):...\n", "url = request.GET.get('url', None)\n", "exurl = expand(url)\n", "while exurl != url:\n", "url = exurl\n", "return JsonResponse({'url': exurl})\n", "exurl = expand(url)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'vccs_url')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'vccs_url')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_4(self):...\n", "for VAR_11 in range(self.size):\n", "self.addNewNode(VAR_11)\n" ]
[ "def genNodes(self):...\n", "for i in range(self.size):\n", "self.addNewNode(i)\n" ]
[ 0, 1, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_3(self):...\n", "self.telnet.write(bytes('shutdown\\n', encoding='utf-8'))\n", "super().close()\n", "self.openocd.wait()\n", "db.log_event('Information', 'Debugger', 'Closed openocd')\n" ]
[ "def close(self):...\n", "self.telnet.write(bytes('shutdown\\n', encoding='utf-8'))\n", "super().close()\n", "self.openocd.wait()\n", "db.log_event('Information', 'Debugger', 'Closed openocd')\n" ]
[ 0, 0, 0, 0, 2 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_12(self, VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_18.is_dir:\n", "return False\n", "VAR_30, VAR_41, VAR_42, VAR_43, VAR_46, VAR_47 = self._sqlify_fsnode(VAR_18)\n", "self.fs_db.execute('string' % (VAR_30, VAR_41, VAR_42, VAR_43, VAR_46, VAR_47))\n", "return\n" ]
[ "def _insert_in_db(self, item):...\n", "\"\"\"docstring\"\"\"\n", "if not item.is_dir:\n", "return False\n", "(n_uuid, n_file_name, n_owner, n_upload_time, n_sub_folders_str,\n n_sub_files_str) = self._sqlify_fsnode(item)\n", "self.fs_db.execute(\n \"INSERT INTO file_system (uuid, file_name, owner, ...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Expr'", "Return'" ]
[ "@rest_utils.ajax()...\n", "api.nova.server_delete(VAR_1, VAR_3)\n" ]
[ "@rest_utils.ajax()...\n", "api.nova.server_delete(request, server_id)\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_6(self, VAR_6, VAR_7):...\n", "self.vars[VAR_6] = VAR_7\n" ]
[ "def set_variable(self, key, value):...\n", "self.vars[key] = value\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "@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'" ]
[ "\"\"\"Unittest to exercise the code in url_helper.py.\"\"\"\n", "import logging\n", "import os\n", "import stat\n", "import StringIO\n", "import sys\n", "import tempfile\n", "import time\n", "import unittest\n", "import urllib\n", "import urllib2\n", "VAR_0 = os.path.dirname(os.path.dirname(o...
[ "\"\"\"Unittest to exercise the code in url_helper.py.\"\"\"\n", "import logging\n", "import os\n", "import stat\n", "import StringIO\n", "import sys\n", "import tempfile\n", "import time\n", "import unittest\n", "import urllib\n", "import urllib2\n", "ROOT_DIR = os.path.dirname(os.path.dirnam...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 5, 0, 0...
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Assign'", "Expr'", "Import'", "Expr'", "ImportFrom'", "ImportFrom'", "Import'", "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr...
[ "def FUNC_10(self):...\n", "self.env_var_override.set('VERIFY_XSS', 'True')\n", "VAR_7 = BokChoyTestSuite('')\n", "VAR_1 = 'tests'\n", "self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name, VAR_3=True))\n" ]
[ "def test_verify_xss_env_var(self):...\n", "self.env_var_override.set('VERIFY_XSS', 'True')\n", "suite = BokChoyTestSuite('')\n", "name = 'tests'\n", "self.assertEqual(suite.cmd, self._expected_command(name=name, verify_xss=True))\n" ]
[ 0, 3, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.params = VAR_71, VAR_72\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.params = params, kwparams\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_17(self, *VAR_26, **VAR_27):...\n", "if VAR_27.get('body') is not None:\n", "VAR_27['body'] = jsonutils.dumps(VAR_27['body'], sort_keys=True)\n", "VAR_19 = super(CLASS_1, self)._rest_call(*VAR_26, **kwargs)\n", "return VAR_19.json() if VAR_19.content else VAR_19\n" ]
[ "def _rest_call(self, *args, **kwargs):...\n", "if kwargs.get('body') is not None:\n", "kwargs['body'] = jsonutils.dumps(kwargs['body'], sort_keys=True)\n", "result = super(JSONRESTClient, self)._rest_call(*args, **kwargs)\n", "return result.json() if result.content else result\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_27(self, VAR_43, VAR_44):...\n", "\"\"\"docstring\"\"\"\n", "VAR_63 = self.getfile(VAR_43)\n", "if VAR_63 == False:\n", "VAR_64 = self.getfile(VAR_44)\n", "if VAR_64 != False:\n", "self.get_path(os.path.dirname(VAR_43)).remove(VAR_63)\n", "VAR_63[VAR_1] = os.path.basename(VAR_44)\n", "self...
[ "def rename(self, oldpath, newpath):...\n", "\"\"\"docstring\"\"\"\n", "old = self.getfile(oldpath)\n", "if old == False:\n", "new = self.getfile(newpath)\n", "if new != False:\n", "self.get_path(os.path.dirname(oldpath)).remove(old)\n", "old[A_NAME] = os.path.basename(newpath)\n", "self.get_path(os...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_21(VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "return json.load(VAR_0)\n", "VAR_0.seek(0)\n", "import yaml\n", "return yaml.load(VAR_0)\n" ]
[ "def _load_configfile(configpath):...\n", "\"\"\"docstring\"\"\"\n", "return json.load(f)\n", "f.seek(0)\n", "import yaml\n", "return yaml.load(f)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'", "Expr'", "Import'", "Return'" ]
[ "def FUNC_14(self):...\n", "VAR_1 = self.client.get(self.get_info_url, {'info_type': 'env_properties'})\n", "VAR_7 = json.loads(serializers.serialize('json', EnvProperty.objects.all(),\n fields=('name', 'value')))\n", "self.assertJSONEqual(str(VAR_1.content, encoding=settings.DEFAULT_CHARSET),\n VAR_7)\...
[ "def test_get_env_properties(self):...\n", "response = self.client.get(self.get_info_url, {'info_type': 'env_properties'})\n", "expected_json = json.loads(serializers.serialize('json', EnvProperty.\n objects.all(), fields=('name', 'value')))\n", "self.assertJSONEqual(str(response.content, encoding=settings...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(self, VAR_5):...\n", "if VAR_5 in self.groups:\n", "self.groups.remove(VAR_5)\n", "for oldg in VAR_5.get_ancestors():\n", "if oldg.name != 'all':\n", "for childg in self.groups:\n", "if oldg in childg.get_ancestors():\n" ]
[ "def remove_group(self, group):...\n", "if group in self.groups:\n", "self.groups.remove(group)\n", "for oldg in group.get_ancestors():\n", "if oldg.name != 'all':\n", "for childg in self.groups:\n", "if oldg in childg.get_ancestors():\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "For", "Condition", "For", "Condition" ]
[ "def FUNC_0(self):...\n", "if not GenericRequest.test_success(self):\n", "return False\n", "self.get_user_test_info()\n", "return False\n", "return True\n" ]
[ "def test_success(self):...\n", "if not GenericRequest.test_success(self):\n", "return False\n", "self.get_user_test_info()\n", "return False\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Expr'", "Return'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import logging\n", "from datetime import timedelta\n", "import voluptuous as vol\n", "from homeassistant.components.sensor import PLATFORM_SCHEMA\n", "from homeassistant.const import TEMP_CELSIUS, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, STATE_UNKNOWN\n", "from homeassis...
[ "\"\"\"\nSupport for the NetAtmo Weather Service.\n\nFor more details about this platform, please refer to the documentation at\nhttps://home-assistant.io/components/sensor.netatmo/\n\"\"\"\n", "import logging\n", "from datetime import timedelta\n", "import voluptuous as vol\n", "from homeassistant.componen...
[ 0, 0, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Impo...
[ "def __setitem__(self, VAR_7, VAR_15):...\n", "VAR_9, VAR_21 = FUNC_3(self, VAR_7, VAR_2=self._sep, VAR_8=self.\n _create_on_missing)\n", "if VAR_9 is self:\n", "self._data[VAR_21] = VAR_15\n", "VAR_9[VAR_21] = VAR_15\n" ]
[ "def __setitem__(self, path, value):...\n", "node, key = traverse(self, path, sep=self._sep, on_missing=self.\n _create_on_missing)\n", "if node is self:\n", "self._data[key] = value\n", "node[key] = value\n" ]
[ 0, 0, 1, 1, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_0(self):...\n", "self.objects = load_model_objects()\n", "self.client.login(username='Karyn', password='specialP@55word')\n" ]
[ "def setUp(self):...\n", "self.objects = load_model_objects()\n", "self.client.login(username='Karyn', password='specialP@55word')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_28(VAR_13):...\n", "self.assertEqual('/request', VAR_13.path)\n", "VAR_12.append('applicable')\n", "return VAR_5\n" ]
[ "def applicable(request):...\n", "self.assertEqual('/request', request.path)\n", "calls.append('applicable')\n", "return ident\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_7, *VAR_15, **VAR_16):...\n", "CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n" ]
[ "def __init__(self, param, *a, **kw):...\n", "Validator.__init__(self, param, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_7(VAR_0, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_20 = FUNC_5(VAR_0, VAR_5.number())\n", "VAR_13, VAR_19 = FUNC_4(VAR_0, VAR_5)\n", "return VAR_20.seed_games_and_powers(omitting_players=sitters,\n players_doubling_up=two_gamers)\n" ]
[ "def _seed_games_and_powers(tournament, the_round):...\n", "\"\"\"docstring\"\"\"\n", "seeder = _create_game_seeder(tournament, the_round.number())\n", "sitters, two_gamers = _sitters_and_two_gamers(tournament, the_round)\n", "return seeder.seed_games_and_powers(omitting_players=sitters,\n players_doubli...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "import sqlite3\n", "VAR_0 = sqlite3.connect('contacts.sqlite')\n", "for row in VAR_0.execute('SELECT * FROM contacts'):\n", "print(row)\n", "VAR_0.close()\n" ]
[ "import sqlite3\n", "db = sqlite3.connect('contacts.sqlite')\n", "for row in db.execute('SELECT * FROM contacts'):\n", "print(row)\n", "db.close()\n" ]
[ 0, 0, 4, 0, 0 ]
[ "Import'", "Assign'", "For", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "VAR_1 = VAR_0.copy()\n", "VAR_2 = self._get(VAR_1)\n", "self.assertEqual(VAR_2.status_code, 403)\n", "self.assertEqual(User.objects.count(), 1)\n" ]
[ "def test_invalid(self):...\n", "meta = DEF_SHIBD_META.copy()\n", "response = self._get(meta)\n", "self.assertEqual(response.status_code, 403)\n", "self.assertEqual(User.objects.count(), 1)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_3(self, VAR_1):...\n", "VAR_5 = dict()\n", "VAR_10, VAR_11 = self.get_epoch_day(VAR_1)\n", "VAR_5['interval'] = {'from': self.convert_local_ts_to_utc(VAR_10, self.\n local_timezone), 'to': self.convert_local_ts_to_utc(VAR_11, self.\n local_timezone)}\n", "VAR_12 = 'string'\n", "VAR_5['data...
[ "def get_requested_day(self, date):...\n", "data = dict()\n", "day_start, day_end = self.get_epoch_day(date)\n", "data['interval'] = {'from': self.convert_local_ts_to_utc(day_start, self.\n local_timezone), 'to': self.convert_local_ts_to_utc(day_end, self.\n local_timezone)}\n", "query = \"\"\"\n ...
[ 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "...
[ "@FUNC_0...\n", "return VAR_4\n" ]
[ "@handle_html...\n", "return base\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_6(self, VAR_40):...\n", "if VAR_40 and len(VAR_40) > 500:\n", "VAR_101.errors.add(errors.DESC_TOO_LONG)\n", "return unkeep_space(VAR_40 or '')\n" ]
[ "def run(self, description):...\n", "if description and len(description) > 500:\n", "c.errors.add(errors.DESC_TOO_LONG)\n", "return unkeep_space(description or '')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_7(self):...\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}/scale'.format(**locals())\n", "VAR_8 = {'web': 'not_an_int'}\n", "VAR_5 = self.client.post(VAR_4, json.dumps(...
[ "def test_container_errors(self):...\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}/scale'.format(**locals())\n", "body = {'web': 'not_an_int'}\n", "response = self.client.po...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_20, **VAR_1):...\n", "super().__init__(**kwargs)\n", "self._new_name = VAR_20\n" ]
[ "def __init__(self, new_name, **kwargs):...\n", "super().__init__(**kwargs)\n", "self._new_name = new_name\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'" ]
[ "def __init__(self, VAR_10, VAR_13, VAR_14, VAR_11=None):...\n", "CLASS_1.__init__(self, VAR_10, VAR_11)\n", "self.username = VAR_13\n", "self.password = VAR_14\n", "self.url = '%slogin' % self.base_url\n", "self.data = {'username': self.username, 'password': self.password, 'next': '/'}\n" ]
[ "def __init__(self, browser, username, password, base_url=None):...\n", "GenericRequest.__init__(self, browser, base_url)\n", "self.username = username\n", "self.password = password\n", "self.url = '%slogin' % self.base_url\n", "self.data = {'username': self.username, 'password': self.password, 'next': '/...
[ 0, 0, 0, 0, 5, 5 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@api.public...\n", "FUNC_31(self, 'DELETE')\n" ]
[ "@api.public...\n", "record(self, 'DELETE')\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_39(self):...\n", "\"\"\"docstring\"\"\"\n", "self.remove_sos_archive()\n", "if self.hash_retrieved:\n", "self.remove_file(self.sos_path + '.md5')\n", "VAR_48 = self.host.set_cleanup_cmd()\n", "if VAR_48:\n", "self.run_command(VAR_48)\n" ]
[ "def cleanup(self):...\n", "\"\"\"docstring\"\"\"\n", "self.remove_sos_archive()\n", "if self.hash_retrieved:\n", "self.remove_file(self.sos_path + '.md5')\n", "cleanup = self.host.set_cleanup_cmd()\n", "if cleanup:\n", "self.run_command(cleanup)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Condition", "Expr'", "Assign'", "Condition", "Expr'" ]
[ "import sys\n", "import logging\n", "import sqlalchemy as sa\n", "from . import filters\n", "from sqlalchemy.orm import joinedload\n", "from sqlalchemy.exc import IntegrityError\n", "from sqlalchemy import func\n", "from sqlalchemy.orm.properties import SynonymProperty\n", "from ..base import BaseIn...
[ "import sys\n", "import logging\n", "import sqlalchemy as sa\n", "from . import filters\n", "from sqlalchemy.orm import joinedload\n", "from sqlalchemy.exc import IntegrityError\n", "from sqlalchemy import func\n", "from sqlalchemy.orm.properties import SynonymProperty\n", "from ..base import BaseIn...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "For", "Condition", "Expr'", "Expr'", "Assign'", ...
[ "@VAR_0.route('/about')...\n", "return render_template('about.html')\n" ]
[ "@app.route('/about')...\n", "return render_template('about.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._device_class\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._device_class\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_1():...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = 'string'\n", "VAR_3 = psycopg2.connect(database=DBNAME)\n", "VAR_4 = VAR_3.cursor()\n", "VAR_4.execute(VAR_2)\n", "VAR_5 = VAR_4.fetchall()\n", "VAR_3.close()\n", "return VAR_5\n" ]
[ "def get_top_authors():...\n", "\"\"\"docstring\"\"\"\n", "query = (\n 'select au.name, count(alv.article) as views from articles a inner join article_log_view alv on a.slug = alv.article inner join authors au on a.author = au.id group by au.name order by count(alv.article) desc;'\n )\n", "db = ps...
[ 0, 0, 4, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_9(self):...\n", "self._hosts_cache = None\n", "for VAR_12 in self.parent_groups:\n", "VAR_12.clear_hosts_cache()\n" ]
[ "def clear_hosts_cache(self):...\n", "self._hosts_cache = None\n", "for g in self.parent_groups:\n", "g.clear_hosts_cache()\n" ]
[ 0, 0, 1, 1 ]
[ "FunctionDef'", "Assign'", "For", "Expr'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = ['hp3par_api_url', 'hp3par_username', 'hp3par_password', 'san_ip',\n 'san_login', 'san_password']\n", "self.common.check_flags(self.configuration, VAR_15)\n" ]
[ "def _check_flags(self):...\n", "\"\"\"docstring\"\"\"\n", "required_flags = ['hp3par_api_url', 'hp3par_username', 'hp3par_password',\n 'san_ip', 'san_login', 'san_password']\n", "self.common.check_flags(self.configuration, required_flags)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_5(VAR_5):...\n", "" ]
[ "def urlopen(url):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __init__(self, VAR_5, VAR_6):...\n", "self.master = VAR_5\n", "VAR_5.title('Jira Automation')\n", "self.firefox = VAR_6\n", "self.colorWhiteText = '#FFF'\n", "self.colorGreyBackground = '#708090'\n", "VAR_12 = Label(VAR_5, text=' ')\n", "VAR_12.grid(column=0, row=0)\n", "self.login_button = But...
[ "def __init__(self, master, selenium):...\n", "self.master = master\n", "master.title('Jira Automation')\n", "self.firefox = selenium\n", "self.colorWhiteText = '#FFF'\n", "self.colorGreyBackground = '#708090'\n", "empty_spacer_1 = Label(master, text=' ')\n", "empty_spacer_1.grid(column=0, row=0)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'",...