lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_1(self):...\n",
"self.assertTrue(self.client.login(VAR_8='autotest', VAR_9='password'))\n"
] | [
"def setUp(self):...\n",
"self.assertTrue(self.client.login(username='autotest', password='password'))\n"
] | [
0,
5
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(self, VAR_21, VAR_27, VAR_28, VAR_29, VAR_30, VAR_31=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.newcount > 10000:\n",
"return False\n",
"if VAR_31 is None:\n",
"VAR_31 = time.time()\n",
"VAR_58 = self.get_path(os.path.dirname(VAR_21))\n",
"VAR_59 = os.path.basename(VAR_21)\n",
"if... | [
"def mkfile(self, path, uid, gid, size, mode, ctime=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.newcount > 10000:\n",
"return False\n",
"if ctime is None:\n",
"ctime = time.time()\n",
"dir = self.get_path(os.path.dirname(path))\n",
"outfile = os.path.basename(path)\n",
"if outfile in [x[A_NAME... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Expr'",
"AugAssign'",
"Return'"
] |
[
"@api.model...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = VAR_32.get('email')\n",
"if VAR_27:\n",
"VAR_32['email'] = VAR_27.strip()\n",
"VAR_52 = self.search(['|', '&', ('email', '=', VAR_32.get('email')), (\n 'email', '!=', False), '&', '&', ('firstname', 'ilike', VAR_32.get(\n 'firstname')), ('lastn... | [
"@api.model...\n",
"\"\"\"docstring\"\"\"\n",
"email = vals.get('email')\n",
"if email:\n",
"vals['email'] = email.strip()\n",
"duplicate = self.search(['|', '&', ('email', '=', vals.get('email')), (\n 'email', '!=', False), '&', '&', ('firstname', 'ilike', vals.get(\n 'firstname')), ('lastname', 'i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8():...\n",
"VAR_9 = FUNC_0()\n",
"VAR_10 = VAR_9.cursor()\n",
"VAR_10.execute(' SELECT name, karma FROM people ORDER BY karma DESC LIMIT 5 ')\n",
"VAR_2.error('Execution failed with error: {}'.format(e))\n",
"VAR_18 = VAR_10.fetchall()\n",
"VAR_2.debug('fetched top karma values')\n",
"VAR_9... | [
"def karma_top():...\n",
"db = db_connect()\n",
"cursor = db.cursor()\n",
"cursor.execute(' SELECT name, karma FROM people ORDER BY karma DESC LIMIT 5 ')\n",
"logger.error('Execution failed with error: {}'.format(e))\n",
"leaders = cursor.fetchall()\n",
"logger.debug('fetched top karma values')\n",
"d... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = api.nova.server_group_list(VAR_1)\n",
"return {'items': [u.to_dict() for u in VAR_10]}\n"
] | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"result = api.nova.server_group_list(request)\n",
"return {'items': [u.to_dict() for u in result]}\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_27(VAR_13):...\n",
"self.assertEqual('/request', VAR_13.path)\n",
"VAR_12.append('not_applicable')\n",
"return None\n"
] | [
"def not_applicable(request):...\n",
"self.assertEqual('/request', request.path)\n",
"calls.append('not_applicable')\n",
"return None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"self.ensure_one()\n",
"VAR_5 = self._get_state_domain()\n",
"VAR_27 = False\n",
"if self.automaton:\n",
"VAR_33 = self.env['crapo.transition'].search([('automaton', '=', self.\n automaton.id), ('from_state', '=', self.state.id)])\n",
"VAR_5.append(('sequence', '>', self.sta... | [
"def _next_states(self):...\n",
"self.ensure_one()\n",
"domain = self._get_state_domain()\n",
"next_states = False\n",
"if self.automaton:\n",
"eligible_transitions = self.env['crapo.transition'].search([('automaton',\n '=', self.automaton.id), ('from_state', '=', self.state.id)])\n",
"domain.append(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Assign'"
] |
[
"@app.route('/metric/api/v1.0/metric/get')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0 = getMetric(request.args.get('fromtime', None), request.args.get(\n 'totime', None), request.args.get('origin', None), request.args.get(\n 'key', None), request.args.get('count', None), (request.args.get(\n 'order', 'Ti... | [
"@app.route('/metric/api/v1.0/metric/get')...\n",
"\"\"\"docstring\"\"\"\n",
"res = getMetric(request.args.get('fromtime', None), request.args.get(\n 'totime', None), request.args.get('origin', None), request.args.get(\n 'key', None), request.args.get('count', None), (request.args.get(\n 'order', 'Time... | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'"
] |
[
"\"\"\"\nPython scripte to list items from MySQL\n\"\"\"\n",
"import MySQLdb\n",
"from sys import argv\n",
"if __name__ == '__main__':\n",
"VAR_0 = MySQLdb.connect(host='localhost', port=3306, user=argv[1], passwd=\n argv[2], VAR_0=argv[3], charset='utf8')\n",
"VAR_1 = VAR_0.cursor()\n",
"VAR_1.execu... | [
"\"\"\"\nPython scripte to list items from MySQL\n\"\"\"\n",
"import MySQLdb\n",
"from sys import argv\n",
"if __name__ == '__main__':\n",
"db = MySQLdb.connect(host='localhost', port=3306, user=argv[1], passwd=argv\n [2], db=argv[3], charset='utf8')\n",
"c = db.cursor()\n",
"c.execute('SELECT * FROM... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"print(VAR_0, file=sys.stderr)\n"
] | [
"def log_error(error):...\n",
"print(error, file=sys.stderr)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __repr__(self):...\n",
"return self.get_name()\n"
] | [
"def __repr__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __sinit__(self):...\n",
"self.ctx = zmq.Context()\n",
"super().__sinit__()\n"
] | [
"def __sinit__(self):...\n",
"self.ctx = zmq.Context()\n",
"super().__sinit__()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_snapshot(VAR_9)\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_snapshot(snapshot)\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_7(self, VAR_21):...\n",
"VAR_22 = \"SELECT * FROM log_query WHERE log_hash = '%s' LIMIT 1\" % VAR_21\n",
"self.cur.execute(VAR_22)\n",
"self.conn.commit()\n",
"VAR_25 = self.cur.fetchone()\n",
"return VAR_25\n"
] | [
"def get_query_by_loghash(self, loghash):...\n",
"sql = \"SELECT * FROM log_query WHERE log_hash = '%s' LIMIT 1\" % loghash\n",
"self.cur.execute(sql)\n",
"self.conn.commit()\n",
"query = self.cur.fetchone()\n",
"return query\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
"@eqlx.with_timeout...\n",
"time.sleep(1)\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_6(self, VAR_8=None):...\n",
"if not self.title:\n",
"self.title = VAR_8\n",
"VAR_3 = (\"UPDATE jdk_entries SET title = '\" + self.title + \"'\" +\n \"WHERE jdk_entries.id = '\" + self.entry_id + \"';\")\n",
"FUNC_0(VAR_3)\n",
"self.update_date_modified()\n",
"return None\n"
] | [
"def update_title(self, title=None):...\n",
"if not self.title:\n",
"self.title = title\n",
"sql = (\"UPDATE jdk_entries SET title = '\" + self.title + \"'\" +\n \"WHERE jdk_entries.id = '\" + self.entry_id + \"';\")\n",
"db_execute(sql)\n",
"self.update_date_modified()\n",
"return None\n"
] | [
0,
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@command...\n",
"\"\"\"docstring\"\"\"\n",
"prnt('Bye', VIOLET)\n",
"exit(0)\n"
] | [
"@command...\n",
"\"\"\"docstring\"\"\"\n",
"prnt('Bye', VIOLET)\n",
"exit(0)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Expr'"
] |
[
"import os\n",
"from kubernetes import client, config\n",
"import pytest\n",
"from pytest_bdd import scenario, then, parsers\n",
"import yaml\n",
"from tests import utils\n",
"@pytest.fixture...\n",
"config.load_kube_config(config_file=kubeconfig)\n",
"VAR_4 = client.CoreV1Api()\n",
"VAR_5 = os.pa... | [
"import os\n",
"from kubernetes import client, config\n",
"import pytest\n",
"from pytest_bdd import scenario, then, parsers\n",
"import yaml\n",
"from tests import utils\n",
"@pytest.fixture...\n",
"config.load_kube_config(config_file=kubeconfig)\n",
"k8s_client = client.CoreV1Api()\n",
"pod_mani... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
2
] | [
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assert'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assert'"
] |
[
"def FUNC_11(self):...\n",
"for string in self.test_strings:\n",
"self.assertEqual(prepare_string_argument(string, 'WeIrD_O/S'), string)\n"
] | [
"def test_prepare_string_argument_unsupported(self):...\n",
"for string in self.test_strings:\n",
"self.assertEqual(prepare_string_argument(string, 'WeIrD_O/S'), string)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"async def FUNC_2(VAR_6):...\n",
"VAR_7 = {'username': VAR_0, 'password': 'testing123G'}\n",
"VAR_8 = await VAR_6.post('/users', VAR_7=json.dumps(data))\n",
"assert VAR_8.status == 201\n"
] | [
"async def test_positive_register_(test_cli):...\n",
"data = {'username': username, 'password': 'testing123G'}\n",
"resp = await test_cli.post('/users', data=json.dumps(data))\n",
"assert resp.status == 201\n"
] | [
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Assign'",
"Assert'"
] |
[
"from datetime import date, datetime\n",
"import simplejson as json\n",
"import time\n",
"from base import BaseTest\n",
"from snuba.util import all_referenced_columns, column_expr, complex_column_expr, conditions_expr, escape_literal, tuplify, Timer\n",
"def FUNC_0(self):...\n",
"VAR_0 = {'granularity':... | [
"from datetime import date, datetime\n",
"import simplejson as json\n",
"import time\n",
"from base import BaseTest\n",
"from snuba.util import all_referenced_columns, column_expr, complex_column_expr, conditions_expr, escape_literal, tuplify, Timer\n",
"def test_column_expr(self):...\n",
"body = {'gran... | [
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
... |
[
"def FUNC_0(VAR_0=None):...\n",
"VAR_1 = frappe.db.sql_list('select name from `tabLeave Type` order by name asc'\n )\n",
"VAR_3 = FUNC_1(VAR_1)\n",
"VAR_4 = FUNC_2(VAR_0, VAR_1)\n",
"return VAR_3, VAR_4\n"
] | [
"def execute(filters=None):...\n",
"leave_types = frappe.db.sql_list(\n 'select name from `tabLeave Type` order by name asc')\n",
"columns = get_columns(leave_types)\n",
"data = get_data(filters, leave_types)\n",
"return columns, data\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"return 'submit user test %s for task %s (ID %d) %s' % (repr(self.filenames),\n self.task[1], self.task[0], self.url)\n"
] | [
"def describe(self):...\n",
"return 'submit user test %s for task %s (ID %d) %s' % (repr(self.filenames),\n self.task[1], self.task[0], self.url)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"if self.resources is not None:\n",
"assert 'CPU' not in self.resources, \"'CPU' should not be included in the resource dictionary. Use num_cpus instead.\"\n",
"if self.num_workers is not None:\n",
"assert 'GPU' not in self.resources, \"'GPU' should not be included in the resource ... | [
"def _check_usage(self):...\n",
"if self.resources is not None:\n",
"assert 'CPU' not in self.resources, \"'CPU' should not be included in the resource dictionary. Use num_cpus instead.\"\n",
"if self.num_workers is not None:\n",
"assert 'GPU' not in self.resources, \"'GPU' should not be included in the res... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assert'",
"Condition",
"Assert'",
"Condition"
] |
[
"def FUNC_1(VAR_0, VAR_1, VAR_3, VAR_4, VAR_5, VAR_6, **VAR_2):...\n",
"if VAR_3 not in ('post_add', 'pre_remove'):\n",
"return\n",
"if VAR_4:\n",
"if VAR_5 == Submission:\n",
"FUNC_0(Submission, VAR_1)\n",
"VAR_36 = set()\n",
"for submission_pk in VAR_6:\n",
"VAR_40 = Submission.objects.get(pk=subm... | [
"def invalidate_content_m2m(sender, instance, action, reverse, model, pk_set,...\n",
"if action not in ('post_add', 'pre_remove'):\n",
"return\n",
"if reverse:\n",
"if model == Submission:\n",
"invalidate_content(Submission, instance)\n",
"seen_courses = set()\n",
"for submission_pk in pk_set:\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Condition",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def __init__(self, VAR_18, VAR_35=10000, **VAR_16):...\n",
"CLASS_17.__init__(self, VAR_18, VAR_35=length, VAR_36=errors.NO_MSG_BODY, **kw)\n"
] | [
"def __init__(self, item, length=10000, **kw):...\n",
"VLength.__init__(self, item, length=length, empty_error=errors.NO_MSG_BODY,\n **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __str__(self):...\n",
"return 'Could not delete ad.\\n' + super().__str__()\n"
] | [
"def __str__(self):...\n",
"return 'Could not delete ad.\\n' + super().__str__()\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(VAR_22, VAR_23):...\n",
"if not VAR_23:\n",
"return VAR_22\n",
"for k in VAR_23.split('.'):\n",
"if k in VAR_22 and isinstance(VAR_22[k], dict):\n",
"return VAR_22\n",
"VAR_22 = VAR_22[k]\n"
] | [
"def strip_hash(h, keys):...\n",
"if not keys:\n",
"return h\n",
"for k in keys.split('.'):\n",
"if k in h and isinstance(h[k], dict):\n",
"return h\n",
"h = h[k]\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def __init__(self):...\n",
""
] | [
"def __init__(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_11(self):...\n",
"if self.accept(CLASS_1.WORD):\n",
"VAR_22 = self.last.lexeme\n",
"return None\n",
"VAR_21 = []\n",
"while self.accept(CLASS_1.WORD):\n",
"VAR_21.append(self.last.lexeme)\n",
"VAR_43 = CLASS_8(VAR_22, VAR_21)\n",
"VAR_33 = self.redirections()\n",
"if VAR_33:\n",
"VAR_4... | [
"def command(self):...\n",
"if self.accept(TokenType.WORD):\n",
"command = self.last.lexeme\n",
"return None\n",
"args = []\n",
"while self.accept(TokenType.WORD):\n",
"args.append(self.last.lexeme)\n",
"node = CommandNode(command, args)\n",
"redirs = self.redirections()\n",
"if redirs:\n",
"nod... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_30(VAR_13):...\n",
"self.fail('authenticate should not be called')\n"
] | [
"def skipped(request):...\n",
"self.fail('authenticate should not be called')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_2, self).__init__()\n",
"self.relationship_direction = VAR_5\n",
"self._data = VAR_3\n",
"self._accessor = VAR_4\n",
"self._relationships = {}\n"
] | [
"def __init__(self, data, accessor, relationship_direction):...\n",
"\"\"\"docstring\"\"\"\n",
"super(DataTraversalProxy, self).__init__()\n",
"self.relationship_direction = relationship_direction\n",
"self._data = data\n",
"self._accessor = accessor\n",
"self._relationships = {}\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@wraps(VAR_7)...\n",
""
] | [
"@wraps(f)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def __init__(self, VAR_42, VAR_43):...\n",
"\"\"\"docstring\"\"\"\n",
"self.key = VAR_42\n",
"self.test_tags = iter(VAR_43)\n",
"self.counter = {'tag': 0}\n"
] | [
"def __init__(self, key, test_tags):...\n",
"\"\"\"docstring\"\"\"\n",
"self.key = key\n",
"self.test_tags = iter(test_tags)\n",
"self.counter = {'tag': 0}\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_13():...\n",
"from .log import init_logging\n",
"init_logging()\n",
"VAR_23 = argparse.ArgumentParser()\n",
"VAR_23.add_argument('--admin', nargs='*', help=\n 'List of usernames set to be admin')\n",
"VAR_23.add_argument('--user-requirements-txt-url', help=\n 'URL to a requirements.txt fil... | [
"def main():...\n",
"from .log import init_logging\n",
"init_logging()\n",
"argparser = argparse.ArgumentParser()\n",
"argparser.add_argument('--admin', nargs='*', help=\n 'List of usernames set to be admin')\n",
"argparser.add_argument('--user-requirements-txt-url', help=\n 'URL to a requirements.t... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@Json...\n",
"if VAR_2._chk_error(errors.NO_TITLE):\n",
"VAR_2._chk_error(errors.TITLE_TOO_LONG)\n",
"VAR_2._chk_errors((errors.NO_LOCATION, errors.NO_DESCRIPTION, errors.\n INVALID_DATE, errors.NO_DATE))\n",
"VAR_2._focus('title')\n",
"if VAR_2.error:\n",
"return\n",
"VAR_0.title = VAR_4\n",
"V... | [
"@Json...\n",
"if res._chk_error(errors.NO_TITLE):\n",
"res._chk_error(errors.TITLE_TOO_LONG)\n",
"res._chk_errors((errors.NO_LOCATION, errors.NO_DESCRIPTION, errors.\n INVALID_DATE, errors.NO_DATE))\n",
"res._focus('title')\n",
"if res.error:\n",
"return\n",
"meetup.title = title\n",
"meetup.des... | [
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",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"for VAR_6 in self.actors.keys():\n",
"self.actors[VAR_6].moveTick()\n"
] | [
"def moveTick(self):...\n",
"for ID in self.actors.keys():\n",
"self.actors[ID].moveTick()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_29(self):...\n",
"VAR_25 = 3000000000\n",
"self.cursor.execute('create table t1(d bigint)')\n",
"self.cursor.execute('insert into t1 values (?)', VAR_25)\n",
"VAR_20 = self.cursor.execute('select d from t1').fetchone()[0]\n",
"self.assertEqual(VAR_20, VAR_25)\n"
] | [
"def test_bigint(self):...\n",
"input = 3000000000\n",
"self.cursor.execute('create table t1(d bigint)')\n",
"self.cursor.execute('insert into t1 values (?)', input)\n",
"result = self.cursor.execute('select d from t1').fetchone()[0]\n",
"self.assertEqual(result, input)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self, VAR_3=None):...\n",
"\"\"\"docstring\"\"\"\n",
"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 expand_wildcards(self, wildcards=None):...\n",
"\"\"\"docstring\"\"\"\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)... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2(VAR_1, VAR_2, VAR_3='', VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_4(VAR_1, VAR_2['oauth_token'], VAR_6=resp['oauth_token_secret'],\n VAR_4=extra_data, VAR_3=token_type)\n"
] | [
"def oauth1_token_setter(remote, resp, token_type='', extra_data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"return token_setter(remote, resp['oauth_token'], secret=resp[\n 'oauth_token_secret'], extra_data=extra_data, token_type=token_type)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_2(self, VAR_4, *VAR_5, **VAR_6):...\n",
"return self.to_python(VAR_4)\n"
] | [
"def from_db_value(self, value, *args, **kwargs):...\n",
"return self.to_python(value)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15 = False\n",
"if VAR_2 == 'prev':\n",
"VAR_0 = VAR_0.reverse()\n",
"for m in VAR_0:\n",
"if VAR_15:\n",
"if VAR_15:\n",
"return m\n",
"if VAR_1 == m:\n",
"return VAR_0[0]\n",
"return False\n",
"VAR_15 = True\n"
] | [
"def get_next_or_prev(models, item, direction):...\n",
"\"\"\"docstring\"\"\"\n",
"getit = False\n",
"if direction == 'prev':\n",
"models = models.reverse()\n",
"for m in models:\n",
"if getit:\n",
"if getit:\n",
"return m\n",
"if item == m:\n",
"return models[0]\n",
"return False\n",
"getit... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"For",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'",
"Assign'"
] |
[
"def FUNC_4(self, VAR_5='test', VAR_6=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from invenio.modules.oauthclient.client import oauth\n",
"oauth.remote_apps[VAR_5].handle_oauth2_response = MagicMock(return_value=\n data or {'access_token': 'test_access_token', 'scope': '', 'token_type':\n 'bearer'})\n"
] | [
"def mock_response(self, app='test', data=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from invenio.modules.oauthclient.client import oauth\n",
"oauth.remote_apps[app].handle_oauth2_response = MagicMock(return_value=data or\n {'access_token': 'test_access_token', 'scope': '', 'token_type': 'bearer'})\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Assign'"
] |
[
"\"\"\"\n\"\"\"\n",
"import pytz\n",
"import sqlite3\n",
"from datetime import datetime, timedelta\n",
"def __init__(self, VAR_0):...\n",
"self.config = VAR_0\n",
"self.co2_mult = self.config.get_co2_avoidance_factor()\n",
"self.db = sqlite3.connect(self.config.get_database_path(),\n check_same_thr... | [
"\"\"\"\n\"\"\"\n",
"import pytz\n",
"import sqlite3\n",
"from datetime import datetime, timedelta\n",
"def __init__(self, config):...\n",
"self.config = config\n",
"self.co2_mult = self.config.get_co2_avoidance_factor()\n",
"self.db = sqlite3.connect(self.config.get_database_path(),\n check_same_t... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_4):...\n",
"if self.log_dir is None:\n",
"return\n",
"VAR_19 = '%s_%s.log' % (VAR_4.start_time, VAR_4.__class__.__name__)\n",
"VAR_20 = os.path.join(self.log_dir, VAR_19)\n",
"VAR_21 = os.path.join(self.log_dir, VAR_4.__class__.__name__)\n",
"VAR_4.store_to_file(fd)\n",
"os.remov... | [
"def store_to_file(self, request):...\n",
"if self.log_dir is None:\n",
"return\n",
"filename = '%s_%s.log' % (request.start_time, request.__class__.__name__)\n",
"filepath = os.path.join(self.log_dir, filename)\n",
"linkpath = os.path.join(self.log_dir, request.__class__.__name__)\n",
"request.store_to... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@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 FUNC_13():...\n",
"VAR_16 = FUNC_7('models.json')\n",
"VAR_35 = [FUNC_12(VAR_34['model_system_name']) for VAR_34 in VAR_16]\n",
"return [item for inputs in VAR_35 for item in inputs]\n"
] | [
"def get_inputs_choices():...\n",
"models = load_json('models.json')\n",
"inputs_by_models = [get_inputs_choices_by_model(model['model_system_name']) for\n model in models]\n",
"return [item for inputs in inputs_by_models for item in inputs]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"import os\n",
"import sys\n",
"import unittest\n",
"from coalib.misc.Shell import escape_path_argument, prepare_string_argument, run_interactive_shell_command, run_shell_command\n",
"def FUNC_0(self):...\n",
"VAR_1 = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/hom... | [
"import os\n",
"import sys\n",
"import unittest\n",
"from coalib.misc.Shell import escape_path_argument, prepare_string_argument, run_interactive_shell_command, run_shell_command\n",
"def test_escape_path_argument_sh(self):...\n",
"_type = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-fil... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
] | [
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"E... |
[
"def FUNC_3(self):...\n",
"return self.best_submission.grade if self.best_submission and not self.unofficial else 0\n"
] | [
"def get_points(self):...\n",
"return self.best_submission.grade if self.best_submission and not self.unofficial else 0\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_11, VAR_12, VAR_13, VAR_14, VAR_15, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_33 = None\n",
"def FUNC_10(VAR_32, VAR_34):...\n",
"logging.info('Got signal %s', VAR_32)\n",
"VAR_7 = os.path.dirname(VAR_15)\n",
"if not os.path.isdir(VAR_7):\n",
"if not VAR_33:\n",
"if not os.path... | [
"def load_and_run(in_file, swarming_server, cost_usd_hour, start, out_file,...\n",
"\"\"\"docstring\"\"\"\n",
"task_result = None\n",
"def handler(sig, _):...\n",
"logging.info('Got signal %s', sig)\n",
"work_dir = os.path.dirname(out_file)\n",
"if not os.path.isdir(work_dir):\n",
"if not task_result:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def __contains__(self, VAR_41):...\n",
"return VAR_41 in self._lookup\n"
] | [
"def __contains__(self, key):...\n",
"return key in self._lookup\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_14(VAR_7):...\n",
"def FUNC_13(self, *VAR_16, **VAR_10):...\n",
"if not self.is_group_user(VAR_8):\n",
"return VAR_7(self, *VAR_16, **kwargs)\n"
] | [
"def decorator(method):...\n",
"def wrapper(self, *args, **kwargs):...\n",
"if not self.is_group_user(group):\n",
"return method(self, *args, **kwargs)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.params = VAR_71, VAR_72\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.params = params, kwparams\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_8, VAR_9):...\n",
"VAR_0.info('Checking new event existence: ' + VAR_8.name + ', date: ' + str\n (VAR_9))\n",
"VAR_18 = VAR_8.event_type_id.id\n",
"VAR_19 = self.env['event.event'].search([('event_type_id', '=', VAR_18), (\n 'date_end', '=', str(VAR_9))])\n",
"if VAR_19:\n",
"r... | [
"def _event_does_not_exist(self, old_repeating_event, new_end_date):...\n",
"_logger.info('Checking new event existence: ' + old_repeating_event.name +\n ', date: ' + str(new_end_date))\n",
"old_event_cat = old_repeating_event.event_type_id.id\n",
"existing_event = self.env['event.event'].search([('event_t... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = logging.getLogger(__name__)\n",
"VAR_7.setLevel(logging.DEBUG)\n",
"VAR_7.debug('Initialized thread')\n",
"super(CLASS_8, self).__init__()\n",
"self.job_queue = VAR_6\n",
"self.subscribed_queues = []\n",
"self.end = False\n"
] | [
"def __init__(self, queue):...\n",
"\"\"\"docstring\"\"\"\n",
"logger = logging.getLogger(__name__)\n",
"logger.setLevel(logging.DEBUG)\n",
"logger.debug('Initialized thread')\n",
"super(MonitoringThread, self).__init__()\n",
"self.job_queue = queue\n",
"self.subscribed_queues = []\n",
"self.end = F... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def __repr__(self):...\n",
"return f'<Roamer: {self._r_path_.description()} => {self._r_item_!r}>'\n"
] | [
"def __repr__(self):...\n",
"return f'<Roamer: {self._r_path_.description()} => {self._r_item_!r}>'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(VAR_15, VAR_2, VAR_3='text', VAR_4=bconfig....\n",
"\"\"\"docstring\"\"\"\n",
"VAR_43 = reader.get_cache(VAR_2)\n",
"if not VAR_43:\n",
"reader.set_cache(VAR_2, reader.get_regular_expressions(VAR_2, rebuild=\n rebuild_cache, VAR_7=no_cache))\n",
"VAR_44 = VAR_43[0]\n",
"VAR_43 = reader.ge... | [
"def get_keywords_from_text(text_lines, taxonomy_name, output_mode='text',...\n",
"\"\"\"docstring\"\"\"\n",
"cache = reader.get_cache(taxonomy_name)\n",
"if not cache:\n",
"reader.set_cache(taxonomy_name, reader.get_regular_expressions(\n taxonomy_name, rebuild=rebuild_cache, no_cache=no_cache))\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assi... |
[
"def FUNC_0(self):...\n",
"VAR_8 = lambda x: dict(request_token_params={'scope': ''}, base_url=\n 'https://foo.bar/', request_token_url=None, access_token_url=\n 'https://foo.bar/oauth/access_token', authorize_url=\n 'https://foo.bar/oauth/authorize', consumer_key=x, consumer_secret=\n 'testsecret')\n... | [
"def setUp(self):...\n",
"params = lambda x: dict(request_token_params={'scope': ''}, base_url=\n 'https://foo.bar/', request_token_url=None, access_token_url=\n 'https://foo.bar/oauth/access_token', authorize_url=\n 'https://foo.bar/oauth/authorize', consumer_key=x, consumer_secret=\n 'testsecret')\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_51 = frappe.db.get_table_columns(self.doctype)\n",
"VAR_52 = []\n",
"for fld in self.fields:\n",
"for VAR_34 in optional_fields:\n",
"for fld in VAR_52:\n",
"if VAR_34 in fld and not VAR_34 in VAR_51:\n",
"VAR_52 = []\n",
"VAR_52.append(fl... | [
"def set_optional_columns(self):...\n",
"\"\"\"docstring\"\"\"\n",
"columns = frappe.db.get_table_columns(self.doctype)\n",
"to_remove = []\n",
"for fld in self.fields:\n",
"for f in optional_fields:\n",
"for fld in to_remove:\n",
"if f in fld and not f in columns:\n",
"to_remove = []\n",
"to_remo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Condition",
"Assign'",
"Expr'",
"For",
"Condition",
"For",
"Assign'",
"For",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import codecs\n",
"import datetime\n",
"import io\n",
"import os\n",
"import sys\n",
"import time\n",
"import traceback\n",
"import urllib\n",
"import requests\n... | [
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import codecs\n",
"import datetime\n",
"import io\n",
"import os\n",
"import sys\n",
"import time\n",
"import traceback\n",
"import urllib\n",
"import requests\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
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'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"For",
"Condition",
"FunctionDef'",
"Assign'",
"Expr... |
[
"def FUNC_1(self, VAR_1, VAR_2):...\n",
"for VAR_3 in VAR_2:\n",
"VAR_28 = VAR_3['source']['type']\n",
"if VAR_28 == 'inverter':\n",
"self.add_inverter_data(VAR_1, VAR_3)\n",
"if VAR_28 == 'consumption':\n",
"self.add_consumption_data_row(VAR_1, VAR_3['energy'], VAR_3['power'])\n"
] | [
"def add_data(self, ts, data_points):...\n",
"for data in data_points:\n",
"data_type = data['source']['type']\n",
"if data_type == 'inverter':\n",
"self.add_inverter_data(ts, data)\n",
"if data_type == 'consumption':\n",
"self.add_consumption_data_row(ts, data['energy'], data['power'])\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'\n",
"self.response.out.write('Server up')\n"
] | [
"def get(self):...\n",
"self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'\n",
"self.response.out.write('Server up')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_2, VAR_3, VAR_4, VAR_5, VAR_6):...\n",
"VAR_0.info('Initializing an instance of MySQLConnectionPool')\n",
"VAR_0.debug(\n 'Type checking for host address, username, password, database name and pool size'\n )\n",
"if type(VAR_2) != str:\n",
"if type(VAR_3) != str:\n",
"if type... | [
"def __init__(self, hostaddr, usr, pwd, dbname, size):...\n",
"logger.info('Initializing an instance of MySQLConnectionPool')\n",
"logger.debug(\n 'Type checking for host address, username, password, database name and pool size'\n )\n",
"if type(hostaddr) != str:\n",
"if type(usr) != str:\n",
"if ty... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_21(self, VAR_3):...\n",
"if self.allowed_email_suffix:\n",
"return VAR_3.endswith(self.allowed_email_suffix)\n",
"return True\n"
] | [
"def passes_email_suffix(self, email):...\n",
"if self.allowed_email_suffix:\n",
"return email.endswith(self.allowed_email_suffix)\n",
"return True\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"@property...\n",
"self.check_broken_symlink()\n",
"return os.path.getsize(self.file)\n"
] | [
"@property...\n",
"self.check_broken_symlink()\n",
"return os.path.getsize(self.file)\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"@FUNC_0...\n",
"VAR_27 = VAR_10.get_transport()\n",
"VAR_7 = VAR_27.open_session()\n",
"VAR_7.invoke_shell()\n",
"VAR_0.debug(_('Reading CLI MOTD'))\n",
"self._get_output(VAR_7)\n",
"VAR_28 = 'stty columns 255'\n",
"VAR_0.debug(_(\"Setting CLI terminal width: '%s'\"), VAR_28)\n",
"VAR_7.send(VAR_28... | [
"@with_timeout...\n",
"transport = ssh.get_transport()\n",
"chan = transport.open_session()\n",
"chan.invoke_shell()\n",
"LOG.debug(_('Reading CLI MOTD'))\n",
"self._get_output(chan)\n",
"cmd = 'stty columns 255'\n",
"LOG.debug(_(\"Setting CLI terminal width: '%s'\"), cmd)\n",
"chan.send(cmd + '\\r'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Return'",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_9, VAR_14):...\n",
"from opennode.oms.endpoint.httprest.auth import IHttpRestAuthenticationUtility\n",
"VAR_19 = getUtility(IHttpRestAuthenticationUtility)\n",
"VAR_31 = VAR_19.get_principal(VAR_14)\n",
"VAR_31 = 'oms.anonymous'\n",
"if VAR_31 != 'oms.anonymous':\n",
"VAR_19.renew... | [
"def get_interaction(self, request, token):...\n",
"from opennode.oms.endpoint.httprest.auth import IHttpRestAuthenticationUtility\n",
"authentication_utility = getUtility(IHttpRestAuthenticationUtility)\n",
"principal = authentication_utility.get_principal(token)\n",
"principal = 'oms.anonymous'\n",
"if ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Return'"
] |
[
"from sqlalchemy import Column, ForeignKey, Integer, String\n",
"from sqlalchemy.ext.declarative import declarative_base\n",
"from sqlalchemy.orm import relationship\n",
"from sqlalchemy import create_engine\n",
"VAR_0 = declarative_base()\n",
"__tablename__ = 'user'\n",
"VAR_2 = Column(Integer, primary... | [
"from sqlalchemy import Column, ForeignKey, Integer, String\n",
"from sqlalchemy.ext.declarative import declarative_base\n",
"from sqlalchemy.orm import relationship\n",
"from sqlalchemy import create_engine\n",
"Base = declarative_base()\n",
"__tablename__ = 'user'\n",
"id = Column(Integer, primary_key... | [
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Docstring",
"Return'"
] |
[
"def __init__(self):...\n",
"self.content = VAR_2\n"
] | [
"def __init__(self):...\n",
"self.content = content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_11(self, VAR_14):...\n",
""
] | [
"def is_integer(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.