lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_0(self):...\n",
"super(CLASS_0, self).setUp()\n",
"VAR_7.environ.pop('SWARMING_LOAD_TEST', None)\n",
"self.root_dir = tempfile.mkdtemp(prefix='bot_main')\n",
"self.old_cwd = VAR_7.getcwd()\n",
"VAR_7.chdir(self.root_dir)\n",
"VAR_7.mkdir('logs')\n",
"self.server = xsrf_client.XsrfRemote('htt... | [
"def setUp(self):...\n",
"super(TestBotMain, self).setUp()\n",
"os.environ.pop('SWARMING_LOAD_TEST', None)\n",
"self.root_dir = tempfile.mkdtemp(prefix='bot_main')\n",
"self.old_cwd = os.getcwd()\n",
"os.chdir(self.root_dir)\n",
"os.mkdir('logs')\n",
"self.server = xsrf_client.XsrfRemote('https://loca... | [
0,
0,
0,
0,
0,
0,
0,
5,
5,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"VAR_1 = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/home/usr/a-file')\n",
"self.assertEqual(escape_path_argument('/home/usr/a-dir/', VAR_1),\n '/home/usr/a-dir/')\n",
"self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bl... | [
"def test_escape_path_argument_sh(self):...\n",
"_type = 'sh'\n",
"self.assertEqual(escape_path_argument('/home/usr/a-file', _type),\n '/home/usr/a-file')\n",
"self.assertEqual(escape_path_argument('/home/usr/a-dir/', _type),\n '/home/usr/a-dir/')\n",
"self.assertEqual(escape_path_argument('/home/us r... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_3, VAR_2):...\n",
"self.response_handlers[VAR_3] = VAR_2\n"
] | [
"def set_response_handler(self, reqid, fun):...\n",
"self.response_handlers[reqid] = fun\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_3, VAR_11=None):...\n",
"if super(CLASS_2, self).allowed(VAR_3, VAR_11):\n",
"self.verbose_name = _('Import Key Pair')\n",
"return True\n"
] | [
"def allowed(self, request, keypair=None):...\n",
"if super(ImportKeyPair, self).allowed(request, keypair):\n",
"self.verbose_name = _('Import Key Pair')\n",
"return True\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import json\n",
"import mock\n",
"import requests\n",
"from django.contrib.auth.models import User\n",
"from django.test import TransactionTestCase\n",
"... | [
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import json\n",
"import mock\n",
"import requests\n",
"from django.contrib.auth.models import User\n",
"from django.test import TransactionTestCase\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_58(self):...\n",
"VAR_2 = {'SEVERITY': {}, 'CONFIDENCE': {}}\n",
"self.check_example('nosec.py', VAR_2)\n"
] | [
"def test_nosec(self):...\n",
"expect = {'SEVERITY': {}, 'CONFIDENCE': {}}\n",
"self.check_example('nosec.py', expect)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"return self.display_name\n"
] | [
"def get_display_name(self):...\n",
"return self.display_name\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_6, self).__init__(VAR_2)\n",
"self.hostname = VAR_3\n",
"self.message = 'Component %s crashed on remote host %s' % (VAR_2, VAR_3)\n"
] | [
"def __init__(self, comp_name, hostname):...\n",
"\"\"\"docstring\"\"\"\n",
"super(RemoteCrashEvent, self).__init__(comp_name)\n",
"self.hostname = hostname\n",
"self.message = 'Component %s crashed on remote host %s' % (comp_name, hostname)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = 'string'.format(VAR_2)\n",
"return FUNC_0(VAR_1)\n"
] | [
"def get_top_author(top_num):...\n",
"\"\"\"docstring\"\"\"\n",
"cmd = (\n \"\"\"SELECT authors.name,author_result.num\n FROM authors JOIN\n (SELECT SUM(article_result.num) as num,\n article_result.author\n from (SELECT articles.titl... | [
0,
0,
4,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_19(self, VAR_25, VAR_27=''):...\n",
"VAR_20 = request_mock(VAR_25=path, VAR_27=body, VAR_28={'Content-Type': [\n 'application/json']}, method='DELETE')\n",
"return self._render(VAR_20)\n"
] | [
"def delete(self, path, body=''):...\n",
"request = request_mock(path=path, body=body, headers={'Content-Type': [\n 'application/json']}, method='DELETE')\n",
"return self._render(request)\n"
] | [
0,
5,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(VAR_12, VAR_2, VAR_5):...\n",
"VAR_26 = VAR_12.request.body\n",
"VAR_2 = FUNC_1(VAR_2)\n",
"def FUNC_8(VAR_4):...\n",
"if not os.path.exists('D:' + VAR_4):\n",
"return VAR_4\n",
"VAR_28 = 1\n",
"while VAR_28 < 101:\n",
"VAR_32 = re.sub('\\\\.(.*?)$', ' (%d).\\\\1' % VAR_28, VAR_4)\n",
... | [
"def save_file_async(alter_ego, target_path, file_name):...\n",
"upload_data = alter_ego.request.body\n",
"target_path = decode_hexed_b64_to_str(target_path)\n",
"def get_non_duplicate_path(file_path):...\n",
"if not os.path.exists('D:' + file_path):\n",
"return file_path\n",
"duplicate = 1\n",
"while... | [
0,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_40(self, VAR_26):...\n",
"\"\"\"docstring\"\"\"\n",
"for filename in VAR_26:\n",
"if self.config['need_sudo'] or self.config['become_root']:\n",
"VAR_4 = 'Error collecting additional data from master: %s' % VAR_68\n",
"VAR_62 = self.retrieve_file(filename)\n",
"self.make_archive_readable(filen... | [
"def collect_extra_cmd(self, filenames):...\n",
"\"\"\"docstring\"\"\"\n",
"for filename in filenames:\n",
"if self.config['need_sudo'] or self.config['become_root']:\n",
"msg = 'Error collecting additional data from master: %s' % e\n",
"ret = self.retrieve_file(filename)\n",
"self.make_archive_readable... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"return self.HandleGet()\n"
] | [
"def HandlePost(self):...\n",
"return self.HandleGet()\n"
] | [
0,
5
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(VAR_24):...\n",
"for user, VAR_20, id1, id2 in VAR_23.findall(VAR_24):\n",
"VAR_21 = id1 + id2\n",
"FUNC_8(VAR_20, VAR_21, user)\n"
] | [
"def atfu(urls):...\n",
"for user, domain, id1, id2 in r_di.findall(urls):\n",
"id_ = id1 + id2\n",
"add_target(domain, id_, user)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_27(self, VAR_14, VAR_30, VAR_29):...\n",
"VAR_53 = \"%s '%s' '%s'\" % (VAR_5, VAR_30, VAR_14)\n",
"VAR_12 = \"ssh %s 'bash -s' < %s\" % (VAR_29, VAR_53)\n",
"FUNC_7(self.session, VAR_12)\n"
] | [
"def start_remote_clone_session(self, comp_name, session_name, hostname):...\n",
"remote_cmd = \"%s '%s' '%s'\" % (SCRIPT_CLONE_PATH, session_name, comp_name)\n",
"cmd = \"ssh %s 'bash -s' < %s\" % (hostname, remote_cmd)\n",
"send_main_session_command(self.session, cmd)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(VAR_0):...\n",
"VAR_2 = []\n",
"VAR_3 = FUNC_4(VAR_0)\n",
"VAR_4 = FUNC_3(VAR_0)\n",
"for item in VAR_3:\n",
"if VAR_4.get(item.name):\n",
"return VAR_2\n",
"VAR_9 = VAR_4[item.name]\n",
"VAR_10 = {'item_group': item.item_group, 'item': item.name, 'item_name':\n item.item_name}\n",
... | [
"def get_data(filters):...\n",
"data = []\n",
"items = get_items(filters)\n",
"sales_invoice_data = get_sales_details(filters)\n",
"for item in items:\n",
"if sales_invoice_data.get(item.name):\n",
"return data\n",
"item_obj = sales_invoice_data[item.name]\n",
"row = {'item_group': item.item_group, ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.dimensions.get('id', ['unknown'])[0]\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.dimensions.get('id', ['unknown'])[0]\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def __eq__(self, VAR_35):...\n",
"return self.__class__ == VAR_35.__class__ and self.inner_type == VAR_35.inner_type\n"
] | [
"def __eq__(self, other):...\n",
"return self.__class__ == other.__class__ and self.inner_type == other.inner_type\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@app.route('/auth/logout')...\n",
"logout_user()\n",
"return redirect(url_for('index'))\n"
] | [
"@app.route('/auth/logout')...\n",
"logout_user()\n",
"return redirect(url_for('index'))\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"@VAR_0.route('/')...\n",
"VAR_1 = ['स्वर्गवर्गः', 'व्योमवर्गः', 'दिग्वर्गः', 'कालवर्गः', 'धीवर्गः',\n 'शब्दादिवर्गः', 'नाट्यवर्गः', 'पातालभोगिवर्गः', 'नरकवर्गः', 'वारिवर्गः',\n 'भूमिवर्गः', 'पुरवर्गः', 'शैलवर्गः', 'वनौषधिवर्गः', 'सिंहादिवर्गः',\n 'मनुष्यवर्गः', 'ब्रह्मवर्गः', 'क्षत्रियवर्गः', 'वैश्यवर्ग... | [
"@app.route('/')...\n",
"all_vargas = ['स्वर्गवर्गः', 'व्योमवर्गः', 'दिग्वर्गः', 'कालवर्गः',\n 'धीवर्गः', 'शब्दादिवर्गः', 'नाट्यवर्गः', 'पातालभोगिवर्गः', 'नरकवर्गः',\n 'वारिवर्गः', 'भूमिवर्गः', 'पुरवर्गः', 'शैलवर्गः', 'वनौषधिवर्गः',\n 'सिंहादिवर्गः', 'मनुष्यवर्गः', 'ब्रह्मवर्गः', 'क्षत्रियवर्गः',\n 'व... | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"return FUNC_1(CLASS_0._TalkToHandlerAsync('', VAR_7, 'GET', VAR_10))\n"
] | [
"@staticmethod...\n",
"return JsonFromFuture(BaseRequest._TalkToHandlerAsync('', handler, 'GET',\n timeout))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._zinc_factory._compiler_interface(self._products)\n"
] | [
"@memoized_property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._zinc_factory._compiler_interface(self._products)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"import discord, yaml, vroll, pgsql, re\n",
"import texttable as tt\n",
"from discord.ext import commands\n",
"VAR_0 = yaml.safe_load(open('config.yaml'))\n",
"VAR_1 = VAR_0['token']\n",
"VAR_2 = VAR_0['chan_whitelist']\n",
"VAR_3 = VAR_0['pg_connection']\n",
"VAR_4 = VAR_0['role_whitelist']\n",
"VA... | [
"import discord, yaml, vroll, pgsql, re\n",
"import texttable as tt\n",
"from discord.ext import commands\n",
"config = yaml.safe_load(open('config.yaml'))\n",
"token = config['token']\n",
"chan_whitelist = config['chan_whitelist']\n",
"pg_connection = config['pg_connection']\n",
"role_whitelist = con... | [
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"For",
"For",
"Expr'",
"Return'",
"Return'",
"Condition",
"Docstring",
"Condition",
"Condition",
"... |
[
"def FUNC_4(self, VAR_6, VAR_12, VAR_13):...\n",
"VAR_14 = []\n",
"VAR_14.append('string'.format(VAR_6))\n",
"VAR_14.append('string'.format(VAR_6, VAR_12, VAR_13))\n",
"for query in VAR_14:\n",
"self.cur.execute(query)\n",
"self.conn.commit()\n"
] | [
"def update_attendance(self, username, event_id, attending):...\n",
"sql = []\n",
"sql.append(\n \"\"\"INSERT INTO users (username)\n VALUES ('{0}')\n ON DUPLICATE KEY UPDATE username = '{0}';\n \"\"\"\n .format(username))\n",
"sql.append(\n... | [
0,
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_0):...\n",
"VAR_8 = {'disabled': 0, 'is_stock_item': 1}\n",
"if VAR_0.get('item_group'):\n",
"VAR_8.update({'item_group': VAR_0['item_group']})\n",
"if VAR_0.get('item'):\n",
"VAR_8.update({'name': VAR_0['item']})\n",
"VAR_3 = frappe.get_all('Item', fields=['name', 'item_group', 'item_na... | [
"def get_items(filters):...\n",
"filters_dict = {'disabled': 0, 'is_stock_item': 1}\n",
"if filters.get('item_group'):\n",
"filters_dict.update({'item_group': filters['item_group']})\n",
"if filters.get('item'):\n",
"filters_dict.update({'name': filters['item']})\n",
"items = frappe.get_all('Item', fiel... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_5=None):...\n",
"VAR_25 = []\n",
"if self.automaton:\n",
"VAR_25.append(('automaton', '=', self.automaton.id))\n",
"VAR_25.append(('automaton', '=', self._get_model_automaton().id))\n",
"return VAR_25\n"
] | [
"def _get_state_domain(self, domain=None):...\n",
"result = []\n",
"if self.automaton:\n",
"result.append(('automaton', '=', self.automaton.id))\n",
"result.append(('automaton', '=', self._get_model_automaton().id))\n",
"return result\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_37(self, VAR_14, VAR_18):...\n",
"VAR_31 = self.get_related_model(VAR_14)\n",
"return self.session.query(VAR_31).get(VAR_18)\n"
] | [
"def get_related_obj(self, col_name, value):...\n",
"rel_model = self.get_related_model(col_name)\n",
"return self.session.query(rel_model).get(value)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"import argparse\n",
"import json\n",
"import logging\n",
"import os\n",
"import subprocess\n",
"import sys\n",
"import tempfile\n",
"from pystache import context\n",
"from os_apply_config import collect_config\n",
"from os_apply_config import config_exception as exc\n",
"from os_apply_config im... | [
"import argparse\n",
"import json\n",
"import logging\n",
"import os\n",
"import subprocess\n",
"import sys\n",
"import tempfile\n",
"from pystache import context\n",
"from os_apply_config import collect_config\n",
"from os_apply_config import config_exception as exc\n",
"from os_apply_config im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'... |
[
"@property...\n",
"return super(CLASS_0, self).content_security_policy + '; sandbox allow-scripts'\n"
] | [
"@property...\n",
"return super(FilesHandler, self\n ).content_security_policy + '; sandbox allow-scripts'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = {}\n",
"for VAR_24, deps in VAR_1.items():\n",
"VAR_16 = [d.check.name for d in deps]\n",
"VAR_8 = set()\n",
"VAR_7[VAR_24.check.name] += VAR_16\n",
"VAR_7[VAR_24.check.name] = VAR_16\n",
"VAR_9 = list(itertools.zip_longest(VAR_7.keys(),... | [
"def validate_deps(graph):...\n",
"\"\"\"docstring\"\"\"\n",
"test_graph = {}\n",
"for case, deps in graph.items():\n",
"test_deps = [d.check.name for d in deps]\n",
"visited = set()\n",
"test_graph[case.check.name] += test_deps\n",
"test_graph[case.check.name] = test_deps\n",
"unvisited = list(iter... | [
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Assign'",
"AugAssign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'"
] |
[
"@api_post...\n",
"VAR_7 = VAR_3.pop('submit_id', None)\n",
"VAR_0.submit(VAR_7=submit_id, config=body)\n",
"return JsonResponse({'status': True, 'submit_id': VAR_7}, encoder=JsonSerialize\n )\n"
] | [
"@api_post...\n",
"submit_id = body.pop('submit_id', None)\n",
"submit_manager.submit(submit_id=submit_id, config=body)\n",
"return JsonResponse({'status': True, 'submit_id': submit_id}, encoder=\n JsonSerialize)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"\"\"\"Django models for the redirects app.\"\"\"\n",
"import logging\n",
"import re\n",
"from django.db import models\n",
"from django.utils.translation import ugettext\n",
"from django.utils.translation import ugettext_lazy as _\n",
"from readthedocs.core.resolver import resolve_path\n",
"from readt... | [
"\"\"\"Django models for the redirects app.\"\"\"\n",
"import logging\n",
"import re\n",
"from django.db import models\n",
"from django.utils.translation import ugettext\n",
"from django.utils.translation import ugettext_lazy as _\n",
"from readthedocs.core.resolver import resolve_path\n",
"from readt... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",... |
[
"def FUNC_21(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"for key, value in self.iscsi_ips.items():\n",
"if value['nsp'] == VAR_15:\n",
"return key\n"
] | [
"def _get_ip_using_nsp(self, nsp):...\n",
"\"\"\"docstring\"\"\"\n",
"for key, value in self.iscsi_ips.items():\n",
"if value['nsp'] == nsp:\n",
"return key\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'"
] |
[
"def FUNC_38(self, VAR_16, VAR_11=None, VAR_22=None, VAR_23=False, VAR_24=False...\n",
"from frappe.utils.formatters import format_value\n",
"VAR_25 = self.meta.get_field(VAR_16)\n",
"if not VAR_25 and VAR_16 in default_fields:\n",
"from frappe.model.meta import get_default_df\n",
"VAR_46 = self.get(VAR_1... | [
"def get_formatted(self, fieldname, doc=None, currency=None, absolute_value=...\n",
"from frappe.utils.formatters import format_value\n",
"df = self.meta.get_field(fieldname)\n",
"if not df and fieldname in default_fields:\n",
"from frappe.model.meta import get_default_df\n",
"val = self.get(fieldname)\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"ImportFrom'",
"Assign'",
"Condition",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self):...\n",
"VAR_6 = None\n",
"VAR_6 = tempfile.NamedTemporaryFile(delete=False)\n",
"if VAR_6:\n",
"VAR_6.close()\n",
"os.remove(VAR_6.name)\n",
"os.chmod(VAR_6.name, stat.S_IREAD)\n",
"self._mox.StubOutWithMock(url_helper, 'UrlOpen')\n",
"url_helper.UrlOpen(mox.IgnoreArg(), method='... | [
"def testDownloadFileSavingErrors(self):...\n",
"file_readonly = None\n",
"file_readonly = tempfile.NamedTemporaryFile(delete=False)\n",
"if file_readonly:\n",
"file_readonly.close()\n",
"os.remove(file_readonly.name)\n",
"os.chmod(file_readonly.name, stat.S_IREAD)\n",
"self._mox.StubOutWithMock(url_h... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_6 = self.client.get('/api/apps')\n",
"self.assertEqual(VAR_6.status_code, 200)\n",
"self.assertEqual(len(VAR_6.data['results']), 2)\n",
"VAR_8 = VAR_6.data['results'][0]['id']\n",
"self.assertTrue(self.client.login(VAR_1='autotest-2', VAR_2='password'))\n",
"VAR_6 = self.c... | [
"def test_create(self):...\n",
"response = self.client.get('/api/apps')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(len(response.data['results']), 2)\n",
"app_id = response.data['results'][0]['id']\n",
"self.assertTrue(self.client.login(username='autotest-2', password='password'... | [
0,
5,
0,
0,
0,
5,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'"
] |
[
"def FUNC_22(self, VAR_6):...\n",
"VAR_49 = self.nodes.get(VAR_6['name'])\n",
"VAR_50 = []\n",
"VAR_51 = []\n",
"dep_resolve(VAR_49, VAR_50, VAR_51)\n",
"VAR_50.remove(VAR_49)\n",
"return VAR_50\n"
] | [
"def get_dep_list(self, comp):...\n",
"node = self.nodes.get(comp['name'])\n",
"res = []\n",
"unres = []\n",
"dep_resolve(node, res, unres)\n",
"res.remove(node)\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_21(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_36 in self.config['nodes']:\n",
"return False\n",
"VAR_36 = fnmatch.translate(VAR_36)\n",
"VAR_1 = 'Error comparing %s to provided node regex %s: %s'\n",
"if re.match(VAR_36, VAR_5):\n",
"self.log_debug(VAR_1 % (VAR_5, VAR_36, err))... | [
"def compare_node_to_regex(self, node):...\n",
"\"\"\"docstring\"\"\"\n",
"for regex in self.config['nodes']:\n",
"return False\n",
"regex = fnmatch.translate(regex)\n",
"msg = 'Error comparing %s to provided node regex %s: %s'\n",
"if re.match(regex, node):\n",
"self.log_debug(msg % (node, regex, err... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_1):...\n",
"self.database = lite.connect(VAR_0)\n"
] | [
"def __init__(self, bot):...\n",
"self.database = lite.connect(DATABASE_PATH)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_4(self):...\n",
"self.response.set_status(403)\n",
"return\n"
] | [
"def post(self):...\n",
"self.response.set_status(403)\n",
"return\n"
] | [
0,
5,
5
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_23():...\n",
"return threading.current_thread().getName() == 'MainThread'\n"
] | [
"def is_main_thread():...\n",
"return threading.current_thread().getName() == 'MainThread'\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(self, VAR_23):...\n",
"VAR_23 = FUNC_1(VAR_23)\n",
"if not VAR_23:\n",
"return self.error()\n",
"VAR_15 = Subreddit._by_name(VAR_23)\n",
"return VAR_23\n",
"return self.error(errors.SUBREDDIT_EXISTS)\n"
] | [
"def run(self, name):...\n",
"name = chksrname(name)\n",
"if not name:\n",
"return self.error()\n",
"a = Subreddit._by_name(name)\n",
"return name\n",
"return self.error(errors.SUBREDDIT_EXISTS)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"for VAR_6 in self.configurations_for_servers:\n",
"VAR_16 = {'status': self.STOPPED, 'config': CONF.get('lsp-server', VAR_6),\n 'instance': None}\n",
"if VAR_6 not in self.clients:\n",
"self.clients[VAR_6] = VAR_16\n",
"VAR_0.debug(self.clients[VAR_6]['config'] != VAR_16['con... | [
"def update_server_list(self):...\n",
"for language in self.configurations_for_servers:\n",
"config = {'status': self.STOPPED, 'config': CONF.get('lsp-server', language\n ), 'instance': None}\n",
"if language not in self.clients:\n",
"self.clients[language] = config\n",
"logger.debug(self.clients[langu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"return any(VAR_19 in VAR_46 for VAR_46 in [' '.join(VAR_46) for VAR_46 in\n self.lines])\n"
] | [
"def contains(self, command):...\n",
"\"\"\"docstring\"\"\"\n",
"return any(command in line for line in [' '.join(line) for line in self.lines])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_20=True, *VAR_15, **VAR_16):...\n",
"CLASS_6.__init__(self, VAR_7, *VAR_15, VAR_20=redirect, **kw)\n"
] | [
"def __init__(self, param, redirect=True, *a, **kw):...\n",
"VMeetup.__init__(self, param, *a, redirect=redirect, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"return os.path.getsize(VAR_2)\n"
] | [
"def get_file_size(path):...\n",
"\"\"\"docstring\"\"\"\n",
"return os.path.getsize(path)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name}\n",
"self.stubs.Set(self.driver, '_get_iscsi_properties', self.\n _fake_get_iscsi_properties)\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'acce... | [
"def test_initialize_connection(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name}\n",
"self.stubs.Set(self.driver, '_get_iscsi_properties', self.\n _fake_get_iscsi_properties)\n",
"self.driver._eql_execute('volume', 'select', ... | [
0,
0,
0,
0,
2,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
"VAR_8 = VAR_12.routes or [VAR_12.navbar_tab_url]\n",
"return [webapp2.Route(r, VAR_12) for r in VAR_8]\n"
] | [
"@classmethod...\n",
"routes = cls.routes or [cls.navbar_tab_url]\n",
"return [webapp2.Route(r, cls) for r in routes]\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"self.assertTrue({'name': 'DocField'} in DatabaseQuery('DocType').execute(\n filters={'name': 'DocField'}))\n"
] | [
"def test_filters_4(self):...\n",
"self.assertTrue({'name': 'DocField'} in DatabaseQuery('DocType').execute(\n filters={'name': 'DocField'}))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_19(VAR_10, VAR_3, VAR_7):...\n",
"VAR_21 = VAR_3 + '-' + VAR_7\n",
"VAR_12 = 0\n",
"VAR_28 = VAR_21, VAR_12\n",
"VAR_18 = 'INSERT INTO {} VALUES (?, ?)'.format(CFG('options_table_name'))\n",
"VAR_10.execute(VAR_18, VAR_28)\n"
] | [
"def insertOption(c, poll_name, option):...\n",
"key = poll_name + '-' + option\n",
"count = 0\n",
"params = key, count\n",
"req = 'INSERT INTO {} VALUES (?, ?)'.format(CFG('options_table_name'))\n",
"c.execute(req, params)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_21(self, VAR_17, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_volume(VAR_16)\n",
"VAR_0.warn(_('Volume %s is not found!, it may have been deleted'), VAR_16[\n 'name'])\n",
"VAR_0.error(_('Failed to ensure export of volume %s'), VAR_16['name'])\n"
] | [
"def ensure_export(self, context, volume):...\n",
"\"\"\"docstring\"\"\"\n",
"self._check_volume(volume)\n",
"LOG.warn(_('Volume %s is not found!, it may have been deleted'), volume['name']\n )\n",
"LOG.error(_('Failed to ensure export of volume %s'), volume['name'])\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_27(self, VAR_43, VAR_44):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_63 = self.getfile(VAR_43)\n",
"if VAR_63 == False:\n",
"VAR_64 = self.getfile(VAR_44)\n",
"if VAR_64 != False:\n",
"self.get_path(os.path.dirname(VAR_43)).remove(VAR_63)\n",
"VAR_63[VAR_1] = os.path.basename(VAR_44)\n",
"self... | [
"def rename(self, oldpath, newpath):...\n",
"\"\"\"docstring\"\"\"\n",
"old = self.getfile(oldpath)\n",
"if old == False:\n",
"new = self.getfile(newpath)\n",
"if new != False:\n",
"self.get_path(os.path.dirname(oldpath)).remove(old)\n",
"old[A_NAME] = os.path.basename(newpath)\n",
"self.get_path(os... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_17(self):...\n",
"self.assertFalse(zf._allowZip64)\n"
] | [
"def test_open_zipFalse(self):...\n",
"self.assertFalse(zf._allowZip64)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_0.route('/user_view')...\n",
"VAR_7 = get_db()\n",
"VAR_8 = VAR_2.split('.')[0]\n",
"VAR_9 = VAR_2.split('.')[1]\n",
"VAR_10 = 'string'.format(VAR_9)\n",
"VAR_11 = VAR_7.execute(VAR_10, (VAR_8,)).fetchall()\n",
"return render_template('admin/userview.html', VAR_11=users, VAR_2='{}.{}'.\n format... | [
"@bp.route('/user_view')...\n",
"db = get_db()\n",
"sortBy = sort.split('.')[0]\n",
"sortOrder = sort.split('.')[1]\n",
"query = (\n 'SELECT * FROM user AS u LEFT OUTER JOIN (SELECT uid, count(uid) AS follower FROM follows GROUP BY uid) AS f ON u.id = f.uid ORDER BY ? {}'\n .format(sortOrder))\n",
"... | [
0,
0,
0,
0,
4,
4,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_0(self, VAR_0, VAR_1, VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = VAR_3.pop('kbsite_name', None)\n",
"if not VAR_6:\n",
"VAR_6 = 'default'\n",
"VAR_0.kbsite = models.KegbotSite.objects.get(name=kbsite_name)\n",
"return None\n"
] | [
"def process_view(self, request, view_func, view_args, view_kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"kbsite_name = view_kwargs.pop('kbsite_name', None)\n",
"if not kbsite_name:\n",
"kbsite_name = 'default'\n",
"request.kbsite = models.KegbotSite.objects.get(name=kbsite_name)\n",
"return None\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_7, VAR_8, VAR_9, VAR_10=None, VAR_4=None):...\n",
"GenericRequest.__init__(self, VAR_1, VAR_4)\n",
"self.url = '%stasks/%s/submit' % (self.base_url, VAR_7[1])\n",
"self.task = VAR_7\n",
"self.submission_format = VAR_8\n",
"self.filenames = VAR_9\n",
"self.data = {}\n",
"... | [
"def __init__(self, browser, task, submission_format, filenames, language=...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.url = '%stasks/%s/submit' % (self.base_url, task[1])\n",
"self.task = task\n",
"self.submission_format = submission_format\n",
"self.filenames = filenames\n",
"se... | [
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_22(VAR_37):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_64 = {}\n",
"for VAR_95, info in iteritems(VAR_37):\n",
"if not VAR_95.nostandalone:\n",
"return VAR_64\n",
"VAR_64[VAR_95] = info\n"
] | [
"def clean_before_output(kw_matches):...\n",
"\"\"\"docstring\"\"\"\n",
"filtered_kw_matches = {}\n",
"for kw_match, info in iteritems(kw_matches):\n",
"if not kw_match.nostandalone:\n",
"return filtered_kw_matches\n",
"filtered_kw_matches[kw_match] = info\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_7):...\n",
"return self._job_text[VAR_7]\n"
] | [
"def copy_text(self, job_id):...\n",
"return self._job_text[job_id]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_20(VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = os.path.normpath(VAR_8)\n",
"VAR_33 = re.search('{[^{]', VAR_8)\n",
"VAR_34 = os.path.dirname(VAR_8[:VAR_33.start()]\n ) if VAR_33 else os.path.dirname(VAR_8)\n",
"if not VAR_34:\n",
"VAR_34 = '.'\n",
"VAR_35 = [VAR_29.group('name') fo... | [
"def glob_wildcards(pattern):...\n",
"\"\"\"docstring\"\"\"\n",
"pattern = os.path.normpath(pattern)\n",
"first_wildcard = re.search('{[^{]', pattern)\n",
"dirname = os.path.dirname(pattern[:first_wildcard.start()]\n ) if first_wildcard else os.path.dirname(pattern)\n",
"if not dirname:\n",
"dirname ... | [
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",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"Expr'"
] |
[
"def __init__(self, VAR_7, VAR_67=(), *VAR_15, **VAR_16):...\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n",
"self.options = VAR_67\n"
] | [
"def __init__(self, param, options=(), *a, **kw):...\n",
"Validator.__init__(self, param, *a, **kw)\n",
"self.options = options\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def __init__(self, VAR_9, VAR_12):...\n",
"self._splitpath = fs.split_path(VAR_9)\n",
"self._lensplitpath = len(self._splitpath)\n",
"self._store = {}\n",
"self._ds = VAR_12\n"
] | [
"def __init__(self, targetpath, client):...\n",
"self._splitpath = fs.split_path(targetpath)\n",
"self._lensplitpath = len(self._splitpath)\n",
"self._store = {}\n",
"self._ds = client\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_0, *VAR_2, **VAR_3):...\n",
"VAR_11 = JustURLForm(VAR_0.POST or None)\n",
"if VAR_11.is_valid():\n",
"VAR_18 = VAR_11.cleaned_data['input_url']\n",
"return render(VAR_0, 'home.html', {'form': VAR_11})\n",
"VAR_21 = VAR_11.cleaned_data['short_url']\n",
"VAR_19 = VAR_11.cleaned_data[... | [
"def post(self, request, *args, **kwargs):...\n",
"form = JustURLForm(request.POST or None)\n",
"if form.is_valid():\n",
"url = form.cleaned_data['input_url']\n",
"return render(request, 'home.html', {'form': form})\n",
"short_url = form.cleaned_data['short_url']\n",
"category = form.cleaned_data['categ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_6, VAR_7=None, VAR_8=None, VAR_9=None):...\n",
"self._conn = VAR_6\n",
"self._url_prefix = VAR_7 or ''\n",
"self._default_headers = VAR_8 or {}\n"
] | [
"def __init__(self, connection, url_prefix=None, default_headers=None,...\n",
"self._conn = connection\n",
"self._url_prefix = url_prefix or ''\n",
"self._default_headers = default_headers or {}\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"VAR_5 = [{'application': self.TEST_APP, 'stack': self.TEST_STACK,\n 'credentials': self.bindings['GCE_CREDENTIALS'], 'loadBalancers': [self\n .__lb_name], 'targetSize': 1, 'capacity': {'min': 1, 'max': 1,\n 'desired': 1}, 'zone': self.TEST_ZONE, 'network': 'default',\n 'inst... | [
"def clone_server_group(self):...\n",
"job = [{'application': self.TEST_APP, 'stack': self.TEST_STACK,\n 'credentials': self.bindings['GCE_CREDENTIALS'], 'loadBalancers': [self\n .__lb_name], 'targetSize': 1, 'capacity': {'min': 1, 'max': 1,\n 'desired': 1}, 'zone': self.TEST_ZONE, 'network': 'default',\... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return User.get_all_users(VAR_12)\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return User.get_all_users(query)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_17(self):...\n",
"return self.get('__islocal')\n"
] | [
"def is_new(self):...\n",
"return self.get('__islocal')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_18, VAR_20, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_36 = VAR_3 if VAR_18 else VAR_2\n",
"return len(VAR_18) >= VAR_1 or VAR_20 - VAR_21 > VAR_36\n"
] | [
"def should_post_update(stdout, now, last_packet):...\n",
"\"\"\"docstring\"\"\"\n",
"packet_interval = MIN_PACKET_INTERNAL if stdout else MAX_PACKET_INTERVAL\n",
"return len(stdout) >= MAX_CHUNK_SIZE or now - last_packet > packet_interval\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_6):...\n",
"self.logger = VAR_6.bind(context=type(self).__name__)\n"
] | [
"def __init__(self, logger):...\n",
"self.logger = logger.bind(context=type(self).__name__)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_0(VAR_2, VAR_3, VAR_4, VAR_5=None):...\n",
"VAR_13 = VAR_2\n",
"if isinstance(VAR_13, str):\n",
"VAR_13 = [VAR_13]\n",
"for istr in VAR_13:\n",
"if not VAR_5:\n",
"exec(istr)\n",
"if isinstance(VAR_2, str):\n",
"if sys.version_info[0] == 2:\n",
"return\n",
"VAR_5 = \"Failed '%s'.\" % V... | [
"def check_import(imports, py2pkgs, py3pkgs, message=None):...\n",
"import_group = imports\n",
"if isinstance(import_group, str):\n",
"import_group = [import_group]\n",
"for istr in import_group:\n",
"if not message:\n",
"exec(istr)\n",
"if isinstance(imports, str):\n",
"if sys.version_info[0] == 2:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"For",
"Condition",
"Expr'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = VAR_5[:]\n",
"for request in VAR_5:\n",
"self.assertEqual(tuple, request.__class__)\n",
"self.assertEqual([], self._requests)\n",
"self.assertIn(len(request), (3, 4))\n",
"self._requests = VAR_5\n"
] | [
"def expected_requests(self, requests):...\n",
"\"\"\"docstring\"\"\"\n",
"requests = requests[:]\n",
"for request in requests:\n",
"self.assertEqual(tuple, request.__class__)\n",
"self.assertEqual([], self._requests)\n",
"self.assertIn(len(request), (3, 4))\n",
"self._requests = requests\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_19(VAR_5):...\n",
"VAR_8 = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"VAR_9 = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"VAR_42 = VAR_5.get('fork_fullname')\n",
"for VAR_47, new_file in VAR_5['results'].items():\n",
"VAR_10 = 'https://api.github.com/repos/{}/c... | [
"def commit(data):...\n",
"headers = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"auth = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"fullname = data.get('fork_fullname')\n",
"for file, new_file in data['results'].items():\n",
"url = 'https://api.github.com/repos/{}/content... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"import time\n",
"VAR_0 = 'pos.open.statement'\n",
"VAR_1 = 'Open Statements'\n",
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = []\n",
"VAR_7 = self.pool.get('ir.model.data')\n",
"VAR_8 = self.p... | [
"from osv import osv\n",
"from tools.translate import _\n",
"import time\n",
"_name = 'pos.open.statement'\n",
"_description = 'Open Statements'\n",
"def open_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'... |
[
"def FUNC_2(VAR_7=None, VAR_8=0, VAR_9=0):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_7 is None:\n",
"return True\n",
"return False\n",
"VAR_21 = re.match('^([^;]+)(; length=([0-9]+))?$', VAR_7, re.IGNORECASE)\n",
"VAR_22 = parse_http_date(VAR_21.group(1))\n",
"VAR_23 = VAR_21.group(3)\n",
"if VAR_23... | [
"def was_modified_since(header=None, mtime=0, size=0):...\n",
"\"\"\"docstring\"\"\"\n",
"if header is None:\n",
"return True\n",
"return False\n",
"matches = re.match('^([^;]+)(; length=([0-9]+))?$', header, re.IGNORECASE)\n",
"header_mtime = parse_http_date(matches.group(1))\n",
"header_len = matche... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition"
] |
[
"def FUNC_17(self, VAR_2, VAR_3, VAR_4, *VAR_5):...\n",
"self.write_data({'type': 'market_transaction_complete', 'event': VAR_5[0]})\n"
] | [
"def on_market_transaction_complete(self, subject, changetype, objectID, *args):...\n",
"self.write_data({'type': 'market_transaction_complete', 'event': args[0]})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_3, VAR_4):...\n",
"if not VAR_4.is_course_staff:\n",
"VAR_8 = VAR_4.module\n",
"return True\n",
"return self.has_object_permission(VAR_3, VAR_4, VAR_8)\n"
] | [
"def has_permission(self, request, view):...\n",
"if not view.is_course_staff:\n",
"module = view.module\n",
"return True\n",
"return self.has_object_permission(request, view, module)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return set(VAR_28 for VAR_28 in self.input if not VAR_28.exists and not \n VAR_28 in self.subworkflow_input)\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return set(f for f in self.input if not f.exists and not f in self.\n subworkflow_input)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_36(VAR_11):...\n",
"for VAR_51, VAR_58 in VAR_11.items():\n",
"if isinstance(VAR_58, str) or not isinstance(VAR_58, Iterable):\n",
"VAR_58 = [VAR_58]\n",
"yield [(VAR_51, VAR_16) for VAR_16 in VAR_58]\n"
] | [
"def flatten(wildcards):...\n",
"for wildcard, values in wildcards.items():\n",
"if isinstance(values, str) or not isinstance(values, Iterable):\n",
"values = [values]\n",
"yield [(wildcard, value) for value in values]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_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_5(self):...\n",
"VAR_28 = self.state.client_table()\n",
"self.local_scheduler_id_to_ip_map = {}\n",
"for local_scheduler_info in VAR_28:\n",
"VAR_36 = local_scheduler_info.get('DBClientID') or local_scheduler_info[\n 'ClientID']\n",
"VAR_44 = (local_scheduler_info.get('AuxAddress') or local_s... | [
"def update_local_scheduler_map(self):...\n",
"local_schedulers = self.state.client_table()\n",
"self.local_scheduler_id_to_ip_map = {}\n",
"for local_scheduler_info in local_schedulers:\n",
"client_id = local_scheduler_info.get('DBClientID') or local_scheduler_info[\n 'ClientID']\n",
"ip_address = (lo... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@property...\n",
"return 'saml'\n"
] | [
"@property...\n",
"return 'saml'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_1(VAR_2, VAR_3, VAR_4, VAR_5=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = []\n",
"VAR_8 = False\n",
"VAR_9 = os.path.join(VAR_2, VAR_4)\n",
"if VAR_5:\n",
"VAR_13 = file_to_read.read()\n",
"for line in file_to_read:\n",
"if VAR_3 in VAR_13:\n",
"if VAR_3 in line:\n",
"if VAR_8:\n... | [
"def change_import_path(directory, module, src_file, dry_run=False):...\n",
"\"\"\"docstring\"\"\"\n",
"new_lines = []\n",
"module_present = False\n",
"current_file = os.path.join(directory, src_file)\n",
"if dry_run:\n",
"containt = file_to_read.read()\n",
"for line in file_to_read:\n",
"if module ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"For",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Expr'",
"For",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_31():...\n",
"VAR_24 = vim.eval('tagfiles()')\n",
"VAR_25 = VAR_0.getcwd()\n",
"return [VAR_0.path.join(VAR_25, x) for x in VAR_24]\n"
] | [
"def GetTagFiles():...\n",
"tag_files = vim.eval('tagfiles()')\n",
"current_working_directory = os.getcwd()\n",
"return [os.path.join(current_working_directory, x) for x in tag_files]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"import json\n",
"from django.contrib.postgres import lookups\n",
"from django.contrib.postgres.forms import SimpleArrayField\n",
"from django.contrib.postgres.validators import ArrayMaxLengthValidator\n",
"from django.core import checks, exceptions\n",
"from django.db.models import Field, IntegerField, T... | [
"import json\n",
"from django.contrib.postgres import lookups\n",
"from django.contrib.postgres.forms import SimpleArrayField\n",
"from django.contrib.postgres.validators import ArrayMaxLengthValidator\n",
"from django.core import checks, exceptions\n",
"from django.db.models import Field, IntegerField, T... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Conditio... |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._icon\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._icon\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_20, VAR_21):...\n",
"self.message = VAR_21\n",
"self.code = VAR_20\n"
] | [
"def __init__(self, code, message):...\n",
"self.message = message\n",
"self.code = code\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_40, VAR_41):...\n",
"VAR_77, VAR_47, VAR_78 = VAR_40.partition(VAR_41)\n",
"if VAR_47 != VAR_41:\n",
"if VAR_78.startswith('^'):\n",
"return int(VAR_40), 0\n",
"VAR_78 = VAR_78[1:].replace('{', '').replace('}', '')\n",
"VAR_78 = ''.join(map(lambda x: self.supunmap.get(x, x), VAR_78... | [
"def _parse_coeff(self, cstr, var):...\n",
"coefficient, _, exponent = cstr.partition(var)\n",
"if _ != var:\n",
"if exponent.startswith('^'):\n",
"return int(cstr), 0\n",
"exponent = exponent[1:].replace('{', '').replace('}', '')\n",
"exponent = ''.join(map(lambda x: self.supunmap.get(x, x), exponent))... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self, VAR_3, VAR_5, VAR_6):...\n",
"VAR_13 = VAR_5.enrollment_audience\n",
"VAR_14 = VAR_6.userprofile.is_external\n",
"VAR_15 = VAR_5.ENROLLMENT_AUDIENCE\n",
"if VAR_13 == VAR_15.INTERNAL_USERS and VAR_14:\n",
"self.error_msg(_('This course is only for internal students.'))\n",
"if VAR_13 =... | [
"def enrollment_audience_check(self, request, course, user):...\n",
"audience = course.enrollment_audience\n",
"external = user.userprofile.is_external\n",
"EA = course.ENROLLMENT_AUDIENCE\n",
"if audience == EA.INTERNAL_USERS and external:\n",
"self.error_msg(_('This course is only for internal students.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"from __future__ import unicode_literals, print_function, division\n",
"import logging\n",
"import argparse\n",
"from jinja2.loaders import FileSystemLoader\n",
"from veil.frontend.template import *\n",
"from veil.frontend.cli import *\n",
"from veil.environment import *\n",
"from veil.environment.set... | [
"from __future__ import unicode_literals, print_function, division\n",
"import logging\n",
"import argparse\n",
"from jinja2.loaders import FileSystemLoader\n",
"from veil.frontend.template import *\n",
"from veil.frontend.cli import *\n",
"from veil.environment import *\n",
"from veil.environment.set... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"Ex... |
[
"def FUNC_1(VAR_6, VAR_7, VAR_8):...\n",
"VAR_8.debug('Running component check for %s' % VAR_6['name'])\n",
"VAR_33 = len(VAR_6['cmd']) > 1 and 'check' in VAR_6['cmd'][1]\n",
"VAR_9 = FUNC_6(VAR_7, VAR_6['name'])\n",
"if VAR_9:\n",
"VAR_56 = FUNC_2(VAR_9)\n",
"VAR_8.debug('%s window is not running. Runn... | [
"def check_component(comp, session, logger):...\n",
"logger.debug('Running component check for %s' % comp['name'])\n",
"check_available = len(comp['cmd']) > 1 and 'check' in comp['cmd'][1]\n",
"window = find_window(session, comp['name'])\n",
"if window:\n",
"pid = get_window_pid(window)\n",
"logger.debu... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"For",
"Return'",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
... |
[
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import os\n",
"import sys\n",
"import base64\n",
"import json\n",
"from collections import defaultdict\n",
"from itertools import chain\... | [
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import os\n",
"import sys\n",
"import base64\n",
"import json\n",
"from collections import defaultdict\n",
"from itertools import chain\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self, VAR_3):...\n",
"if VAR_3.name in self.host_names:\n",
"self.hosts.remove(VAR_3)\n",
"self._hosts.remove(VAR_3.name)\n",
"VAR_3.remove_group(self)\n",
"self.clear_hosts_cache()\n"
] | [
"def remove_host(self, host):...\n",
"if host.name in self.host_names:\n",
"self.hosts.remove(host)\n",
"self._hosts.remove(host.name)\n",
"host.remove_group(self)\n",
"self.clear_hosts_cache()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"return '-Dfile.encoding=UTF-8', '-Dzinc.analysis.cache.limit=1000', '-Djava.awt.headless=true', '-Xmx2g'\n"
] | [
"@classmethod...\n",
"return '-Dfile.encoding=UTF-8', '-Dzinc.analysis.cache.limit=1000', '-Djava.awt.headless=true', '-Xmx2g'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"self.client = Client()\n",
"self.user = User(username='testUser')\n",
"self.user.set_password('testPassword')\n",
"self.user.save()\n",
"self.grader = User(username='grader', is_staff=True)\n",
"self.grader.set_password('graderPassword')\n",
"self.grader.save()\n",
"self.s... | [
"def setUp(self):...\n",
"self.client = Client()\n",
"self.user = User(username='testUser')\n",
"self.user.set_password('testPassword')\n",
"self.user.save()\n",
"self.grader = User(username='grader', is_staff=True)\n",
"self.grader.set_password('graderPassword')\n",
"self.grader.save()\n",
"self.su... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_8(self, VAR_9, VAR_12, VAR_13, VAR_6, VAR_4):...\n",
"VAR_21 = generate_password_hash(VAR_4)\n",
"VAR_14 = (\n \"INSERT INTO `testdb`.`user` (`ID`, `FName`, `LName`, `Email`, `Pass`, `Role`) VALUES ('\"\n + VAR_9 + \"', '\" + VAR_12 + \"', '\" + VAR_13 + \"', '\" + VAR_6 + \"', '\" +\n VAR_2... | [
"def create_basic_user(self, userID, fName, lName, email, password):...\n",
"password2 = generate_password_hash(password)\n",
"query = (\n \"INSERT INTO `testdb`.`user` (`ID`, `FName`, `LName`, `Email`, `Pass`, `Role`) VALUES ('\"\n + userID + \"', '\" + fName + \"', '\" + lName + \"', '\" + email + \"',... | [
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_28(VAR_13):...\n",
"self.assertEqual('/request', VAR_13.path)\n",
"VAR_12.append('applicable')\n",
"return VAR_5\n"
] | [
"def applicable(request):...\n",
"self.assertEqual('/request', request.path)\n",
"calls.append('applicable')\n",
"return ident\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = CLASS_3(VAR_1)\n",
"VAR_30 = CLASS_4(VAR_17)\n",
"VAR_31 = VAR_30.parse()\n",
"if VAR_31:\n",
"VAR_31.execute(self.builtins)\n",
"VAR_31.wait()\n"
] | [
"def execute(self, raw):...\n",
"\"\"\"docstring\"\"\"\n",
"tokens = Tokenizer(raw)\n",
"parser = Parser(tokens)\n",
"root = parser.parse()\n",
"if root:\n",
"root.execute(self.builtins)\n",
"root.wait()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"for VAR_5 in self.groups:\n",
"self.add_group(VAR_5)\n"
] | [
"def populate_ancestors(self):...\n",
"for group in self.groups:\n",
"self.add_group(group)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_9(self, VAR_9, VAR_11=None):...\n",
"VAR_1 = get_and_check_project(VAR_9, VAR_11, ('change_project',))\n",
"VAR_27 = [VAR_35 for filesList in map(lambda key: VAR_9.FILES.getlist(key),\n [keys for keys in VAR_9.FILES]) for VAR_35 in filesList]\n",
"VAR_28 = models.Task.create_from_images(VAR_27, V... | [
"def create(self, request, project_pk=None):...\n",
"project = get_and_check_project(request, project_pk, ('change_project',))\n",
"files = [file for filesList in map(lambda key: request.FILES.getlist(key),\n [keys for keys in request.FILES]) for file in filesList]\n",
"task = models.Task.create_from_image... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_28(VAR_24):...\n",
"VAR_33.append(VAR_24)\n",
"return 23\n"
] | [
"def exec_python(args):...\n",
"calls.append(args)\n",
"return 23\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@Throttle(VAR_4)...\n",
"\"\"\"docstring\"\"\"\n",
"import pyatmo\n",
"self.station_data = pyatmo.WeatherStationData(self.auth)\n",
"if self.station is not None:\n",
"self.data = self.station_data.lastData(VAR_19=self.station, exclude=3600)\n",
"self.data = self.station_data.lastData(exclude=3600)\n"
] | [
"@Throttle(MIN_TIME_BETWEEN_UPDATES)...\n",
"\"\"\"docstring\"\"\"\n",
"import pyatmo\n",
"self.station_data = pyatmo.WeatherStationData(self.auth)\n",
"if self.station is not None:\n",
"self.data = self.station_data.lastData(station=self.station, exclude=3600)\n",
"self.data = self.station_data.lastDat... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Import'",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.