lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_4(self):...\n",
"self.parse_cluster_options()\n",
"for VAR_26 in ['skip_plugins', 'enable_plugins', 'plugin_options',\n",
"if self[VAR_26]:\n",
"VAR_13 = []\n",
"if isinstance(self[VAR_26], six.string_types):\n",
"self[VAR_26] = [self[VAR_26]]\n",
"for option in self[VAR_26]:\n",
"VAR_13 +... | [
"def parse_options(self):...\n",
"self.parse_cluster_options()\n",
"for opt in ['skip_plugins', 'enable_plugins', 'plugin_options', 'only_plugins'\n",
"if self[opt]:\n",
"opts = []\n",
"if isinstance(self[opt], six.string_types):\n",
"self[opt] = [self[opt]]\n",
"for option in self[opt]:\n",
"opts +... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Condition",
"Assign'",
"Condition",
"Assign'",
"For",
"AugAssign'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_10, VAR_11, VAR_12, VAR_13):...\n",
"self.cursor.execute(\n \"\"\"INSERT INTO file (submission_id, hash, filename, size)\n VALUES(?, ?, ?, ?)\"\"\"\n , (VAR_10, VAR_11, VAR_12, VAR_13))\n",
"self.database.commit()\n"
] | [
"def add_file(self, submission_id, hash, filename, size):...\n",
"self.cursor.execute(\n \"\"\"INSERT INTO file (submission_id, hash, filename, size)\n VALUES(?, ?, ?, ?)\"\"\"\n , (submission_id, hash, filename, size))\n",
"self.database.commit()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@jwt_refresh_token_required...\n",
"VAR_3 = get_jwt_identity()\n",
"VAR_4 = create_access_token(identity=current_user)\n",
"VAR_5 = jsonify({'refresh': True})\n",
"set_access_cookies(VAR_5, VAR_4)\n",
"return VAR_5\n"
] | [
"@jwt_refresh_token_required...\n",
"current_user = get_jwt_identity()\n",
"access_token = create_access_token(identity=current_user)\n",
"resp = jsonify({'refresh': True})\n",
"set_access_cookies(resp, access_token)\n",
"return resp\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_12(self, VAR_19):...\n",
"VAR_4 = self.directory\n",
"def FUNC_19(VAR_36):...\n",
"if VAR_36.strip() != '' and not os.path.exists(VAR_36):\n",
"os.makedirs(VAR_36)\n",
"VAR_37 = os.environ.copy()\n",
"VAR_37['LC_MESSAGES'] = 'C'\n",
"def FUNC_20():...\n",
"VAR_61 = Popen(['git', 'ls-tree',... | [
"def mirror(self, dst_dir):...\n",
"source_dir = self.directory\n",
"def mkdir_p(path):...\n",
"if path.strip() != '' and not os.path.exists(path):\n",
"os.makedirs(path)\n",
"env = os.environ.copy()\n",
"env['LC_MESSAGES'] = 'C'\n",
"def tracked_files():...\n",
"p = Popen(['git', 'ls-tree', '-r', '... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_17(VAR_20, **VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4[VAR_20] = VAR_19\n"
] | [
"def add_existing_task(task_id, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"created_tasks[task_id] = kwargs\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_3(self, VAR_3, VAR_4, VAR_9):...\n",
"if not isinstance(VAR_9, UserProfile):\n",
"return True\n",
"VAR_6 = VAR_3.user\n",
"return VAR_6 and (VAR_6.id is not None and VAR_6.id == VAR_9.user_id or\n super().has_object_permission(VAR_3, VAR_4, VAR_9))\n"
] | [
"def has_object_permission(self, request, view, obj):...\n",
"if not isinstance(obj, UserProfile):\n",
"return True\n",
"user = request.user\n",
"return user and (user.id is not None and user.id == obj.user_id or super().\n has_object_permission(request, view, obj))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def FUNC_32(self):...\n",
"VAR_44 = VAR_54.get_doc(self.doctype, self.name).as_dict()\n",
"for VAR_7 in self.as_dict():\n",
"VAR_25 = self.meta.get_field(VAR_7)\n",
"VAR_60 = VAR_44.get(VAR_7)\n",
"if VAR_25 and not VAR_25.allow_on_submit and (self.get(VAR_7) or VAR_60):\n",
"if VAR_25.fieldtype == 'Ta... | [
"def _validate_update_after_submit(self):...\n",
"db_values = frappe.get_doc(self.doctype, self.name).as_dict()\n",
"for key in self.as_dict():\n",
"df = self.meta.get_field(key)\n",
"db_value = db_values.get(key)\n",
"if df and not df.allow_on_submit and (self.get(key) or db_value):\n",
"if df.fieldtyp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"@memoized_property...\n",
"VAR_35 = {}\n",
"VAR_36 = self.get_options().paths or {}\n",
"for VAR_1, paths in sorted(VAR_36.items()):\n",
"VAR_43 = normalize_os_name(VAR_1)\n",
"return VAR_35\n",
"if VAR_43 in VAR_35:\n",
"VAR_0.warning('Multiple OS names alias to \"{}\"; combining results.'.format(\n... | [
"@memoized_property...\n",
"normalized = {}\n",
"jdk_paths = self.get_options().paths or {}\n",
"for name, paths in sorted(jdk_paths.items()):\n",
"rename = normalize_os_name(name)\n",
"return normalized\n",
"if rename in normalized:\n",
"logger.warning('Multiple OS names alias to \"{}\"; combining re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_29):...\n",
"if VAR_29 is None:\n",
"return VAR_101.user.pref_numsites\n",
"return VAR_54(VAR_55(int(VAR_29), 1), 250)\n"
] | [
"def run(self, limit):...\n",
"if limit is None:\n",
"return c.user.pref_numsites\n",
"return min(max(int(limit), 1), 250)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_13 = os.path.join(FUNC_0(), 'tmp')\n",
"if os.path.exists(VAR_13):\n",
"import shutil\n",
"shutil.rmtree(VAR_13)\n"
] | [
"def clean_tmp():...\n",
"\"\"\"docstring\"\"\"\n",
"tmp_path = os.path.join(path_to_visbrain_data(), 'tmp')\n",
"if os.path.exists(tmp_path):\n",
"import shutil\n",
"shutil.rmtree(tmp_path)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Import'",
"Expr'"
] |
[
"def FUNC_22(VAR_30, VAR_3):...\n",
"if not isinstance(VAR_30, _IOFile):\n",
"return IOFile(VAR_30, VAR_16=self)\n",
"return VAR_30.apply_wildcards(VAR_3, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n"
] | [
"def concretize_iofile(f, wildcards):...\n",
"if not isinstance(f, _IOFile):\n",
"return IOFile(f, rule=self)\n",
"return f.apply_wildcards(wildcards, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"return self.groups\n"
] | [
"def get_groups(self):...\n",
"return self.groups\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_18(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer())\n"
] | [
"def test_z_delete_load_balancer(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name, 'size': 1}\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'show')\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'offline')\n",
"s... | [
"def test_delete_volume(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name, 'size': 1}\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'show')\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'off... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"VAR_7 = BokChoyTestSuite('', VAR_3=True)\n",
"VAR_1 = 'tests'\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name, VAR_3=True))\n"
] | [
"def test_verify_xss(self):...\n",
"suite = BokChoyTestSuite('', verify_xss=True)\n",
"name = 'tests'\n",
"self.assertEqual(suite.cmd, self._expected_command(name=name, verify_xss=True))\n"
] | [
0,
0,
0,
3
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = configuration_helpers.get_value(\n 'ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS', settings.\n ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS)\n",
"return [field for field in VAR_6['fields'] if field['name'] not in VAR_19]\n"
] | [
"def enterprise_fields_only(fields):...\n",
"\"\"\"docstring\"\"\"\n",
"enterprise_exclusions = configuration_helpers.get_value(\n 'ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS', settings.\n ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS)\n",
"return [field for field in fields['fields'] if field['name'] not in\n ... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_4(VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = hashlib.sha1()\n",
"for name, content in FUNC_2(VAR_2, VAR_3, VAR_4, VAR_5):\n",
"logging.warning('Missing expected file. Hash will be invalid.')\n",
"VAR_12 = VAR_10.hexdigest()\n",
"VAR_10.update(str(len(name)))\n",
... | [
"def get_swarming_bot_version(root_dir, host, host_version, additionals):...\n",
"\"\"\"docstring\"\"\"\n",
"h = hashlib.sha1()\n",
"for name, content in yield_swarming_bot_files(root_dir, host, host_version,\n",
"logging.warning('Missing expected file. Hash will be invalid.')\n",
"bot_version = h.hexdige... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'"
] |
[
"from django.db import models\n",
"from .common_info import CommonInfo\n",
"from django.urls import reverse\n",
"from django.utils import timezone\n",
"from .document_type import DocumentType\n",
"from django.core.exceptions import ValidationError\n",
"\"\"\"string\"\"\"\n",
"VAR_0 = models.CharField(... | [
"from django.db import models\n",
"from .common_info import CommonInfo\n",
"from django.urls import reverse\n",
"from django.utils import timezone\n",
"from .document_type import DocumentType\n",
"from django.core.exceptions import ValidationError\n",
"\"\"\"\n A DataDocument object is a single sourc... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_37 = np.random.get_state()\n",
"np.random.seed(None)\n",
"VAR_38 = np.random.bytes(ray_constants.ID_SIZE)\n",
"np.random.set_state(VAR_37)\n",
"return VAR_38\n"
] | [
"def random_string():...\n",
"\"\"\"docstring\"\"\"\n",
"numpy_state = np.random.get_state()\n",
"np.random.seed(None)\n",
"random_id = np.random.bytes(ray_constants.ID_SIZE)\n",
"np.random.set_state(numpy_state)\n",
"return random_id\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = self.bindings\n",
"VAR_11 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"VAR_9 = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'gce', 'serverGroupName': group_name, 'region': bindi... | [
"def delete_server_group(self):...\n",
"\"\"\"docstring\"\"\"\n",
"bindings = self.bindings\n",
"group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'gce', 'serverGroupName': group... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"import arrow\n",
"import logging\n",
"import json\n",
"import os\n",
"from urllib.parse import urlparse\n",
"from channels import Group\n",
"from rest_framework.generics import CreateAPIView\n",
"from rest_framework.permissions import IsAuthenticated\n",
"from rest_framework.response import Respons... | [
"import arrow\n",
"import logging\n",
"import json\n",
"import os\n",
"from urllib.parse import urlparse\n",
"from channels import Group\n",
"from rest_framework.generics import CreateAPIView\n",
"from rest_framework.permissions import IsAuthenticated\n",
"from rest_framework.response import Respons... | [
6,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
6,
6,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'"... |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_0.project_data():\n",
"VAR_2 = VAR_0.project_data()['urtext_path']\n",
"VAR_2 = '.'\n",
"return VAR_2\n"
] | [
"def get_path(window):...\n",
"\"\"\"docstring\"\"\"\n",
"if window.project_data():\n",
"path = window.project_data()['urtext_path']\n",
"path = '.'\n",
"return path\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_27(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.exists and FUNC_0(self.file):\n"
] | [
"def check_broken_symlink(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.exists and lstat(self.file):\n"
] | [
0,
0,
7
] | [
"FunctionDef'",
"Docstring",
"Condition"
] |
[
"@tornado.gen.coroutine...\n",
"VAR_17 = 'SELECT date, temp_average_air FROM reports WHERE YEAR(date) = %s'\n",
"VAR_18 = VAR_2,\n",
"VAR_19 = yield VAR_1.execute(query=sql, VAR_18=params)\n",
"VAR_26 = VAR_19.fetchall()\n",
"VAR_25 = {}\n",
"for VAR_21 in VAR_26:\n",
"VAR_11 = VAR_21[0].timetuple().t... | [
"@tornado.gen.coroutine...\n",
"sql = 'SELECT date, temp_average_air FROM reports WHERE YEAR(date) = %s'\n",
"params = year,\n",
"cursor = yield tx.execute(query=sql, params=params)\n",
"data = cursor.fetchall()\n",
"res = {}\n",
"for row in data:\n",
"day = row[0].timetuple().tm_yday\n",
"return re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_5(self, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"self._path = b(VAR_7, self.charset)\n",
"self._parts = None\n",
"self._leading_slash = False\n",
"self._trailing_slash = False\n",
"return self\n"
] | [
"def parse(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"self._path = b(path, self.charset)\n",
"self._parts = None\n",
"self._leading_slash = False\n",
"self._trailing_slash = False\n",
"return self\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for retries in range(1, 100):\n",
"logger.info('Checking to see if mcpd is up')\n",
"if VAR_16 is 0:\n",
"VAR_16 = shellutil.run(\n '/usr/bin/tmsh -a show sys mcp-state field-fmt 2>/dev/null | grep phase | grep running'\n , VAR_8=False)\n",
"re... | [
"def _wait_until_mcpd_is_initialized(self):...\n",
"\"\"\"docstring\"\"\"\n",
"for retries in range(1, 100):\n",
"logger.info('Checking to see if mcpd is up')\n",
"if rc is 0:\n",
"rc = shellutil.run(\n '/usr/bin/tmsh -a show sys mcp-state field-fmt 2>/dev/null | grep phase | grep running'\n , chk_e... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n",
"create_test_db()\n",
"os.rename(filename, 'temp_' + filename)\n",
"for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n",
"os.rename('test_' + filename, filename)\n"
] | [
"def setUp(self):...\n",
"for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n",
"create_test_db()\n",
"os.rename(filename, 'temp_' + filename)\n",
"for filename in ['cert_db.sqlite3', 'rf_model.pkl', 'rf_features.pkl']:\n",
"os.rename('test_' + filename, filename)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'",
"Expr'",
"For",
"Expr'"
] |
[
"@memoized_property...\n",
"return PythonSetup.global_instance()\n"
] | [
"@memoized_property...\n",
"return PythonSetup.global_instance()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_0():...\n",
"VAR_0 = {'static_path': os.path.join(os.path.dirname(__file__), './static'),\n 'template_path': './server/templates', 'login_url': '/login',\n 'cookie_secret': os.urandom(24), 'xsrf_cookies': True}\n",
"VAR_1 = [('/', CLASS_1), ('/report', CLASS_3), ('/create', CLASS_3.\n NewRepo... | [
"def launch():...\n",
"server_settings = {'static_path': os.path.join(os.path.dirname(__file__),\n './static'), 'template_path': './server/templates', 'login_url':\n '/login', 'cookie_secret': os.urandom(24), 'xsrf_cookies': True}\n",
"handlers = [('/', IndexController), ('/report', ReportController), (\n... | [
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_8 = 'test_foo.py:FooTest.test_bar'\n",
"VAR_7 = BokChoyTestSuite('', test_spec=spec)\n",
"VAR_1 = 'tests/{}'.format(VAR_8)\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name))\n"
] | [
"def test_testcase_spec(self):...\n",
"spec = 'test_foo.py:FooTest.test_bar'\n",
"suite = BokChoyTestSuite('', test_spec=spec)\n",
"name = 'tests/{}'.format(spec)\n",
"self.assertEqual(suite.cmd, self._expected_command(name=name))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_16(self, VAR_29=False):...\n",
"VAR_46 = list(get_plugins(pm))\n",
"if not VAR_29:\n",
"VAR_46 = [p for p in VAR_46 if p['name'] not in DEFAULT_PLUGINS]\n",
"return [{'name': p['name'], 'static': p['static_path'] is not None,\n 'templates': p['templates_path'] is not None, 'version': p.get(\n ... | [
"def plugins(self, show_all=False):...\n",
"ps = list(get_plugins(pm))\n",
"if not show_all:\n",
"ps = [p for p in ps if p['name'] not in DEFAULT_PLUGINS]\n",
"return [{'name': p['name'], 'static': p['static_path'] is not None,\n 'templates': p['templates_path'] is not None, 'version': p.get(\n 'versi... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = SosNode(VAR_5, self.config)\n",
"if VAR_6.connected:\n",
"self.client_list.append(VAR_6)\n",
"VAR_6.close_ssh_session()\n"
] | [
"def _connect_to_node(self, node):...\n",
"\"\"\"docstring\"\"\"\n",
"client = SosNode(node, self.config)\n",
"if client.connected:\n",
"self.client_list.append(client)\n",
"client.close_ssh_session()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"from django.core.management.base import BaseCommand\n",
"from ct.models import Course, Role, UnitLesson, Unit, Lesson, Response\n",
"from ctms.models import Invite\n",
"from chat.models import Chat, EnrollUnitCode\n",
"from accounts.models import Instructor\n",
"from core.common.utils import update_onboa... | [
"from django.core.management.base import BaseCommand\n",
"from ct.models import Course, Role, UnitLesson, Unit, Lesson, Response\n",
"from ctms.models import Invite\n",
"from chat.models import Chat, EnrollUnitCode\n",
"from accounts.models import Instructor\n",
"from core.common.utils import update_onboa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
6,
6,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",... |
[
"\"\"\"string\"\"\"\n",
"import logging as log\n",
"import numpy as np\n",
"from numpy.random import randn\n",
"from openqml import Device, DeviceError\n",
"from openqml import Variable\n",
"import projectq as pq\n",
"import projectq.setups.ibm\n",
"from projectq.ops import HGate, XGate, YGate, ZGat... | [
"\"\"\"\nProjectQ plugin\n========================\n\n**Module name:** :mod:`openqml.plugins.projectq`\n\n.. currentmodule:: openqml.plugins.projectq\n\nThis plugin provides the interface between OpenQML and ProjecQ.\nIt enables OpenQML to optimize quantum circuits simulable with ProjectQ.\n\nProjecQ supports sever... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Expr'",
"For",
... |
[
"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_0(self):...\n",
"self.serial.close()\n"
] | [
"def close(self):...\n",
"self.serial.close()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_2():...\n",
"VAR_2 = json.load(f)\n"
] | [
"def read_cms_config():...\n",
"cms_config = json.load(f)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_2 = re.compile('<.*?>')\n",
"VAR_3 = re.sub(VAR_2, '', VAR_0)\n",
"return VAR_3\n"
] | [
"def cleanhtml(raw_html):...\n",
"cleanr = re.compile('<.*?>')\n",
"cleantext = re.sub(cleanr, '', raw_html)\n",
"return cleantext\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@classmethod...\n",
"assert engine\n",
"VAR_9 = text('string')\n",
"VAR_7 = engine.connect()\n",
"VAR_10 = VAR_7.execute(VAR_9, VAR_1=username).fetchone()\n",
"if VAR_10 is not None:\n",
"VAR_10 = CLASS_0(VAR_10[0], VAR_10[1], VAR_10[2].decode('utf-8'), VAR_10[3])\n",
"VAR_7.close()\n",
"return VAR... | [
"@classmethod...\n",
"assert engine\n",
"s = text(\n 'SELECT user_id, username, hashed_password, roll_id FROM users WHERE username = :username AND expire_date is null'\n )\n",
"connection = engine.connect()\n",
"rc = connection.execute(s, username=username).fetchone()\n",
"if rc is not None:\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assert'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self, VAR_47):...\n",
"if VAR_101.user_is_admin:\n",
"return True\n",
"if VAR_101.user_is_loggedin:\n",
"VAR_18 = Thing._by_fullname(VAR_47, data=True)\n",
"abort(403, 'forbidden')\n",
"VAR_109 = VAR_18.subreddit_slow\n",
"if VAR_109.can_ban(VAR_101.user):\n",
"return True\n"
] | [
"def run(self, thing_name):...\n",
"if c.user_is_admin:\n",
"return True\n",
"if c.user_is_loggedin:\n",
"item = Thing._by_fullname(thing_name, data=True)\n",
"abort(403, 'forbidden')\n",
"subreddit = item.subreddit_slow\n",
"if subreddit.can_ban(c.user):\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_13, VAR_14=None, VAR_15=None):...\n",
"self.lexeme = VAR_14\n",
"self.ttype = VAR_13\n",
"self.position = VAR_15\n"
] | [
"def __init__(self, ttype, lexeme=None, position=None):...\n",
"self.lexeme = lexeme\n",
"self.ttype = ttype\n",
"self.position = position\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"from django.shortcuts import render\n",
"from django.http import HttpResponse, JsonResponse\n",
"from django.views.decorators.csrf import csrf_exempt\n",
"from rest_framework.renderers import JSONRenderer\n",
"from rest_framework.parsers import JSONParser\n",
"from rest_framework.response import Response... | [
"from django.shortcuts import render\n",
"from django.http import HttpResponse, JsonResponse\n",
"from django.views.decorators.csrf import csrf_exempt\n",
"from rest_framework.renderers import JSONRenderer\n",
"from rest_framework.parsers import JSONParser\n",
"from rest_framework.response import Response... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"@wraps(VAR_6)...\n",
"if 'logged_in' in VAR_10:\n",
"return VAR_6(*VAR_8, **kwargs)\n",
"flash('Unauthorized, Please login', 'danger')\n",
"return redirect(url_for('login'))\n"
] | [
"@wraps(f)...\n",
"if 'logged_in' in session:\n",
"return f(*args, **kwargs)\n",
"flash('Unauthorized, Please login', 'danger')\n",
"return redirect(url_for('login'))\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_16(VAR_6):...\n",
"if 'Content-Security-Policy' not in VAR_6.headers:\n",
"return False\n",
"if \"default-src 'self'\" not in VAR_6.headers['Content-Security-Policy']:\n",
"return False\n",
"return True\n"
] | [
"def validate_csp(page):...\n",
"if 'Content-Security-Policy' not in page.headers:\n",
"return False\n",
"if \"default-src 'self'\" not in page.headers['Content-Security-Policy']:\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"if not self.route:\n",
"return frappe.db.get_value('Blog Category', self.blog_category, 'route'\n ) + '/' + self.scrub(self.title)\n"
] | [
"def make_route(self):...\n",
"if not self.route:\n",
"return frappe.db.get_value('Blog Category', self.blog_category, 'route'\n ) + '/' + self.scrub(self.title)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_22(VAR_48):...\n",
"for VAR_29, VAR_51 in sorted(VAR_48.options.items()):\n",
"if VAR_51 is None:\n",
"VAR_46.append('unset(%s CACHE)\\n' % VAR_29)\n",
"if isinstance(VAR_51, bool):\n",
"VAR_79 = 'BOOL'\n",
"VAR_79 = 'STRING'\n",
"VAR_51 = 'ON' if VAR_51 else 'OFF'\n",
"VAR_46.append('set(... | [
"def dump_options(module):...\n",
"for key, value in sorted(module.options.items()):\n",
"if value is None:\n",
"cmakelists_rows.append('unset(%s CACHE)\\n' % key)\n",
"if isinstance(value, bool):\n",
"kind = 'BOOL'\n",
"kind = 'STRING'\n",
"value = 'ON' if value else 'OFF'\n",
"cmakelists_rows.appe... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_22(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.client = paramiko.SSHClient()\n",
"if not self.config['password']:\n",
"self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n",
"self.log_error('Authentication failed. SSH keys installed?')\n",
"self.log_error('Authentication fail... | [
"def open_ssh_session(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.client = paramiko.SSHClient()\n",
"if not self.config['password']:\n",
"self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n",
"self.log_error('Authentication failed. SSH keys installed?')\n",
"self.log_error('Authentica... | [
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",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_4, VAR_5):...\n",
"self.port = 23\n",
"super().__init__(VAR_4, VAR_5)\n",
"if VAR_5.jtag:\n",
"self.connect_telnet()\n"
] | [
"def __init__(self, database, options):...\n",
"self.port = 23\n",
"super().__init__(database, options)\n",
"if options.jtag:\n",
"self.connect_telnet()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_7 = Container.objects.create(owner=User.objects.get(username='autotest'\n ), app=App.objects.get(id=app_i... | [
"def test_container_state_protected(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"c = Container.objects.create(owner=User.objects.get(username='autotest'),\n app... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_44(self):...\n",
"return [i.name for i in self.obj.__mapper__.columns if isinstance(i.type,\n FileColumn)]\n"
] | [
"def get_file_column_list(self):...\n",
"return [i.name for i in self.obj.__mapper__.columns if isinstance(i.type,\n FileColumn)]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_22(self, VAR_14):...\n",
"if self.is_relation_many_to_one(VAR_14):\n",
"VAR_34 = self.get_relation_fk(VAR_14)\n",
"return self.list_columns[VAR_14].nullable\n",
"return False\n",
"return VAR_34.nullable\n"
] | [
"def is_nullable(self, col_name):...\n",
"if self.is_relation_many_to_one(col_name):\n",
"col = self.get_relation_fk(col_name)\n",
"return self.list_columns[col_name].nullable\n",
"return False\n",
"return col.nullable\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Return'",
"Return'"
] |
[
"def __str__(self):...\n",
"from beamr.interpreters.config import Config\n",
"if VAR_31.effectiveConfig['bib']:\n",
"return '\\\\cite{' + self.txt + '}'\n",
"warn('Citations used but no bibliography file given.')\n",
"return ''\n"
] | [
"def __str__(self):...\n",
"from beamr.interpreters.config import Config\n",
"if Config.effectiveConfig['bib']:\n",
"return '\\\\cite{' + self.txt + '}'\n",
"warn('Citations used but no bibliography file given.')\n",
"return ''\n"
] | [
0,
0,
2,
2,
2,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.pid = VAR_1\n",
"self.comp_name = VAR_2\n"
] | [
"def __init__(self, pid, comp_name):...\n",
"\"\"\"docstring\"\"\"\n",
"self.pid = pid\n",
"self.comp_name = comp_name\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'"
] |
[
"def FUNC_8():...\n",
"VAR_38 = FUNC_3(VAR_18, VAR_19)\n",
"VAR_37 = CLASS_19 if VAR_20 else CLASS_20\n",
"return VAR_37, VAR_38\n"
] | [
"def five():...\n",
"HHFormSet = make_formset(parent, child)\n",
"ParentForm = ExtractedHHDocForm if extracted else ExtractedHHDocEditForm\n",
"return ParentForm, HHFormSet\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = dict()\n",
"self.cursor.execute('SELECT * FROM {0}'.format(VAR_1))\n",
"VAR_6 = {}\n",
"for VAR_13 in self.cursor:\n",
"VAR_6[VAR_12(VAR_13[3])] = {}\n",
"return json.dumps(VAR_6)\n",
"VAR_6[VAR_12(VAR_13[3])]['nome'] = VAR_13[0]\n... | [
"def select(self, table):...\n",
"\"\"\"docstring\"\"\"\n",
"aux_dict = dict()\n",
"self.cursor.execute('SELECT * FROM {0}'.format(table))\n",
"json_data = {}\n",
"for user in self.cursor:\n",
"json_data[str(user[3])] = {}\n",
"return json.dumps(json_data)\n",
"json_data[str(user[3])]['nome'] = user... | [
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_14():...\n",
"populate_test_database()\n",
"FUNC_1('first playlist')\n",
"VAR_11 = VAR_3.delete('/playlists/2')\n",
"assert VAR_11.json['status'] == 'NOK'\n",
"assert VAR_11.json['message'] != None\n"
] | [
"def test_should_return_a_not_ok_status_when_deleting_an_unknown_playlist_id():...\n",
"populate_test_database()\n",
"create_playlist('first playlist')\n",
"response = test_app.delete('/playlists/2')\n",
"assert response.json['status'] == 'NOK'\n",
"assert response.json['message'] != None\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"def FUNC_6(self, VAR_64):...\n",
"VAR_90 = VAR_64.split(',')\n",
"return Thing._by_fullname(VAR_90, data=True, return_dict=False)\n"
] | [
"def run(self, id_str):...\n",
"tids = id_str.split(',')\n",
"return Thing._by_fullname(tids, data=True, return_dict=False)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self, *VAR_1, **VAR_2):...\n",
"for instructor in Instructor.objects.all():\n",
"VAR_5 = Course.objects.get(id=settings.ONBOARDING_INTRODUCTION_COURSE_ID)\n",
"print('Onboarding course is not provided')\n",
"VAR_3 = Chat.objects.filter(user=instructor.user,\n enroll_code__courseUnit__course=c... | [
"def handle(self, *args, **options):...\n",
"for instructor in Instructor.objects.all():\n",
"course = Course.objects.get(id=settings.ONBOARDING_INTRODUCTION_COURSE_ID)\n",
"print('Onboarding course is not provided')\n",
"chat_exists = Chat.objects.filter(user=instructor.user,\n enroll_code__courseUnit__... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
6,
6,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_16, VAR_17):...\n",
"if not (VAR_16, VAR_17) in self.wz.req_handlers:\n",
"self.log.debug('Route %s,%s was not bound', VAR_16, VAR_17)\n",
"self.log.debug('Unbinding route %s,%s', VAR_16, VAR_17)\n",
"return\n",
"self.wz.del_req_handler(VAR_16, VAR_17)\n",
"def FUNC_23(VAR_33, VAR_... | [
"def unbind_route(self, i, m):...\n",
"if not (i, m) in self.wz.req_handlers:\n",
"self.log.debug('Route %s,%s was not bound', i, m)\n",
"self.log.debug('Unbinding route %s,%s', i, m)\n",
"return\n",
"self.wz.del_req_handler(i, m)\n",
"def accept(that, reqid, seqnum, status, data):...\n",
"if status =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __str__(self):...\n",
"return os.path.basename(self.path)\n"
] | [
"def __str__(self):...\n",
"return os.path.basename(self.path)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(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}/builds'.format(**locals())\n",
"VAR_8 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d... | [
"def test_container_command_format(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}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example', 'sha': 'a' * 40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
""
] | [
"def tearDown(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_9(VAR_8, VAR_11, VAR_12=False, VAR_13=False, VAR_14=None, VAR_15=False...\n",
"def FUNC_35(VAR_29):...\n",
"VAR_40 = VAR_29.group('name')\n",
"VAR_16 = VAR_11[VAR_40]\n",
"if VAR_15:\n",
"return re.sub(VAR_5, FUNC_35, VAR_8)\n",
"if VAR_13 and VAR_16 == VAR_14:\n",
"return '{{{}}}'.format(VA... | [
"def apply_wildcards(pattern, wildcards, fill_missing=False, fail_dynamic=...\n",
"def format_match(match):...\n",
"name = match.group('name')\n",
"value = wildcards[name]\n",
"if keep_dynamic:\n",
"return re.sub(_wildcard_regex, format_match, pattern)\n",
"if fail_dynamic and value == dynamic_fill:\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_20(self, VAR_17, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def create_export(self, context, volume):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = api.nova.keypair_list(VAR_1)\n",
"return {'items': [u.to_dict() for u in VAR_10]}\n"
] | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"result = api.nova.keypair_list(request)\n",
"return {'items': [u.to_dict() for u in result]}\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_10=True):...\n",
"return self.aq_parent.breadcrumbs_obj_path(VAR_10)\n"
] | [
"def breadcrumbs_obj_path(self, portalMaster=True):...\n",
"return self.aq_parent.breadcrumbs_obj_path(portalMaster)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(VAR_16):...\n",
"return isinstance(VAR_16, str) or not isinstance(VAR_16, Iterable)\n"
] | [
"def not_iterable(value):...\n",
"return isinstance(value, str) or not isinstance(value, Iterable)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@bot.message_handler(content_types=['text'])...\n",
"VAR_12 = users.find_one(VAR_1).language\n",
"VAR_7 = users.find_one(VAR_1)\n",
"if VAR_1.text == 'Русский/English':\n",
"VAR_37 = users.find_one(VAR_1).switch_language()\n",
"if VAR_1.text == messages[VAR_12]['top_cams']:\n",
"if VAR_12 != VAR_37:\n"... | [
"@bot.message_handler(content_types=['text'])...\n",
"current_user_lang = users.find_one(message).language\n",
"user = users.find_one(message)\n",
"if message.text == 'Русский/English':\n",
"new_lang = users.find_one(message).switch_language()\n",
"if message.text == messages[current_user_lang]['top_cams'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Ex... |
[
"def FUNC_0(self, VAR_0, VAR_1, VAR_2, VAR_3=None, VAR_4=None, VAR_5=None):...\n",
"VAR_8 = self.create_select(VAR_0) + ' '\n",
"VAR_8 += self.create_from(VAR_1) + ' '\n",
"VAR_8 += self.create_where(VAR_2)\n",
"if VAR_3:\n",
"VAR_8 += ' ' + self.create_sort_by(VAR_3)\n",
"if VAR_4 and VAR_5:\n",
"VAR... | [
"def get_sql(self, select, table, where, sort_by=None, offset=None, limit=None):...\n",
"sql = self.create_select(select) + ' '\n",
"sql += self.create_from(table) + ' '\n",
"sql += self.create_where(where)\n",
"if sort_by:\n",
"sql += ' ' + self.create_sort_by(sort_by)\n",
"if offset and limit:\n",
"... | [
0,
0,
0,
4,
0,
0,
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"AugAssign'",
"AugAssign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Return'"
] |
[
"def FUNC_21(self):...\n",
"if not self._IsServerAlive():\n",
"return\n",
"SendEventNotificationAsync('CurrentIdentifierFinished')\n"
] | [
"def OnCurrentIdentifierFinished(self):...\n",
"if not self._IsServerAlive():\n",
"return\n",
"SendEventNotificationAsync('CurrentIdentifierFinished')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_2(VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = 2.55 + 1\n",
"VAR_15 = float(len(VAR_4)) / VAR_14\n",
"VAR_16 = [word for word in re.split('\\\\W', VAR_4) if word.isalpha()]\n",
"VAR_17 = len(VAR_16)\n",
"return VAR_17 > VAR_15\n"
] | [
"def _is_english_text(text):...\n",
"\"\"\"docstring\"\"\"\n",
"avg_word_length = 2.55 + 1\n",
"expected_word_number = float(len(text)) / avg_word_length\n",
"words = [word for word in re.split('\\\\W', text) if word.isalpha()]\n",
"word_number = len(words)\n",
"return word_number > expected_word_number... | [
0,
0,
7,
7,
7,
7,
7
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = (\n '--with-xunit --xunit-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --verbosity=2'\n .format(repo_dir=REPO_DIR, shard_str='/shard_' + self.shard if self.\n shard else ''))\n",
"VAR_7 = BokChoyTestSuite('', num_processes=1)\n"... | [
"def test_verbosity_settings_1_process(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expected_verbosity_string = (\n '--with-xunit --xunit-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --verbosity=2'\n .format(repo_dir=REPO_DIR, shard_str='/shard_' + self.shard if self.\n shard else ''))\n",
"sui... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_64):...\n",
"self.func = VAR_64\n",
"self.shellcmd = None\n",
"self.norun = False\n",
"self.input = None\n",
"self.output = None\n",
"self.params = None\n",
"self.message = None\n",
"self.benchmark = None\n",
"self.threads = None\n",
"self.resources = None\n",
"self.pri... | [
"def __init__(self, func):...\n",
"self.func = func\n",
"self.shellcmd = None\n",
"self.norun = False\n",
"self.input = None\n",
"self.output = None\n",
"self.params = None\n",
"self.message = None\n",
"self.benchmark = None\n",
"self.threads = None\n",
"self.resources = None\n",
"self.priorit... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Docstring"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = None\n",
"if self.main and self.main.projects:\n",
"VAR_12 = self.main.projects.get_active_project_path()\n",
"if not VAR_12:\n",
"VAR_12 = getcwd_or_home()\n",
"return VAR_12\n"
] | [
"def get_root_path(self):...\n",
"\"\"\"docstring\"\"\"\n",
"path = None\n",
"if self.main and self.main.projects:\n",
"path = self.main.projects.get_active_project_path()\n",
"if not path:\n",
"path = getcwd_or_home()\n",
"return path\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_4(VAR_11):...\n",
"VAR_17 = []\n",
"for r in VAR_11:\n",
"VAR_18 = {'value': r[0], 'description': ', '.join(unique(cstr(d) for d in r if\n d)[1:])}\n",
"return VAR_17\n",
"VAR_17.append(VAR_18)\n"
] | [
"def build_for_autosuggest(res):...\n",
"results = []\n",
"for r in res:\n",
"out = {'value': r[0], 'description': ', '.join(unique(cstr(d) for d in r if\n d)[1:])}\n",
"return results\n",
"results.append(out)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"@VAR_0.route('/add', methods=['POST'])...\n",
"return render_template('show_entries.html')\n"
] | [
"@app.route('/add', methods=['POST'])...\n",
"return render_template('show_entries.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@session_manager...\n",
"\"\"\"docstring\"\"\"\n",
"from invenio.modules.accounts.models import User, UserEXT\n",
"from invenio.ext.sqlalchemy import db\n",
"from ..handlers import token_session_key\n",
"from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\n",
"import json\n",
"import r... | [
"@session_manager...\n",
"\"\"\"docstring\"\"\"\n",
"from invenio.modules.accounts.models import User, UserEXT\n",
"from invenio.ext.sqlalchemy import db\n",
"from ..handlers import token_session_key\n",
"from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\n",
"import json\n",
"import r... | [
0,
0,
0,
0,
0,
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",
"Docstring",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
... |
[
"def FUNC_23(self, VAR_26, VAR_7, VAR_27, VAR_28, VAR_25):...\n",
"\"\"\"docstring\"\"\"\n",
"if __debug__:\n",
"self.__log_traverse_one(VAR_26, VAR_7, VAR_27, VAR_28)\n",
"self.__traversed.add((VAR_27, VAR_28))\n",
"VAR_40 = VAR_27 or VAR_28\n",
"if VAR_40.do_traverse():\n",
"VAR_48 = RELATION_OPERAT... | [
"def traverse_one(self, path, attribute, source, target, visitor):...\n",
"\"\"\"docstring\"\"\"\n",
"if __debug__:\n",
"self.__log_traverse_one(path, attribute, source, target)\n",
"self.__traversed.add((source, target))\n",
"prx = source or target\n",
"if prx.do_traverse():\n",
"rel_op = RELATION_OP... | [
0,
0,
0,
1,
1,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1,
1,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Ass... |
[
"def FUNC_48(self):...\n",
"self.cursor.execute('create table t1(id int)')\n",
"for i in range(1, 5):\n",
"self.cursor.execute('insert into t1 values(?)', i)\n",
"self.cursor.execute('select id from t1 order by id')\n",
"self.assertEqual(self.cursor.fetchone()[0], 1)\n",
"self.cursor.skip(2)\n",
"self... | [
"def test_skip(self):...\n",
"self.cursor.execute('create table t1(id int)')\n",
"for i in range(1, 5):\n",
"self.cursor.execute('insert into t1 values(?)', i)\n",
"self.cursor.execute('select id from t1 order by id')\n",
"self.assertEqual(self.cursor.fetchone()[0], 1)\n",
"self.cursor.skip(2)\n",
"se... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"VAR_4 = Lint.executable\n",
"VAR_5 = 'invalid_binary_which_doesnt_exist'\n",
"Lint.executable = VAR_5\n",
"self.assertEqual(Lint.check_prerequisites(), \"'{}' is not installed.\".\n format(VAR_5))\n",
"Lint.executable = 'echo'\n",
"self.assertTrue(Lint.check_prerequisites()... | [
"def test_missing_binary(self):...\n",
"old_binary = Lint.executable\n",
"invalid_binary = 'invalid_binary_which_doesnt_exist'\n",
"Lint.executable = invalid_binary\n",
"self.assertEqual(Lint.check_prerequisites(), \"'{}' is not installed.\".\n format(invalid_binary))\n",
"Lint.executable = 'echo'\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_10(VAR_15):...\n",
"VAR_36 = Thread(target=self.sendRandomPic, args=(chat_id, MMKM))\n",
"self.pic_sender_threads[VAR_15] = VAR_36\n",
"VAR_36.start()\n"
] | [
"def startThread(chat_id):...\n",
"t = Thread(target=self.sendRandomPic, args=(chat_id, MMKM))\n",
"self.pic_sender_threads[chat_id] = t\n",
"t.start()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self, VAR_24):...\n",
"for toc_node in VAR_24.findall(\".//*[@class='toc']\"):\n",
"VAR_32 = toc_node[0]\n",
"if self.has_a_single_h1:\n",
"VAR_34 = VAR_32[0]\n",
"VAR_35 = VAR_32\n",
"VAR_35 = VAR_34[1]\n",
"toc_node.remove(VAR_32)\n",
"VAR_28 = ElementTree.SubElement(toc_node, 'h2')\n... | [
"def run(self, tree):...\n",
"for toc_node in tree.findall(\".//*[@class='toc']\"):\n",
"toc_ul = toc_node[0]\n",
"if self.has_a_single_h1:\n",
"toc_ul_li = toc_ul[0]\n",
"ul_with_the_desired_toc_entries = toc_ul\n",
"ul_with_the_desired_toc_entries = toc_ul_li[1]\n",
"toc_node.remove(toc_ul)\n",
"c... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'"
] |
[
"def FUNC_21(VAR_6):...\n",
"return FUNC_7(VAR_6, 'X-Permitted-Cross-Domain-Policies', 'master-only')\n"
] | [
"def validate_cross_domain_policy(page):...\n",
"return validate_security_header(page, 'X-Permitted-Cross-Domain-Policies',\n 'master-only')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(self, VAR_5):...\n",
"self.cursor.execute(self.SQL_INSERT_JSON % (self.name, json.dumps(VAR_5)))\n",
"return self.cursor.fetchone()[0]\n"
] | [
"def put(self, data):...\n",
"self.cursor.execute(self.SQL_INSERT_JSON % (self.name, json.dumps(data)))\n",
"return self.cursor.fetchone()[0]\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return os.path.join(os.path.dirname(VAR_0), 'swarming_bot.zip')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return os.path.join(os.path.dirname(THIS_FILE), 'swarming_bot.zip')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@api.require(lambda : False)...\n",
"VAR_6.fail('Handler code should not be called')\n"
] | [
"@api.require(lambda : False)...\n",
"test.fail('Handler code should not be called')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_26(VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_68 = len(VAR_17)\n",
"VAR_69 = lambda x: int(float(x) / 100 * VAR_68)\n",
"VAR_70 = [VAR_17[VAR_69(start):VAR_69(end)] for start, end in bconfig.\n CFG_BIBCLASSIFY_PARTIAL_TEXT]\n",
"return '\\n'.join(VAR_70)\n"
] | [
"def _get_partial_text(fulltext):...\n",
"\"\"\"docstring\"\"\"\n",
"length = len(fulltext)\n",
"get_index = lambda x: int(float(x) / 100 * length)\n",
"partial_text = [fulltext[get_index(start):get_index(end)] for start, end in\n bconfig.CFG_BIBCLASSIFY_PARTIAL_TEXT]\n",
"return '\\n'.join(partial_tex... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@app.route('/players/<int:player_id>/achievements')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = db.connection.cursor(db.pymysql.cursors.DictCursor)\n",
"VAR_11.execute('string' % VAR_2)\n",
"return flask.jsonify(items=cursor.fetchall())\n"
] | [
"@app.route('/players/<int:player_id>/achievements')...\n",
"\"\"\"docstring\"\"\"\n",
"cursor = db.connection.cursor(db.pymysql.cursors.DictCursor)\n",
"cursor.execute(\n \"\"\"SELECT\n achievement_id,\n current_steps,\n stat... | [
0,
0,
0,
4,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_13(self, VAR_17, VAR_18, VAR_19):...\n",
"if VAR_18 == 'CP':\n",
"VAR_28 = self.command(' '.join(['arm', 'mrc', str(self.targets[VAR_18][\n 'registers'][VAR_17]['CP']), str(self.targets[VAR_18]['registers'][\n VAR_17]['Op1']), str(self.targets[VAR_18]['registers'][VAR_17]['CRn']),\n str(self.... | [
"def get_register_value(self, register, target, target_index):...\n",
"if target == 'CP':\n",
"buff = self.command(' '.join(['arm', 'mrc', str(self.targets[target][\n 'registers'][register]['CP']), str(self.targets[target]['registers'][\n register]['Op1']), str(self.targets[target]['registers'][register][... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n"
] | [
"def test_fields(self):...\n",
"self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_29():...\n",
"self.assertIn('reauthn-for-termination', VAR_32)\n",
"VAR_29 = VAR_32['reauthn-for-termination']\n",
"VAR_30 = int(time.time())\n",
"self.assertTrue(VAR_30 - VAR_29 < 5)\n"
] | [
"def _check():...\n",
"self.assertIn('reauthn-for-termination', session)\n",
"then = session['reauthn-for-termination']\n",
"now = int(time.time())\n",
"self.assertTrue(now - then < 5)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"if self.redirected_to is None:\n",
"return None\n",
"VAR_14 = self.redirected_to.split('?')\n",
"if len(VAR_14) != 2:\n",
"VAR_0.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n",
"VAR_20 = decrypt_number(VAR_14[-1])\n",
"VAR_0.warning(\"Unable to de... | [
"def get_submission_id(self):...\n",
"if self.redirected_to is None:\n",
"return None\n",
"p = self.redirected_to.split('?')\n",
"if len(p) != 2:\n",
"logger.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n",
"submission_id = decrypt_number(p[-1])\n",
"logger.warning(\"Unable ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Return'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import sqlite3\n",
"VAR_0 = '/srv/data/msd/lastfm/SQLITE/lastfm_tags.db'\n",
"def FUNC_0(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0 = VAR_1\n",
"\"\"\"string\"\"\"\n",
"def __init__(self, VAR_0):...\n",
"self.conn = sqlite3.connect(VAR_0)\n",
"self.c = self.conn.curs... | [
"\"\"\" Contains simple tools for querying the lastfm_tags.db file\n\n\nNotes\n-----\nThe lastfm database contains 3 tables: tids, tags, tid_tag.\n- tids, 1-column table containing the track ids.\n- tid_tags, contains 3 columns:\n - tid: rowid of the track id in the tids table.\n - tag: rowid of the tag that ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4
] | [
"Expr'",
"Import'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"@FUNC_0...\n",
"VAR_19 = await mazemap.test(VAR_3)\n",
"return VAR_19\n"
] | [
"@handle_html...\n",
"out = await mazemap.test(request)\n",
"return out\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = 3\n",
"VAR_10 = 'string'.format(repo_dir=REPO_DIR, shard_str='/shard_' + self.\n shard if self.shard else '', procs=process_count)\n",
"VAR_7 = BokChoyTestSuite('', num_processes=process_count)\n",
"self.assertEqual(BokChoyTestSuite.verbos... | [
"def test_verbosity_settings_3_processes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"process_count = 3\n",
"expected_verbosity_string = (\n '--with-xunitmp --xunitmp-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --processes={procs} --no-color --process-timeout=1200'\n .format(repo_dir=REPO_DIR, sh... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(VAR_5):...\n",
"if not VAR_6:\n",
"return\n",
"VAR_20 = UltiSnips_Manager._snips('', 1)\n",
"return\n",
"VAR_5['ultisnips_snippets'] = [{'trigger': x.trigger, 'description': x.\n description} for x in VAR_20]\n"
] | [
"def _AddUltiSnipsDataIfNeeded(extra_data):...\n",
"if not USE_ULTISNIPS_DATA:\n",
"return\n",
"rawsnips = UltiSnips_Manager._snips('', 1)\n",
"return\n",
"extra_data['ultisnips_snippets'] = [{'trigger': x.trigger, 'description': x\n .description} for x in rawsnips]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_11(self):...\n",
"VAR_14 = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n",
"VAR_18 = {'Content-Type': 'application/json'}\n",
"VAR_14.url_list('/connections', VAR_18)\n",
"FUNC_1('get', VAR_14, 'https://1.2.3.4/api/v1/ports/connections', VAR_9=\n _headers(**json_headers... | [
"def test_client_url_list(self):...\n",
"api = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n",
"json_headers = {'Content-Type': 'application/json'}\n",
"api.url_list('/connections', json_headers)\n",
"assert_call('get', api, 'https://1.2.3.4/api/v1/ports/connections', headers\n =... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_9():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_35 = False\n",
"VAR_18 = sql.connect('./resources/users.db')\n",
"VAR_20 = 'DELETE FROM users;'\n",
"VAR_21 = VAR_18.cursor()\n",
"VAR_21.execute(VAR_20)\n",
"VAR_18.commit()\n",
"VAR_35 = True\n",
"VAR_18.close()\n",
"return VAR_35\n"
] | [
"def delete_users():...\n",
"\"\"\"docstring\"\"\"\n",
"deleted = False\n",
"con = sql.connect('./resources/users.db')\n",
"cmd = 'DELETE FROM users;'\n",
"cur = con.cursor()\n",
"cur.execute(cmd)\n",
"con.commit()\n",
"deleted = True\n",
"con.close()\n",
"return deleted\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@eqlx.with_timeout...\n",
"return 'no timeout'\n"
] | [
"@eqlx.with_timeout...\n",
"return 'no timeout'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.