lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"@mock.patch('requests.post', FUNC_0)...\n",
"\"\"\"docstring\"\"\"\n",
"self.client.login(username='autotest2', password='password')\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",
"self.client.login(usernam... | [
"@mock.patch('requests.post', mock_import_repository_task)...\n",
"\"\"\"docstring\"\"\"\n",
"self.client.login(username='autotest2', password='password')\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
... | [
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(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_14 = {'username': 'autotest', 'app': VAR_6}\n",
"VAR_4 = '/api/hooks/builds'.format(**locals())\n",
"VAR... | [
"def test_build_hook_procfile(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",
"build = {'username': 'autotest', 'app': app_id}\n",
"url = '/api/hooks/builds'.format(... | [
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,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Exp... |
[
"def FUNC_28(self):...\n",
"VAR_0 = [KeyboardInterruptCheck(), SleepCheck(10), SleepCheck(10),\n SleepCheck(10)]\n",
"self._run_checks(VAR_0, 2)\n"
] | [
"def test_kbd_interrupt_in_wait_with_limited_concurrency(self):...\n",
"checks = [KeyboardInterruptCheck(), SleepCheck(10), SleepCheck(10),\n SleepCheck(10)]\n",
"self._run_checks(checks, 2)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, **VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = ['UPDATE', connection.ops.quote_name(self._meta.db_table), 'SET']\n",
"for field_name in VAR_0:\n",
"setattr(self, field_name, VAR_0[field_name])\n",
"VAR_1.pop(-1)\n",
"VAR_2 = self._meta.get_field(field_name)\n",
"VAR_1.extend(['... | [
"def update_fields(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"sql = ['UPDATE', connection.ops.quote_name(self._meta.db_table), 'SET']\n",
"for field_name in kwargs:\n",
"setattr(self, field_name, kwargs[field_name])\n",
"sql.pop(-1)\n",
"field = self._meta.get_field(field_name)\n",
"sql.exten... | [
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
4,
4,
4,
4,
0,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_45):...\n",
""
] | [
"def run(self, uh):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_4(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = VAR_1.session.get('oidc_nonce')\n",
"if VAR_6:\n",
"if 'code' in VAR_1.GET and 'state' in VAR_1.GET:\n",
"VAR_3 = {'request': VAR_1, 'nonce': VAR_6}\n",
"return self.login_failure()\n",
"if 'oidc_state' not in VAR_1.session:\n",
"r... | [
"def get(self, request):...\n",
"\"\"\"docstring\"\"\"\n",
"nonce = request.session.get('oidc_nonce')\n",
"if nonce:\n",
"if 'code' in request.GET and 'state' in request.GET:\n",
"kwargs = {'request': request, 'nonce': nonce}\n",
"return self.login_failure()\n",
"if 'oidc_state' not in request.session... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_2, VAR_3):...\n",
"self.filepath = VAR_2\n",
"self.options = VAR_1\n",
"super(CLASS_1, self).__init__(VAR_3, VAR_0)\n"
] | [
"def __init__(self, options, filepath, env_ctx):...\n",
"self.filepath = filepath\n",
"self.options = options\n",
"super(GometaLinter, self).__init__(env_ctx, _go_get)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import division\n",
"from __future__ import print_function\n",
"import logging\n",
"import ray.ray_constants as ray_constants\n",
"\"\"\"string\"\"\"\n",
"def __init__(self, VAR_0=None, VAR_1=None, VAR_2=None, VAR_3=None, VAR_4=...\n",
"self... | [
"from __future__ import absolute_import\n",
"from __future__ import division\n",
"from __future__ import print_function\n",
"import logging\n",
"import ray.ray_constants as ray_constants\n",
"\"\"\"A class used to store the parameters used by Ray.\n\n Attributes:\n redis_address (str): The addre... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assi... |
[
"@click.command(help='List available monitor locations')...\n",
"VAR_32 = newrelic.get_locations(VAR_0.obj['ACCOUNT'])\n",
"if VAR_11:\n",
"print(json.dumps(VAR_32))\n",
"VAR_24 = [['#', 'City', 'Continent', 'Code', 'Availability', 'Accessibility']]\n",
"return\n",
"for number, VAR_3 in enumerate(VAR_32... | [
"@click.command(help='List available monitor locations')...\n",
"locations = newrelic.get_locations(ctx.obj['ACCOUNT'])\n",
"if raw:\n",
"print(json.dumps(locations))\n",
"data = [['#', 'City', 'Continent', 'Code', 'Availability', 'Accessibility']]\n",
"return\n",
"for number, location in enumerate(loca... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"if not VAR_3:\n",
"VAR_2 = quote(VAR_2)\n",
"VAR_2 = map(lambda i: hex(ord(i)).replace('0x', '%'), VAR_2)\n",
"return VAR_2\n",
"VAR_2 = ''.join(VAR_2)\n"
] | [
"@staticmethod...\n",
"if not force:\n",
"s = quote(s)\n",
"s = map(lambda i: hex(ord(i)).replace('0x', '%'), s)\n",
"return s\n",
"s = ''.join(s)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_27(VAR_50):...\n",
"if re.compile('^(select|delete|update|drop|create)\\\\s').match(VAR_50):\n",
"FUNC_26()\n",
"if re.compile('\\\\s*[a-zA-z]*\\\\s*( from | group by | order by | where | join )'\n",
"FUNC_26()\n"
] | [
"def _is_query(field):...\n",
"if re.compile('^(select|delete|update|drop|create)\\\\s').match(field):\n",
"_raise_exception()\n",
"if re.compile('\\\\s*[a-zA-z]*\\\\s*( from | group by | order by | where | join )'\n",
"_raise_exception()\n"
] | [
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"VAR_20 = VAR_3.value.upper()\n",
"if VAR_3.type == 'ID':\n",
"if not VAR_20 in self.spdx.licenses:\n",
"if VAR_3.type == 'EXC':\n",
"self.lastid = VAR_20\n",
"if VAR_20 not in self.spdx.exceptions:\n",
"if VAR_3.type != 'WITH':\n",
"if self.lastid not in self.spdx.e... | [
"def validate(self, tok):...\n",
"id = tok.value.upper()\n",
"if tok.type == 'ID':\n",
"if not id in self.spdx.licenses:\n",
"if tok.type == 'EXC':\n",
"self.lastid = id\n",
"if id not in self.spdx.exceptions:\n",
"if tok.type != 'WITH':\n",
"if self.lastid not in self.spdx.exceptions[id]:\n",
"se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_13(self, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_volume(VAR_16)\n",
"VAR_0.warn(_('Volume %s was not found while trying to delete it'), VAR_16[\n 'name'])\n",
"self._eql_execute('volume', 'select', VAR_16['name'], 'offline')\n",
"VAR_0.error(_('Failed to delete volume %s'), VA... | [
"def delete_volume(self, volume):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_volume(volume)\n",
"LOG.warn(_('Volume %s was not found while trying to delete it'), volume['name']\n )\n",
"self._eql_execute('volume', 'select', volume['name'], 'offline')\n",
"LOG.error(_('Failed to delete volume %s'), ... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@api.multi...\n",
"\"\"\"docstring\"\"\"\n",
"return super(CLASS_0, self + self.mapped('church_id')\n ).update_number_sponsorships()\n"
] | [
"@api.multi...\n",
"\"\"\"docstring\"\"\"\n",
"return super(ResPartner, self + self.mapped('church_id')\n ).update_number_sponsorships()\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_37(self, VAR_16, VAR_21=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.model.meta import get_field_precision\n",
"if VAR_21 and not isinstance(VAR_21, string_types):\n",
"VAR_21 = VAR_21.parentfield\n",
"VAR_45 = VAR_21 or 'main'\n",
"if not hasattr(self, '_precision'):\n",
"self._pre... | [
"def precision(self, fieldname, parentfield=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from frappe.model.meta import get_field_precision\n",
"if parentfield and not isinstance(parentfield, string_types):\n",
"parentfield = parentfield.parentfield\n",
"cache_key = parentfield or 'main'\n",
"if not hasattr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"from django.core.urlresolvers import reverse\n",
"from rest_framework.settings import api_settings\n",
"def FUNC_0(VAR_0, VAR_1=None, **VAR_2):...\n",
"if not VAR_1:\n",
"VAR_1 = {}\n",
"VAR_1.setdefault('version', api_settings.DEFAULT_VERSION)\n",
"return reverse('api:' + VAR_0, VAR_1=kwargs, **extra)... | [
"from django.core.urlresolvers import reverse\n",
"from rest_framework.settings import api_settings\n",
"def api_reverse(name, kwargs=None, **extra):...\n",
"if not kwargs:\n",
"kwargs = {}\n",
"kwargs.setdefault('version', api_settings.DEFAULT_VERSION)\n",
"return reverse('api:' + name, kwargs=kwargs, ... | [
4,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"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_17(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = \"UPDATE {0} SET file_id=NULL WHERE path='{1}'\".format(VAR_2, VAR_8)\n",
"self._run_command(VAR_7)\n"
] | [
"def invalidateCached(self, pth):...\n",
"\"\"\"docstring\"\"\"\n",
"command = \"UPDATE {0} SET file_id=NULL WHERE path='{1}'\".format(TABLE_NAME, pth\n )\n",
"self._run_command(command)\n"
] | [
0,
0,
4,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_0, VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.proxy = VAR_0\n",
"self.attribute = VAR_1\n",
"self.relation_operation = VAR_2\n"
] | [
"def __init__(self, proxy, attribute, relation_operation):...\n",
"\"\"\"docstring\"\"\"\n",
"self.proxy = proxy\n",
"self.attribute = attribute\n",
"self.relation_operation = relation_operation\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_6):...\n",
"VAR_10 = str(VAR_6.date_time) if VAR_6.date_time else None\n",
"VAR_25 = f'{VAR_6.camera_brand} {VAR_6.camera_model}'\n",
"VAR_26 = f'{VAR_6.lens_brand} {VAR_6.lens_model}'\n",
"VAR_25 = self._dedupe_string(VAR_25) if VAR_25 != ' ' else None\n",
"VAR_26 = self._dedupe_str... | [
"def _convert_data(self, raw_data):...\n",
"date_time = str(raw_data.date_time) if raw_data.date_time else None\n",
"camera = f'{raw_data.camera_brand} {raw_data.camera_model}'\n",
"lens = f'{raw_data.lens_brand} {raw_data.lens_model}'\n",
"camera = self._dedupe_string(camera) if camera != ' ' else None\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'"
] |
[
"def FUNC_4(self, VAR_1):...\n",
"VAR_11 = VAR_1.split(':')[1].split(',')\n",
"VAR_15 = 4\n",
"VAR_16 = VAR_11[VAR_15:VAR_15 + self.dim_x]\n",
"VAR_17 = VAR_11[VAR_15 + self.dim_x:VAR_15 + self.dim_x + self.dim_y]\n",
"VAR_18 = VAR_11[VAR_15 + self.dim_x + self.dim_y:VAR_15 + self.dim_x * 2 +\n self.di... | [
"def calc_board_count(self, board_str):...\n",
"board_split = board_str.split(':')[1].split(',')\n",
"board_count_start = 4\n",
"top_row = board_split[board_count_start:board_count_start + self.dim_x]\n",
"right_col = board_split[board_count_start + self.dim_x:board_count_start +\n self.dim_x + self.dim_... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"if getattr(g, 'oidc_id_token_dirty', False):\n",
"VAR_24 = self.cookie_serializer.dumps(g.oidc_id_token)\n",
"return VAR_7\n",
"VAR_7.set_cookie(self.app.config['OIDC_ID_TOKEN_COOKIE_NAME'], VAR_24,\n secure=self.app.config['OIDC_ID_TOKEN_COO... | [
"def after_request(self, response):...\n",
"\"\"\"docstring\"\"\"\n",
"if getattr(g, 'oidc_id_token_dirty', False):\n",
"signed_id_token = self.cookie_serializer.dumps(g.oidc_id_token)\n",
"return response\n",
"response.set_cookie(self.app.config['OIDC_ID_TOKEN_COOKIE_NAME'],\n signed_id_token, secure=... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_7(self, *VAR_7, **VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_9 in VAR_7:\n",
"self._set_inoutput_item(VAR_9, VAR_7=True)\n",
"for VAR_10, VAR_9 in VAR_8.items():\n",
"self._set_inoutput_item(VAR_9, VAR_7=True, VAR_10=name)\n",
"for VAR_9 in self.output:\n",
"if self.dynamic_output an... | [
"def set_output(self, *output, **kwoutput):...\n",
"\"\"\"docstring\"\"\"\n",
"for item in output:\n",
"self._set_inoutput_item(item, output=True)\n",
"for name, item in kwoutput.items():\n",
"self._set_inoutput_item(item, output=True, name=name)\n",
"for item in self.output:\n",
"if self.dynamic_outp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'",
"For",
"Expr'",
"For",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'"
] |
[
"def FUNC_40(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return list(self.list_properties.keys())\n"
] | [
"def get_columns_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return list(self.list_properties.keys())\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"fork(['svn', 'status', self.directory])\n"
] | [
"def status(self):...\n",
"fork(['svn', 'status', self.directory])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_0.route('/varga')...\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(\"select * from mula where varga = '%s';\" % VAR_13)\n",
"VAR_16 = VAR_15.fetchall()\n",
"return render_template('varga.h... | [
"@app.route('/varga')...\n",
"varga = request.args.get('varga')\n",
"rows = []\n",
"con.close()\n",
"con.row_factory = sql.Row\n",
"cur = con.cursor()\n",
"cur.execute(\"select * from mula where varga = '%s';\" % varga)\n",
"mula = cur.fetchall()\n",
"return render_template('varga.html', mula=mula, ... | [
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"if VAR_6:\n",
"VAR_15 = Announce.by_id(VAR_6, self.sql_session).scalar()\n",
"self._['user_groups'] = GroupList.get_user_groups(self.current_user.key,\n self.sql_session)\n",
"if not VAR_15:\n",
"self.page_render(self._)\n",
"self._['a... | [
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"if ann_id:\n",
"ann = Announce.by_id(ann_id, self.sql_session).scalar()\n",
"self._['user_groups'] = GroupList.get_user_groups(self.current_user.key,\n self.sql_session)\n",
"if not ann:\n",
"self.page_render(self._)\n",
"self._['ann_i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_7(self, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self._rules:\n",
"if not VAR_10 in self._rules:\n",
"return self._rules[VAR_10]\n"
] | [
"def get_rule(self, name):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self._rules:\n",
"if not name in self._rules:\n",
"return self._rules[name]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Return'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_0, VAR_0).initArgumentParser(VAR_2, VAR_3=defaults)\n",
"VAR_3 = VAR_3 or {}\n",
"VAR_2.add_argument('--test_component_detail', default='fe', help=\n 'Refinement for component name to create.')\n"
] | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"super(AwsSmokeTestScenario, cls).initArgumentParser(parser, defaults=defaults)\n",
"defaults = defaults or {}\n",
"parser.add_argument('--test_component_detail', default='fe', help=\n 'Refinement for component name to create.')\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __exit__(self, VAR_7, VAR_8, VAR_9):...\n",
""
] | [
"def __exit__(self, type, value, tb):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_14(self):...\n",
"self.path = self.path[:-1]\n"
] | [
"def go_to_parent_directory(self):...\n",
"self.path = self.path[:-1]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.threads = VAR_75\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.threads = threads\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import re\n",
"import salt.modules.cmdmod\n",
"import logging\n",
"VAR_0 = logging.getLogger(__name__)\n",
"__salt__ = {'cmd.run': salt.modules.cmdmod._run_quiet, 'config.get': salt.\n modules.config.get}\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0.debug('... | [
"\"\"\"\nHubbleStack Custom Grains and Pillar\n\nAllows for fetching custom grain and pillar data from a local salt-minion via\nsalt-call\n\n:maintainer: HubbleStack\n:platform: All\n:requires: SaltStack\n\"\"\"\n",
"import re\n",
"import salt.modules.cmdmod\n",
"import logging\n",
"log = logging.getLogger(... | [
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
2,
0,
0,
0,
2,
0,
2,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Assign'",
"Condition",
"For",
"Assign'",
"For",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"\"\"\"string\"\"\"\n",
"import mimetypes\n",
"import os\n",
"import posixpath\n",
"import re\n",
"import stat\n",
"from django.http import FileResponse, Http404, HttpResponse, HttpResponseNotModified, HttpResponseRedirect\n",
"from django.template import Context, Engine, TemplateDoesNotExist, loader\... | [
"\"\"\"\nViews and functions for serving static files. These are only to be used\nduring development, and SHOULD NOT be used in a production setting.\n\"\"\"\n",
"import mimetypes\n",
"import os\n",
"import posixpath\n",
"import re\n",
"import stat\n",
"from django.http import FileResponse, Http404, Htt... | [
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
0,
6,
0,
0,
6,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Conditio... |
[
"def FUNC_0(VAR_2, VAR_3, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = dict(VAR_4 or {})\n",
"VAR_4['Content-Length'] = len(VAR_2)\n",
"def __init__(self):...\n",
"self.content = VAR_2\n",
"def FUNC_6(self, VAR_7):...\n",
"VAR_8 = self.content\n",
"while VAR_8:\n",
"yield VAR_8[:VAR_7]\... | [
"def make_fake_response(content, url, headers=None):...\n",
"\"\"\"docstring\"\"\"\n",
"headers = dict(headers or {})\n",
"headers['Content-Length'] = len(content)\n",
"def __init__(self):...\n",
"self.content = content\n",
"def iter_content(self, chunk_size):...\n",
"c = self.content\n",
"while c:\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"VAR_23 = f'{self.get_dg_folder()}/{str(self.fs_id)}.zip'\n",
"VAR_24 = f'{self.get_dg_folder()}/{self.get_name_as_slug()}.zip'\n",
"if os.path.isfile(VAR_23):\n",
"VAR_30 = VAR_23\n",
"if os.path.isfile(VAR_24):\n",
"return VAR_30\n",
"VAR_30 = VAR_24\n",
"VAR_30 = 'no_pa... | [
"def get_zip_url(self):...\n",
"uuid_path = f'{self.get_dg_folder()}/{str(self.fs_id)}.zip'\n",
"zip_file_path = f'{self.get_dg_folder()}/{self.get_name_as_slug()}.zip'\n",
"if os.path.isfile(uuid_path):\n",
"zip_url = uuid_path\n",
"if os.path.isfile(zip_file_path):\n",
"return zip_url\n",
"zip_url =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"@user_passes_test(user_is_superuser)...\n",
"VAR_10 = get_object_or_404(TestRailConfiguration, pk=testrail_id)\n",
"VAR_10.delete()\n",
"VAR_4 = context_project_dashboard(VAR_0)\n",
"VAR_4['last_tab'] = 'test_rails'\n",
"return render(VAR_0, 'projects/project_dashboard.html', VAR_4)\n"
] | [
"@user_passes_test(user_is_superuser)...\n",
"testrail = get_object_or_404(TestRailConfiguration, pk=testrail_id)\n",
"testrail.delete()\n",
"context = context_project_dashboard(request)\n",
"context['last_tab'] = 'test_rails'\n",
"return render(request, 'projects/project_dashboard.html', context)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_21(VAR_10):...\n",
"VAR_9.append(1)\n",
"return False\n"
] | [
"def setup_bot(_bot):...\n",
"setup_bots.append(1)\n",
"return False\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(VAR_1, VAR_2):...\n",
"for VAR_13 in VAR_2.strip('/').split('/'):\n",
"VAR_1 = VAR_1[VAR_13]\n",
"FUNC_1(VAR_1)\n"
] | [
"def scan_git_subtree(tree, path):...\n",
"for p in path.strip('/').split('/'):\n",
"tree = tree[p]\n",
"scan_git_tree(tree)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(VAR_0):...\n",
"generator.run_program()\n"
] | [
"def generate_inf_file(args):...\n",
"generator.run_program()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@api.public...\n",
"self.response.write(self.generate_xsrf_token({'some': 'data'}))\n"
] | [
"@api.public...\n",
"self.response.write(self.generate_xsrf_token({'some': 'data'}))\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_21(self, VAR_2):...\n",
"VAR_1 = frappe.get_meta(self.doctype)\n",
"if self.order_by:\n",
"VAR_2.order_by = self.order_by\n",
"VAR_2.order_by = ''\n",
"VAR_66 = len(self.fields) == 1 and (self.fields[0].lower().startswith(\n 'count(') or self.fields[0].lower().startswith('min(') or self.field... | [
"def set_order_by(self, args):...\n",
"meta = frappe.get_meta(self.doctype)\n",
"if self.order_by:\n",
"args.order_by = self.order_by\n",
"args.order_by = ''\n",
"group_function_without_group_by = len(self.fields) == 1 and (self.fields[0]\n .lower().startswith('count(') or self.fields[0].lower().starts... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(VAR_2):...\n",
"VAR_8 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) +\n '\\\\users\\\\' + VAR_3 + '.db')\n",
"VAR_9 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\\\cf.db')\n",
"VAR_10 = VAR_8.cursor()\n",
"VAR_11 = VAR_9.cursor()\n",
"VAR_11.execute('SELEC... | [
"def find_intersection(tag):...\n",
"conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) +\n '\\\\users\\\\' + username + '.db')\n",
"conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\\\cf.db')\n",
"cursor = conn.cursor()\n",
"cursor2 = conn2.cursor()\n",
"cursor2.ex... | [
0,
0,
0,
0,
0,
0,
4,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'"
] |
[
"@property...\n",
"return FUNC_0(self.file).st_mtime\n"
] | [
"@property...\n",
"return lstat(self.file).st_mtime\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_0(VAR_1, VAR_2=False, VAR_3=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = namedtuple('spacket', ['rit_username', 'name', 'did_sign',\n 'total_signatures', 'required_signatures'])\n",
"VAR_5 = []\n",
"VAR_6 = get_number_required()\n",
"if VAR_2 and VAR_3:\n",
"VAR_6 -= 1\n",
"VAR_7 = ... | [
"def current_packets(member, intro=False, onfloor=False):...\n",
"\"\"\"docstring\"\"\"\n",
"SPacket = namedtuple('spacket', ['rit_username', 'name', 'did_sign',\n 'total_signatures', 'required_signatures'])\n",
"packets = []\n",
"required = get_number_required()\n",
"if intro and onfloor:\n",
"requi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"@VAR_2.route('/base')...\n",
"return render_template('libraries/templates/html/base.html')\n"
] | [
"@endpoints.route('/base')...\n",
"return render_template('libraries/templates/html/base.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = [VAR_28.mtime for VAR_28 in self.input if VAR_28.exists]\n",
"if VAR_17:\n",
"return max(VAR_17)\n",
"return None\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"existing = [f.mtime for f in self.input if f.exists]\n",
"if existing:\n",
"return max(existing)\n",
"return None\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_23, *VAR_5, **VAR_6):...\n",
"assert isinstance(VAR_23, CLASS_6)\n",
"VAR_39 = CLASS_7(VAR_23.key_name, *VAR_23.source_expressions, **\n key_transform.extra)\n",
"super(CLASS_8, self).__init__(VAR_39, *VAR_5, **kwargs)\n"
] | [
"def __init__(self, key_transform, *args, **kwargs):...\n",
"assert isinstance(key_transform, JsonKeyTransform)\n",
"key_text_transform = JsonKeyTextTransform(key_transform.key_name, *\n key_transform.source_expressions, **key_transform.extra)\n",
"super(JsonKeyTransformTextLookupMixin, self).__init__(key_... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assert'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(VAR_0):...\n",
"VAR_1 = psycopg2.connect('dbname=forum')\n",
"VAR_2 = VAR_1.cursor()\n",
"VAR_2.execute(\"INSERT INTO posts (content) VALUES ('%s')\" % VAR_0)\n",
"VAR_1.commit()\n",
"VAR_1.close()\n"
] | [
"def AddPost(content):...\n",
"conn = psycopg2.connect('dbname=forum')\n",
"cur = conn.cursor()\n",
"cur.execute(\"INSERT INTO posts (content) VALUES ('%s')\" % content)\n",
"conn.commit()\n",
"conn.close()\n"
] | [
0,
0,
0,
4,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"if not CLASS_1.test_success(self):\n",
"return False\n",
"return True\n"
] | [
"def test_success(self):...\n",
"if not GenericRequest.test_success(self):\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_37(VAR_47, VAR_56):...\n",
"return os.path.relpath(VAR_47, VAR_56).startswith(os.pardir)\n"
] | [
"def is_outside(path, putative_parent):...\n",
"return os.path.relpath(path, putative_parent).startswith(os.pardir)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(VAR_13, VAR_16):...\n",
"VAR_35 = subprocess.Popen([VAR_13], stdin=subprocess.PIPE, VAR_36=\n subprocess.PIPE, VAR_37=subprocess.PIPE)\n",
"VAR_36, VAR_37 = VAR_35.communicate(json.dumps(VAR_16))\n",
"VAR_35.wait()\n",
"if VAR_35.returncode != 0:\n",
"return VAR_36\n"
] | [
"def render_executable(path, config):...\n",
"p = subprocess.Popen([path], stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n",
"stdout, stderr = p.communicate(json.dumps(config))\n",
"p.wait()\n",
"if p.returncode != 0:\n",
"return stdout\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Return'"
] |
[
"def FUNC_26(self):...\n",
"if self._IsServerAlive():\n",
"VAR_23 = BaseRequest.PostDataToHandler(BuildRequestData(), 'debug_info')\n",
"VAR_23 = 'Server crashed, no debug info from server'\n",
"VAR_23 += \"\"\"\nServer running at: {0}\"\"\".format(BaseRequest.server_location)\n",
"VAR_23 += \"\"\"\nServe... | [
"def DebugInfo(self):...\n",
"if self._IsServerAlive():\n",
"debug_info = BaseRequest.PostDataToHandler(BuildRequestData(), 'debug_info')\n",
"debug_info = 'Server crashed, no debug info from server'\n",
"debug_info += \"\"\"\nServer running at: {0}\"\"\".format(BaseRequest.server_location)\n",
"debug_inf... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"AugAssign'",
"Condition",
"AugAssign'",
"Return'"
] |
[
"import requests\n",
"import sqlite3\n",
"import os\n",
"from bs4 import BeautifulSoup\n",
"VAR_0 = {'math', 'strings', 'trees', 'graphs', 'dp', 'greedy', 'geometry',\n 'combinatorics'}\n",
"def FUNC_0():...\n",
"VAR_2 = 'http://codeforces.com/problemset/'\n",
"VAR_3 = requests.get(VAR_2)\n",
"VA... | [
"import requests\n",
"import sqlite3\n",
"import os\n",
"from bs4 import BeautifulSoup\n",
"available_tags = {'math', 'strings', 'trees', 'graphs', 'dp', 'greedy',\n 'geometry', 'combinatorics'}\n",
"def create_cf_base():...\n",
"url = 'http://codeforces.com/problemset/'\n",
"r = requests.get(url)\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
... |
[
"def FUNC_2(self, VAR_5=None, VAR_6=None, VAR_7='', VAR_8=''):...\n",
"if VAR_6:\n",
"VAR_5 = VAR_6.apply_all(VAR_5)\n",
"if VAR_7 != '':\n",
"if hasattr(self.obj, VAR_7):\n",
"return VAR_5\n",
"if hasattr(getattr(self.obj, VAR_7), '_col_name'):\n",
"VAR_5 = VAR_5.order_by(VAR_7 + ' ' + VAR_8)\n",
"... | [
"def _get_base_query(self, query=None, filters=None, order_column='',...\n",
"if filters:\n",
"query = filters.apply_all(query)\n",
"if order_column != '':\n",
"if hasattr(self.obj, order_column):\n",
"return query\n",
"if hasattr(getattr(self.obj, order_column), '_col_name'):\n",
"query = query.order... | [
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'"
] |
[
"@VAR_0.route('/')...\n",
"return render_template('homepage.html')\n"
] | [
"@app.route('/')...\n",
"return render_template('homepage.html')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"VAR_34 = self.conf.get('shallow', False)\n",
"if self.ref_is_commit and VAR_34:\n",
"os.mkdir(self.directory)\n",
"VAR_58 = []\n",
"fork(['git', 'init'])\n",
"if VAR_34:\n",
"fork(['git', 'remote', 'add', 'origin', self.url.geturl()])\n",
"VAR_58 += ['--depth', '1']\n",
... | [
"def checkout(self):...\n",
"shallow = self.conf.get('shallow', False)\n",
"if self.ref_is_commit and shallow:\n",
"os.mkdir(self.directory)\n",
"extra_opts = []\n",
"fork(['git', 'init'])\n",
"if shallow:\n",
"fork(['git', 'remote', 'add', 'origin', self.url.geturl()])\n",
"extra_opts += ['--depth'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"AugAssign'",
"Condition",
"Expr'",
"AugAssign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self, VAR_5, VAR_6, VAR_7, VAR_8):...\n",
"return MailService(VAR_5, VAR_6, VAR_7, self._mail_address, VAR_8)\n"
] | [
"def _create_mail_service(self, mail_sender, mail_store, search_engine,...\n",
"return MailService(mail_sender, mail_store, search_engine, self.\n _mail_address, attachment_store)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(VAR_0, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15 = pd.read_sql_table(VAR_0, db.engine, columns=[attr])\n",
"print('FILL AVERAGE FAILED')\n",
"VAR_20 = VAR_15[VAR_5].mean()\n",
"db.engine.execute('UPDATE \"{0}\" SET \"{1}\" = {2} WHERE \"{1}\" IS NULL'.format\n (VAR_0, VAR_5, VAR_20)... | [
"def fill_null_with_average(table_name, attr):...\n",
"\"\"\"docstring\"\"\"\n",
"dataframe = pd.read_sql_table(table_name, db.engine, columns=[attr])\n",
"print('FILL AVERAGE FAILED')\n",
"average = dataframe[attr].mean()\n",
"db.engine.execute('UPDATE \"{0}\" SET \"{1}\" = {2} WHERE \"{1}\" IS NULL'.for... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_2, VAR_3):...\n",
"self._parsed_content_packages = None\n",
"self._parsed_status_test_usernames = None\n",
"self.section = VAR_1\n",
"VAR_0['debug'] = str(VAR_3)\n",
"VAR_4 = os.path.dirname(VAR_2)\n",
"VAR_0['pysaml2_config'] = os.path.join(VAR_4, VAR_0['pysaml2_config'])\n",
... | [
"def __init__(self, filename, debug):...\n",
"self._parsed_content_packages = None\n",
"self._parsed_status_test_usernames = None\n",
"self.section = _CONFIG_SECTION\n",
"_CONFIG_DEFAULTS['debug'] = str(debug)\n",
"cfgdir = os.path.dirname(filename)\n",
"_CONFIG_DEFAULTS['pysaml2_config'] = os.path.join... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"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'"
] |
[
"@property...\n",
"VAR_28 = list(self.output)\n",
"if self.benchmark:\n",
"VAR_28.append(self.benchmark)\n",
"return VAR_28\n"
] | [
"@property...\n",
"products = list(self.output)\n",
"if self.benchmark:\n",
"products.append(self.benchmark)\n",
"return products\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_24(self):...\n",
"if not self.DiagnosticsForCurrentFileReady():\n",
"return\n",
"self._diag_interface.UpdateWithNewDiagnostics(self.\n GetDiagnosticsFromStoredRequest())\n"
] | [
"def UpdateDiagnosticInterface(self):...\n",
"if not self.DiagnosticsForCurrentFileReady():\n",
"return\n",
"self._diag_interface.UpdateWithNewDiagnostics(self.\n GetDiagnosticsFromStoredRequest())\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_1(self, **VAR_3):...\n",
"VAR_13 = super().get_context_data(**kwargs)\n",
"VAR_13['is_mobile'] = FUNC_0(self.request.META['HTTP_USER_AGENT'])\n",
"return VAR_13\n"
] | [
"def get_context_data(self, **kwargs):...\n",
"context = super().get_context_data(**kwargs)\n",
"context['is_mobile'] = is_mobile(self.request.META['HTTP_USER_AGENT'])\n",
"return context\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"super().get_common_objects()\n",
"self.get_summary_submissions()\n",
"self.models = []\n",
"for url, name in self.exercise.get_models():\n",
"self.note('models')\n",
"VAR_33 = request_for_response(url)\n",
"self.models.append({'name': name})\n",
"self.models.append({'name'... | [
"def get_common_objects(self):...\n",
"super().get_common_objects()\n",
"self.get_summary_submissions()\n",
"self.models = []\n",
"for url, name in self.exercise.get_models():\n",
"self.note('models')\n",
"response = request_for_response(url)\n",
"self.models.append({'name': name})\n",
"self.models.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_10(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = 'exec-{}.py'\n",
"if six.PY2:\n",
"VAR_8 = VAR_8.format('py2')\n",
"VAR_8 = VAR_8.format('py3')\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 2}, 'CONFIDENCE': {'HIGH': 2}}\n",
"VAR_2 = {'SEVERITY': {'MEDIUM': 1}, 'CONFIDENCE': {'HIGH': 1}}\n",
"... | [
"def test_exec(self):...\n",
"\"\"\"docstring\"\"\"\n",
"filename = 'exec-{}.py'\n",
"if six.PY2:\n",
"filename = filename.format('py2')\n",
"filename = filename.format('py3')\n",
"expect = {'SEVERITY': {'MEDIUM': 2}, 'CONFIDENCE': {'HIGH': 2}}\n",
"expect = {'SEVERITY': {'MEDIUM': 1}, 'CONFIDENCE': {... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_28(self, *VAR_76, **VAR_52):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.resources = VAR_76, VAR_52\n",
"return VAR_101\n"
] | [
"def resources(self, *args, **resources):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.resources = args, resources\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"async def FUNC_8(self):...\n",
"def FUNC_14():...\n",
"self.logger.info('recursing', VAR_52='5b8498e4-868d-413c-a67e-004516b8452c',\n VAR_56=len(self.pending), have=len(self.have) - len(self.running),\n running=len(self.running))\n",
"VAR_30 = 1\n",
"self.have = set()\n",
"self.logger.info('cancel'... | [
"async def run(self):...\n",
"def log():...\n",
"self.logger.info('recursing', uuid='5b8498e4-868d-413c-a67e-004516b8452c',\n pending=len(self.pending), have=len(self.have) - len(self.running),\n running=len(self.running))\n",
"seqnum = 1\n",
"self.have = set()\n",
"self.logger.info('cancel', uuid='... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"AugAssign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"For",
"Expr'"
] |
[
"def FUNC_4(self, VAR_0, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = VAR_0.args.get('attrs', [''])[0]\n",
"if VAR_4:\n",
"VAR_7 = {}\n",
"return VAR_3\n",
"for VAR_8 in (VAR_4.decode('utf-8').split(',') + self.__builtin_attributes__):\n",
"if VAR_8 in VAR_3:\n",
"return VAR_7\n",
"VAR_7[VAR... | [
"def filter_attributes(self, request, data):...\n",
"\"\"\"docstring\"\"\"\n",
"attrs = request.args.get('attrs', [''])[0]\n",
"if attrs:\n",
"filtered_data = {}\n",
"return data\n",
"for a in (attrs.decode('utf-8').split(',') + self.__builtin_attributes__):\n",
"if a in data:\n",
"return filtered_d... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def __str__(self):...\n",
"VAR_23 = 'OpenOCD at localhost port ' + str(self.port)\n",
"return VAR_23\n"
] | [
"def __str__(self):...\n",
"string = 'OpenOCD at localhost port ' + str(self.port)\n",
"return string\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"for i in xrange(256):\n",
"yield chr(i)\n"
] | [
"@staticmethod...\n",
"for i in xrange(256):\n",
"yield chr(i)\n"
] | [
0,
0,
0
] | [
"Condition",
"For",
"Expr'"
] |
[
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"if not VAR_6:\n",
"if not Announce.by_id(VAR_6, self.sql_session).scalar():\n",
"VAR_8 = AttachmentList.by_ann_id(VAR_6, self.sql_session)\n",
"VAR_9 = VAR_8.all()\n",
"for old_att in VAR_9:\n",
"shutil.rmtree('file/%s' % old_att.key)\n",... | [
"@BaseHandler.check_is_group_user('Announcement Manager')...\n",
"if not ann_id:\n",
"if not Announce.by_id(ann_id, self.sql_session).scalar():\n",
"q = AttachmentList.by_ann_id(ann_id, self.sql_session)\n",
"old_atts = q.all()\n",
"for old_att in old_atts:\n",
"shutil.rmtree('file/%s' % old_att.key)\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@tornado.gen.coroutine...\n",
"VAR_17 = 'INSERT INTO districts(name) VALUES (%s)'\n",
"VAR_18 = VAR_8,\n",
"yield VAR_1.execute(query=sql, VAR_18=params)\n"
] | [
"@tornado.gen.coroutine...\n",
"sql = 'INSERT INTO districts(name) VALUES (%s)'\n",
"params = name,\n",
"yield tx.execute(query=sql, params=params)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_13(VAR_18, VAR_19):...\n",
"VAR_6 = {}\n",
"for id_, VAR_21 in enumerate(VAR_18.description):\n",
"VAR_6[VAR_21[0]] = VAR_19[id_]\n",
"return VAR_6\n"
] | [
"def dict_factory(cursor, row):...\n",
"dictionary = {}\n",
"for id_, column in enumerate(cursor.description):\n",
"dictionary[column[0]] = row[id_]\n",
"return dictionary\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_17(self):...\n",
"VAR_7 = [('x', 'y'), (1, 2)]\n",
"VAR_8 = [('key', 'filename', 'file data')]\n",
"VAR_9, VAR_10 = url_helper.EncodeMultipartFormData()\n",
"self.assertTrue(VAR_9.startswith('multipart/form-data; boundary='))\n",
"self.assertEqual('', VAR_10)\n",
"VAR_9, VAR_10 = url_helper.En... | [
"def testEncodeMultipartFormData(self):...\n",
"fields = [('x', 'y'), (1, 2)]\n",
"files = [('key', 'filename', 'file data')]\n",
"content_type, body = url_helper.EncodeMultipartFormData()\n",
"self.assertTrue(content_type.startswith('multipart/form-data; boundary='))\n",
"self.assertEqual('', body)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/table_detection')...\n",
"return render_template('table_detection.html', wait=WAIT_AFTER_CRAWLING)\n"
] | [
"@app.route('/table_detection')...\n",
"return render_template('table_detection.html', wait=WAIT_AFTER_CRAWLING)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_11 = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']\n",
"for d in VAR_11:\n",
"if d in VAR_0:\n",
"return False\n",
"return True\n"
] | [
"def is_mobile(useragent):...\n",
"devices = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']\n",
"for d in devices:\n",
"if d in useragent:\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14, VAR_15 = new_log_monitor_log_file()\n",
"VAR_16 = ray.services.start_log_monitor(self.redis_address, self.\n _node_ip_address, VAR_14=stdout_file, VAR_15=stderr_file,\n redis_password=self._ray_params.redis_password)\n",
"assert VAR_13.PROC... | [
"def start_log_monitor(self):...\n",
"\"\"\"docstring\"\"\"\n",
"stdout_file, stderr_file = new_log_monitor_log_file()\n",
"process_info = ray.services.start_log_monitor(self.redis_address, self.\n _node_ip_address, stdout_file=stdout_file, stderr_file=stderr_file,\n redis_password=self._ray_params.redi... | [
0,
0,
0,
6,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assert'",
"Assign'"
] |
[
"def FUNC_16(self, VAR_9=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(VAR_13.PROCESS_TYPE_REDIS_SERVER, VAR_9=check_alive)\n"
] | [
"def kill_redis(self, check_alive=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self._kill_process_type(ray_constants.PROCESS_TYPE_REDIS_SERVER,\n check_alive=check_alive)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_7(VAR_3, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_9 == 'login':\n",
"return external_auth_login(VAR_3)\n",
"if VAR_9 == 'register':\n",
"return external_auth_register(VAR_3)\n"
] | [
"def _external_auth_intercept(request, mode):...\n",
"\"\"\"docstring\"\"\"\n",
"if mode == 'login':\n",
"return external_auth_login(request)\n",
"if mode == 'register':\n",
"return external_auth_register(request)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"@app.route('/api/indi_profiles/<id>', methods=['PUT'])...\n",
"VAR_16 = None\n",
"profile.update(VAR_3)\n",
"VAR_16 = profile.to_map()\n",
"return VAR_16\n"
] | [
"@app.route('/api/indi_profiles/<id>', methods=['PUT'])...\n",
"updated_profile = None\n",
"profile.update(json)\n",
"updated_profile = profile.to_map()\n",
"return updated_profile\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"if isinstance(self.model_field, SmartListFilter):\n",
"return self.model_field.title\n",
"return super(CLASS_7, self).get_title()\n"
] | [
"def get_title(self):...\n",
"if isinstance(self.model_field, SmartListFilter):\n",
"return self.model_field.title\n",
"return super(SmartFilter, self).get_title()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_31 = openid.get_current_user(VAR_3)\n",
"return CLASS_4(VAR_31.sub, VAR_31.email, VAR_31.picture) if VAR_31 else None\n"
] | [
"@staticmethod...\n",
"user = openid.get_current_user(request)\n",
"return CurrentUser(user.sub, user.email, user.picture) if user else None\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"self._tab_after('h')\n",
"eq_(self.terminal.method_calls, [('write', ('el',), {})])\n",
"self.terminal.reset_mock()\n",
"self.oms_ssh.handle_TAB()\n",
"eq_(self.terminal.method_calls, [('write', ('',), {}), ('nextLine', (), {}),\n ('write', ('help hello\\n',), {}), ('write',... | [
"def test_complete_prefix(self):...\n",
"self._tab_after('h')\n",
"eq_(self.terminal.method_calls, [('write', ('el',), {})])\n",
"self.terminal.reset_mock()\n",
"self.oms_ssh.handle_TAB()\n",
"eq_(self.terminal.method_calls, [('write', ('',), {}), ('nextLine', (), {}),\n ('write', ('help hello\\n',), ... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __hash__(self):...\n",
"return hash(self.name)\n"
] | [
"def __hash__(self):...\n",
"return hash(self.name)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(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}/containers'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 2... | [
"def test_container_api_heroku(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}/containers'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assertEq... | [
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"A... |
[
"def FUNC_23(self, VAR_28):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_58 = VAR_28,\n",
"VAR_19 = ''\n",
"if self.execute('SELECT path FROM history WHERE nzo_id=?', VAR_58):\n",
"return VAR_19\n",
"VAR_19 = self.c.fetchone().get('path')\n"
] | [
"def get_path(self, nzo_id):...\n",
"\"\"\"docstring\"\"\"\n",
"t = nzo_id,\n",
"path = ''\n",
"if self.execute('SELECT path FROM history WHERE nzo_id=?', t):\n",
"return path\n",
"path = self.c.fetchone().get('path')\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"@VAR_0.route('/delete_predicate', methods=['POST'])...\n",
"VAR_1 = get_dataset_with_id(request.args.get('dataset_id'))\n",
"VAR_7 = table_name_to_object(VAR_1.working_copy)\n",
"VAR_8 = ''\n",
"VAR_9 = []\n",
"VAR_10 = []\n",
"VAR_11 = []\n",
"VAR_12 = []\n",
"for VAR_26 in request.form:\n",
"if... | [
"@_transform.route('/delete_predicate', methods=['POST'])...\n",
"dataset = get_dataset_with_id(request.args.get('dataset_id'))\n",
"table = table_name_to_object(dataset.working_copy)\n",
"condition = ''\n",
"columns = []\n",
"conditions = []\n",
"operators = []\n",
"logics = []\n",
"for i in reques... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"For",
"Condition",
"Expr'",
"Expr'",
"Expr'"... |
[
"@jwt_required...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = f'insert into admins values (%s);'\n",
"VAR_3 = request.get_json()\n",
"VAR_4 = VAR_3['email'],\n",
"database_utilities.execute_query(VAR_2, VAR_4)\n"
] | [
"@jwt_required...\n",
"\"\"\"docstring\"\"\"\n",
"query = f'insert into admins values (%s);'\n",
"json_data = request.get_json()\n",
"parameters = json_data['email'],\n",
"database_utilities.execute_query(query, parameters)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@tornado.gen.coroutine...\n",
"VAR_17 = (\n 'SELECT month(date) as month, day(date) as day FROM reports WHERE year(date) = %s'\n )\n",
"VAR_18 = VAR_2,\n",
"VAR_19 = yield VAR_1.execute(query=sql, VAR_18=params)\n",
"return VAR_19.fetchall()\n"
] | [
"@tornado.gen.coroutine...\n",
"sql = (\n 'SELECT month(date) as month, day(date) as day FROM reports WHERE year(date) = %s'\n )\n",
"params = year,\n",
"cursor = yield tx.execute(query=sql, params=params)\n",
"return cursor.fetchall()\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4):...\n",
"if not VAR_4:\n",
"return\n",
"if validate_hash(VAR_4):\n",
"if validate_url(VAR_4):\n",
"VAR_21 = VirusTotalAPI().hash_fetch(VAR_4)\n",
"VAR_2['errors'].append('Error retrieving file hash: %s' % e)\n",
"VAR_18 = Files.create(VAR_3, VAR_4, VAR_21)\n",
... | [
"def _handle_string(self, submit, tmppath, line):...\n",
"if not line:\n",
"return\n",
"if validate_hash(line):\n",
"if validate_url(line):\n",
"filedata = VirusTotalAPI().hash_fetch(line)\n",
"submit['errors'].append('Error retrieving file hash: %s' % e)\n",
"filepath = Files.create(tmppath, line, fi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_16():...\n",
"VAR_0 = get_db()\n"
] | [
"def init():...\n",
"db = get_db()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_18 = self.common.create_volume(VAR_6)\n",
"self.common.client_logout()\n",
"return {'metadata': VAR_18}\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"metadata = self.common.create_volume(volume)\n",
"self.common.client_logout()\n",
"return {'metadata': metadata}\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_21(VAR_10, VAR_11, VAR_12):...\n",
"self.log.info('Termination signal %s recieved', repr((VAR_10, VAR_11, VAR_12)))\n",
"self.term()\n"
] | [
"def term_handler(interface, method, data):...\n",
"self.log.info('Termination signal %s recieved', repr((interface, method, data))\n )\n",
"self.term()\n"
] | [
0,
7,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"import copy\n",
"from awx.main.scheduler.dag_simple import SimpleDAG\n",
"def __init__(self, VAR_0=None):...\n",
"super(CLASS_0, self).__init__()\n",
"if VAR_0:\n",
"self._init_graph(VAR_0)\n",
"def FUNC_0(self, VAR_0):...\n",
"VAR_1 = VAR_0.workflow_job_nodes\n",
"VAR_2 = VAR_1.prefetch_related('s... | [
"import copy\n",
"from awx.main.scheduler.dag_simple import SimpleDAG\n",
"def __init__(self, workflow_job=None):...\n",
"super(WorkflowDAG, self).__init__()\n",
"if workflow_job:\n",
"self._init_graph(workflow_job)\n",
"def _init_graph(self, workflow_job):...\n",
"node_qs = workflow_job.workflow_job_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Expr'",
"For",
"For",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Condition"... |
[
"def FUNC_25(self, VAR_14):...\n",
""
] | [
"def is_fk(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_7(self):...\n",
"self.assert404(self.client.get(url_for('oauthclient.authorized', remote_app\n ='invalid')))\n",
"self.assert404(self.client.get(url_for('oauthclient.disconnect', remote_app\n ='invalid')))\n"
] | [
"def test_no_remote_app(self):...\n",
"self.assert404(self.client.get(url_for('oauthclient.authorized', remote_app\n ='invalid')))\n",
"self.assert404(self.client.get(url_for('oauthclient.disconnect', remote_app\n ='invalid')))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
""
] | [
"def describe(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(self, VAR_11='', VAR_6=None):...\n",
"VAR_5 = self.session.query(self.obj)\n",
"VAR_5 = self._get_base_query(VAR_5=query, VAR_6=filters)\n",
"VAR_25 = VAR_5.all()\n",
"VAR_26 = GroupByDateMonth(VAR_11, 'Group by Month')\n",
"return VAR_26.apply(VAR_25)\n"
] | [
"def query_month_group(self, group_by='', filters=None):...\n",
"query = self.session.query(self.obj)\n",
"query = self._get_base_query(query=query, filters=filters)\n",
"query_result = query.all()\n",
"group = GroupByDateMonth(group_by, 'Group by Month')\n",
"return group.apply(query_result)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.