lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@property...\n", "return import_from_settings('LOGIN_REDIRECT_URL_FAILURE', '/')\n" ]
[ "@property...\n", "return import_from_settings('LOGIN_REDIRECT_URL_FAILURE', '/')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_2(VAR_1):...\n", "FUNC_0()\n", "FUNC_1()\n", "VAR_1.add_cog(CLASS_0(VAR_1))\n" ]
[ "def setup(bot):...\n", "check_folders()\n", "check_files()\n", "bot.add_cog(Database(bot))\n" ]
[ 0, 0, 0, 2 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "import socket\n", "import sys\n", "import re\n", "import os\n", "from _thread import *\n", "from subprocess import Popen, PIPE\n", "VAR_0 = ''\n", "VAR_1 = 4949\n", "VAR_2 = '0.1.0'\n", "VAR_3 = 'utf-8'\n", "VAR_4 = '\\n'\n", "VAR_5 = os.getcwd() + '\\\\plugins'\n", "VAR_6 = socket.socket(s...
[ "import socket\n", "import sys\n", "import re\n", "import os\n", "from _thread import *\n", "from subprocess import Popen, PIPE\n", "HOST = ''\n", "PORT = 4949\n", "VERSION = '0.1.0'\n", "ENCODING = 'utf-8'\n", "LINEBREAK = '\\n'\n", "PLUGINPATH = os.getcwd() + '\\\\plugins'\n", "s = socket....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "FunctionDef'", "Return'" ]
[ "def FUNC_7(self):...\n", "VAR_2 = CLASS_1.construct_testscript_command('test_input_program.py')\n", "VAR_3, VAR_4 = run_shell_command(VAR_2, '1 4 10 22')\n", "self.assertEqual(VAR_3, '37\\n')\n", "self.assertEqual(VAR_4, '')\n", "VAR_3, VAR_4 = run_shell_command(VAR_2, '1 p 5')\n", "self.assertEqual...
[ "def test_run_shell_command_with_stdin(self):...\n", "command = RunShellCommandTest.construct_testscript_command(\n 'test_input_program.py')\n", "stdout, stderr = run_shell_command(command, '1 4 10 22')\n", "self.assertEqual(stdout, '37\\n')\n", "self.assertEqual(stderr, '')\n", "stdout, stderr = ru...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_6(self):...\n", "self.uut.gives_corrected = True\n", "VAR_1 = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a', 'b']))\n", "self.assertEqual((), VAR_1)\n", "VAR_1 = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a']))\n", "self.assertEqual(len(VAR_1), 1)\n" ]
[ "def test_gives_corrected(self):...\n", "self.uut.gives_corrected = True\n", "out = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a', 'b']))\n", "self.assertEqual((), out)\n", "out = tuple(self.uut.process_output(['a', 'b'], 'filename', ['a']))\n", "self.assertEqual(len(out), 1)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_2(self):...\n", "return shellutil.run('/usr/bin/bigstart restart sshd', VAR_8=False)\n" ]
[ "def restart_ssh_service(self):...\n", "return shellutil.run('/usr/bin/bigstart restart sshd', chk_err=False)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_3(VAR_10=None, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = VAR_10 or []\n", "VAR_4 = VAR_4 or []\n", "VAR_13 = hashlib.md5(str(time.time())).hexdigest()\n", "VAR_14 = []\n", "for VAR_18, VAR_9 in VAR_10:\n", "VAR_18 = FUNC_2(VAR_18)\n", "for VAR_18, VAR_19, VAR_9 in VAR_4:\n",...
[ "def EncodeMultipartFormData(fields=None, files=None):...\n", "\"\"\"docstring\"\"\"\n", "fields = fields or []\n", "files = files or []\n", "boundary = hashlib.md5(str(time.time())).hexdigest()\n", "body_list = []\n", "for key, value in fields:\n", "key = _ConvertToAscii(key)\n", "for key, filename...
[ 0, 0, 0, 0, 0, 0, 0, 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'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "For", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "AugAssign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'", "Expr'", "Expr'", "Expr'", "...
[ "def FUNC_3(VAR_7, VAR_8, VAR_9, VAR_10, VAR_11, VAR_12, VAR_13=None, VAR_14=32...\n", "\"\"\"docstring\"\"\"\n", "VAR_30, VAR_31 = VAR_11\n", "VAR_32 = glob.glob(os.path.join(VAR_7, VAR_9, VAR_10, VAR_8, '*.tif'))\n", "VAR_32 = FUNC_0(FUNC_1(VAR_32, VAR_4=decade_begin, VAR_5=decade_end, VAR_1=\n '_', VA...
[ "def get_metrics(base_path, variable, model, scenario, decade, mask,...\n", "\"\"\"docstring\"\"\"\n", "decade_begin, decade_end = decade\n", "modeled_files = glob.glob(os.path.join(base_path, model, scenario, variable,\n '*.tif'))\n", "modeled_files = sort_files(only_years(modeled_files, begin=decade_be...
[ 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'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'" ]
[ "def __hash__(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_36 = self.get_id()\n", "return VAR_36 is None and id(self._data) or hash((self._get_entity_type(),\n VAR_36))\n" ]
[ "def __hash__(self):...\n", "\"\"\"docstring\"\"\"\n", "data_id = self.get_id()\n", "return data_id is None and id(self._data) or hash((self._get_entity_type(),\n data_id))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_3(self):...\n", "VAR_4 = {'username': 'first', 'password': 'password', 'email':\n 'autotest@deis.io'}\n", "VAR_5 = '/api/auth/register'\n", "VAR_6 = self.client.post(VAR_5, json.dumps(VAR_4), content_type=\n 'application/json')\n", "self.assertEqual(VAR_6.status_code, 201)\n", "self.assert...
[ "def test_delete(self):...\n", "submit = {'username': 'first', 'password': 'password', 'email':\n 'autotest@deis.io'}\n", "url = '/api/auth/register'\n", "response = self.client.post(url, json.dumps(submit), content_type=\n 'application/json')\n", "self.assertEqual(response.status_code, 201)\n", "se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "import datetime\n", "import psycopg2\n", "def FUNC_0():...\n", "VAR_1 = psycopg2.connect('dbname=forum')\n", "VAR_2 = VAR_1.cursor()\n", "\"\"\"Return all posts from the 'database', most recent first.\"\"\"\n", "VAR_2.execute('SELECT time, content FROM posts order by time DESC')\n", "VAR_3 = ({'conte...
[ "import datetime\n", "import psycopg2\n", "def get_posts():...\n", "db = psycopg2.connect('dbname=forum')\n", "c = db.cursor()\n", "\"\"\"Return all posts from the 'database', most recent first.\"\"\"\n", "c.execute('SELECT time, content FROM posts order by time DESC')\n", "posts = ({'content': str(ro...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "super(CLASS_23, self).__init__(*VAR_6, **kwargs)\n", "if hasattr(self.instance, 'dsstox') and self.instance.dsstox is not None:\n", "self.fields['true_cas'] = forms.CharField(max_length=200)\n", "self.fields['true_cas'].initial = self.instance.dsstox.true_cas\n"...
[ "def __init__(self, *args, **kwargs):...\n", "super(ExtractedChemicalForm, self).__init__(*args, **kwargs)\n", "if hasattr(self.instance, 'dsstox') and self.instance.dsstox is not None:\n", "self.fields['true_cas'] = forms.CharField(max_length=200)\n", "self.fields['true_cas'].initial = self.instance.dsstox...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_38(self, VAR_40, VAR_41, VAR_42=None):...\n", "\"\"\"docstring\"\"\"\n", "self._names[VAR_40] = VAR_41, VAR_42\n", "if VAR_42 is None:\n", "setattr(self, VAR_40, self[VAR_41])\n", "setattr(self, VAR_40, CLASS_2(VAR_37=self[index:end]))\n" ]
[ "def set_name(self, name, index, end=None):...\n", "\"\"\"docstring\"\"\"\n", "self._names[name] = index, end\n", "if end is None:\n", "setattr(self, name, self[index])\n", "setattr(self, name, Namedlist(toclone=self[index:end]))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "from dataclasses import dataclass\n", "from typing import Optional, List, Union, Any, Tuple\n", "from . import db\n", "VAR_6: Optional[int]\n", "VAR_1: int\n", "content: str\n", "created_at: Optional[str] = None\n", "updated_at: Optional[str] = None\n", "def __json__(self, *VAR_8):...\n", "return...
[ "from dataclasses import dataclass\n", "from typing import Optional, List, Union, Any, Tuple\n", "from . import db\n", "note_id: Optional[int]\n", "user_id: int\n", "content: str\n", "created_at: Optional[str] = None\n", "updated_at: Optional[str] = None\n", "def __json__(self, *args):...\n", "ret...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "FunctionDef'", "Return'" ]
[ "@auth.route('/reset', methods=['GET', 'POST'])...\n", "if not current_user.is_anonymous:\n", "return redirect(url_for('main.index'))\n", "VAR_1 = PasswordResetRequestForm()\n", "if VAR_1.validate_on_submit():\n", "VAR_2 = User.query.filter_by(email=form.email.data).first()\n", "return render_template('...
[ "@auth.route('/reset', methods=['GET', 'POST'])...\n", "if not current_user.is_anonymous:\n", "return redirect(url_for('main.index'))\n", "form = PasswordResetRequestForm()\n", "if form.validate_on_submit():\n", "user = User.query.filter_by(email=form.email.data).first()\n", "return render_template('aut...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_23(VAR_6):...\n", "return FUNC_7(VAR_6, 'Expires', '-1')\n" ]
[ "def validate_expires(page):...\n", "return validate_security_header(page, 'Expires', '-1')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "FUNC_5(VAR_6)\n", "VAR_8 = FUNC_6(VAR_6)\n", "VAR_15 = FUNC_7(request.data, VAR_8)\n", "FUNC_8(VAR_15)\n", "if os.path.isfile('keys/%s/%s.key' % (VAR_6, VAR_15['name'])):\n", "f.write(VAR_15['key'])\n", "return 'Key successfully updated', VAR_2\...
[ "def updateKey(client):...\n", "\"\"\"docstring\"\"\"\n", "validateClient(client)\n", "client_pub_key = loadClientRSAKey(client)\n", "token_data = decodeRequestToken(request.data, client_pub_key)\n", "validateNewKeyData(token_data)\n", "if os.path.isfile('keys/%s/%s.key' % (client, token_data['name'])):...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_11(self, VAR_7, VAR_9):...\n", "if isinstance(VAR_9, list):\n", "for v in VAR_9:\n", "self.append(VAR_7, v)\n" ]
[ "def extend(self, key, value):...\n", "if isinstance(value, list):\n", "for v in value:\n", "self.append(key, v)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "For", "Expr'" ]
[ "def FUNC_6(self):...\n", "self.login()\n", "while True:\n", "VAR_29 = random.random()\n", "VAR_30 = random.choice(self.tasks)\n", "if VAR_29 < 0.1 and self.submissions_path is not None:\n", "self.do_step(SubmitRandomRequest(self.browser, VAR_30, VAR_10=self.base_url,\n VAR_11=self.submissions_path))...
[ "def act(self):...\n", "self.login()\n", "while True:\n", "choice = random.random()\n", "task = random.choice(self.tasks)\n", "if choice < 0.1 and self.submissions_path is not None:\n", "self.do_step(SubmitRandomRequest(self.browser, task, base_url=self.base_url,\n submissions_path=self.submissions_p...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4):...\n", "self.connection = psycopg2.connect(dbname=database, VAR_0=host, VAR_1=port,\n user=username, VAR_4=password)\n" ]
[ "def __init__(self, host, port, database, username, password):...\n", "self.connection = psycopg2.connect(dbname=database, host=host, port=port,\n user=username, password=password)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "from sqlalchemy.sql import text\n", "from .dbhelper import engine\n", "def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3=1, *VAR_4, **VAR_5):...\n", "self.user_id = VAR_0\n", "self.username = VAR_1\n", "self.hashed_password = VAR_2\n", "self.roll_id = VAR_3\n", "def FUNC_0(self):...\n", "return {'user_...
[ "from sqlalchemy.sql import text\n", "from .dbhelper import engine\n", "def __init__(self, user_id, username, hashed_password, roll_id=1, *args, **...\n", "self.user_id = user_id\n", "self.username = username\n", "self.hashed_password = hashed_password\n", "self.roll_id = roll_id\n", "def to_dict(self...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_3(VAR_0, VAR_3):...\n", "VAR_4 = VAR_0.cursor()\n", "VAR_5 = 'ALTER TABLE Presets DROP COLUMN id;'\n", "VAR_4.execute(VAR_5)\n", "VAR_5 = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n", "VAR_4.execute(VAR_5)\n", "VAR_6 = Table('Presets')\n",...
[ "def get_preset(conn, key):...\n", "cursor = conn.cursor()\n", "quer = 'ALTER TABLE Presets DROP COLUMN id;'\n", "cursor.execute(quer)\n", "quer = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n", "cursor.execute(quer)\n", "extable = Table('Presets')\n"...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 4, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "VAR_5 = [{'cloudProvider': 'gce', 'loadBalancerName': self.__lb_name,\n 'ipProtocol': 'TCP', 'portRange': '8080', 'provider': 'gce', 'stack':\n self.TEST_STACK, 'detail': 'frontend', 'credentials': self.bindings[\n 'GCE_CREDENTIALS'], 'region': self.TEST_REGION, 'listeners': [{...
[ "def create_load_balancer(self):...\n", "job = [{'cloudProvider': 'gce', 'loadBalancerName': self.__lb_name,\n 'ipProtocol': 'TCP', 'portRange': '8080', 'provider': 'gce', 'stack':\n self.TEST_STACK, 'detail': 'frontend', 'credentials': self.bindings[\n 'GCE_CREDENTIALS'], 'region': self.TEST_REGION, 'li...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_11(self, VAR_12=None, VAR_13=None):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_12 and not VAR_13:\n", "VAR_12, VAR_13 = self.model.rowCount() + 1, self.model.rowCount(\n ) + self.model.item_load_batch\n", "if self.filter_input and self.filter_input.text().lower():\n", "VAR_24 = self.filter...
[ "def load_torrents(self, start=None, end=None):...\n", "\"\"\"docstring\"\"\"\n", "if not start and not end:\n", "start, end = self.model.rowCount() + 1, self.model.rowCount(\n ) + self.model.item_load_batch\n", "if self.filter_input and self.filter_input.text().lower():\n", "filter_text = self.filter_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_0():...\n", "VAR_3 = 'data', 'data/database/'\n", "for folder in VAR_3:\n", "if not os.path.exists(folder):\n", "print('Creating ' + folder + ' folder...')\n", "os.makedirs(folder)\n" ]
[ "def check_folders():...\n", "folders = 'data', 'data/database/'\n", "for folder in folders:\n", "if not os.path.exists(folder):\n", "print('Creating ' + folder + ' folder...')\n", "os.makedirs(folder)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Expr'", "Expr'" ]
[ "@route('POST', '/-test/fail', VAR_1=website)...\n", "VAR_16 = get_http_argument('message')\n", "VAR_0.error(VAR_16)\n", "get_executing_test().error = VAR_16\n" ]
[ "@route('POST', '/-test/fail', website=website)...\n", "message = get_http_argument('message')\n", "LOGGER.error(message)\n", "get_executing_test().error = message\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_1(self):...\n", "VAR_11 = []\n", "VAR_11.append(self.options.directory + '/' + self.options.application)\n", "if self.options.files:\n", "for file_ in self.options.files:\n", "os.makedirs('campaign-data/' + str(self.campaign_data['id']) + '/dut-files')\n", "VAR_11.append(self.options.directory...
[ "def setup_campaign(self):...\n", "files = []\n", "files.append(self.options.directory + '/' + self.options.application)\n", "if self.options.files:\n", "for file_ in self.options.files:\n", "os.makedirs('campaign-data/' + str(self.campaign_data['id']) + '/dut-files')\n", "files.append(self.options.dire...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Condition", "For", "Expr'", "Expr'", "For", "Expr'", "Condition", "Assign'", "Expr'", "Expr'", "Condition", "Condition", "Expr'", "Expr'", "For", "Expr'", "Assign'", "Condition", "Expr'", "For", "Expr'", "Expr'", "Expr'", "Expr...
[ "import PathPlannerModule as PPM\n", "import math\n", "VAR_0 = PPM.PathPlanner()\n", "VAR_1 = 0, 0\n", "VAR_2 = 10000\n", "for angle in range(0, 360):\n", "VAR_3 = angle * math.pi / 180\n", "VAR_4 = int(round(math.sin(VAR_3) * VAR_2)), int(round(math.cos(VAR_3) * VAR_2)\n )\n", "print('end = ' + ...
[ "import PathPlannerModule as PPM\n", "import math\n", "pathPlanner = PPM.PathPlanner()\n", "origin = 0, 0\n", "r = 10000\n", "for angle in range(0, 360):\n", "ang = angle * math.pi / 180\n", "end = int(round(math.sin(ang) * r)), int(round(math.cos(ang) * r))\n", "print('end = ' + str(end))\n", "pa...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
[ "Import'", "Import'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_1(self, VAR_2, VAR_6, VAR_7, VAR_4, VAR_3):...\n", "if VAR_7:\n", "VAR_7 = float(VAR_7)\n", "VAR_7 = None\n", "setattr(VAR_2, VAR_6, VAR_7)\n" ]
[ "def parse_input(self, report, name, value, request, attribute):...\n", "if value:\n", "value = float(value)\n", "value = None\n", "setattr(report, name, value)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_6(self):...\n", "return self.connection_pool.closeCachedConnections()\n" ]
[ "def close_connections(self):...\n", "return self.connection_pool.closeCachedConnections()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = pq.backends.ClassicalSimulator(**self.filter_kwargs_for_backend(\n self.kwargs))\n", "self.eng = pq.MainEngine(VAR_18)\n", "super().reset()\n" ]
[ "def reset(self):...\n", "\"\"\"docstring\"\"\"\n", "backend = pq.backends.ClassicalSimulator(**self.filter_kwargs_for_backend(\n self.kwargs))\n", "self.eng = pq.MainEngine(backend)\n", "super().reset()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_24(VAR_25, VAR_23, *VAR_24):...\n", "if VAR_23 == 'on_after_task':\n", "VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n", "self.assertEqual(False, VAR_50)\n", "self.assertEqual(True, VAR_51)\n", "self.assertEqual({'pool': 'default'}, VAR_5)\n", "self.assertEqual(VAR_22, VAR_52)\n" ]
[ "def call_hook(_botobj, name, *args):...\n", "if name == 'on_after_task':\n", "failure, internal_failure, dimensions, summary = args\n", "self.assertEqual(False, failure)\n", "self.assertEqual(True, internal_failure)\n", "self.assertEqual({'pool': 'default'}, dimensions)\n", "self.assertEqual(result, su...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_33(self):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.norun = True\n", "return VAR_101\n" ]
[ "def norun(self):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.norun = True\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "@VAR_0.route('/<id>/reviews', methods=['GET'])...\n", "VAR_8 = FUNC_2()\n", "VAR_16 = ProductsRepository.get_product_reviews(VAR_5, VAR_8)\n", "VAR_17 = ProductsRepository.get_total_product_reviews(VAR_5)\n", "VAR_9 = ceil(VAR_17 / VAR_8['perPage'])\n", "return jsonify(VAR_16=product_reviews, VAR_17=tota...
[ "@products.route('/<id>/reviews', methods=['GET'])...\n", "filters = get_filters()\n", "product_reviews = ProductsRepository.get_product_reviews(id, filters)\n", "total_product_reviews = ProductsRepository.get_total_product_reviews(id)\n", "total_pages = ceil(total_product_reviews / filters['perPage'])\n", ...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def __eq__(self, VAR_1):...\n", "if not isinstance(VAR_1, CLASS_0):\n", "return False\n", "return self._uuid == VAR_1._uuid\n" ]
[ "def __eq__(self, other):...\n", "if not isinstance(other, Host):\n", "return False\n", "return self._uuid == other._uuid\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_4(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n" ]
[ "def test_filters_2(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters=[{'name': ['like', 'J%']}]))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = get_random_string(import_from_settings('OIDC_STATE_SIZE', 32))\n", "VAR_8 = import_from_settings('OIDC_REDIRECT_FIELD_NAME', 'next')\n", "VAR_9 = {'response_type': 'code', 'scope': 'openid', 'client_id': self.\n OIDC_RP_CLIENT_ID, 'redi...
[ "def get(self, request):...\n", "\"\"\"docstring\"\"\"\n", "state = get_random_string(import_from_settings('OIDC_STATE_SIZE', 32))\n", "redirect_field_name = import_from_settings('OIDC_REDIRECT_FIELD_NAME', 'next')\n", "params = {'response_type': 'code', 'scope': 'openid', 'client_id': self.\n OIDC_RP_CL...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "from collections import namedtuple\n", "from logging import getLogger\n", "from sqlalchemy import exc\n", "from .models import db, REQUIRED_MISC_SIGNATURES\n", "from .packet import get_number_required, get_misc_signatures\n", "VAR_0 = getLogger(__name__)\n", "def FUNC_0(VAR_1, VAR_2=False, VAR_3=False)...
[ "from collections import namedtuple\n", "from logging import getLogger\n", "from sqlalchemy import exc\n", "from .models import db, REQUIRED_MISC_SIGNATURES\n", "from .packet import get_number_required, get_misc_signatures\n", "LOGGER = getLogger(__name__)\n", "def current_packets(member, intro=False, o...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "For", "Expr'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "C...
[ "def FUNC_3(VAR_3):...\n", "" ]
[ "def chkuser(x):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_7(self, VAR_4):...\n", "self.wait_next()\n", "self.log.total += 1\n", "VAR_4.execute()\n", "print('Unhandled exception while executing the request: %s' % exc, file=sys\n .stderr)\n", "self.log.__dict__[VAR_4.outcome] += 1\n", "return\n", "self.log.total_time += VAR_4.duration\n", "self....
[ "def do_step(self, request):...\n", "self.wait_next()\n", "self.log.total += 1\n", "request.execute()\n", "print('Unhandled exception while executing the request: %s' % exc, file=sys\n .stderr)\n", "self.log.__dict__[request.outcome] += 1\n", "return\n", "self.log.total_time += request.duration\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "AugAssign'", "Expr'", "Expr'", "AugAssign'", "Return'", "AugAssign'", "Assign'", "Expr'" ]
[ "def __enter__(self):...\n", "return CLASS_0()\n" ]
[ "def __enter__(self):...\n", "return DBase()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_4(self, VAR_6=0, VAR_7=False):...\n", "def FUNC_8():...\n", "VAR_17 = False\n", "VAR_18 = 'campaign-data/' + str(self.campaign_data['id']) + '/results/' + str(\n self.result_data['id'])\n", "os.makedirs(VAR_18)\n", "VAR_19 = VAR_18 + '/' + self.campaign_data['output_file']\n", "VAR_20 = 'ca...
[ "def __monitor_execution(self, latent_faults=0, persistent_faults=False):...\n", "def check_output():...\n", "missing_output = False\n", "result_folder = 'campaign-data/' + str(self.campaign_data['id']\n ) + '/results/' + str(self.result_data['id'])\n", "os.makedirs(result_folder)\n", "output_location ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'", "Condition", "Condition", "Expr'", "Assign'", "Condition"...
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = set()\n", "for VAR_28, VAR_27 in zip(self.output, self.rule.output):\n", "if VAR_28 in self.dynamic_output:\n", "VAR_16 = defaultdict(list)\n", "for VAR_28, w in self.expand_dynamic(VAR_27, VAR_13=self.wildcards, VAR_14=\n", "for combination in VA...
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "combinations = set()\n", "for f, f_ in zip(self.output, self.rule.output):\n", "if f in self.dynamic_output:\n", "wildcards = defaultdict(list)\n", "for f, w in self.expand_dynamic(f_, restriction=self.wildcards, omit_value=\n", "for combination in combina...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "For", "Condition", "Assign'", "For", "For", "Expr'", "For", "Return'", "Expr'" ]
[ "from argparse import ArgumentParser\n", "from ply import lex, yacc\n", "import locale\n", "import traceback\n", "import sys\n", "import git\n", "import re\n", "import os\n", "def __init__(self, VAR_3, VAR_4):...\n", "self.tok = VAR_3\n", "self.txt = VAR_4\n", "def __init__(self, VAR_5, VAR_4)...
[ "from argparse import ArgumentParser\n", "from ply import lex, yacc\n", "import locale\n", "import traceback\n", "import sys\n", "import git\n", "import re\n", "import os\n", "def __init__(self, tok, txt):...\n", "self.tok = tok\n", "self.txt = txt\n", "def __init__(self, el, txt):...\n", "s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "A...
[ "def FUNC_27(VAR_8):...\n", "return '{}#{}'.format(VAR_7, VAR_8)\n" ]
[ "def u(string):...\n", "return '{}#{}'.format(uuid_str, string)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_31(VAR_62):...\n", "\"\"\"docstring\"\"\"\n", "VAR_84 = 0\n", "while VAR_62[VAR_84].isdigit():\n", "VAR_84 += 1\n", "if VAR_84 > 0:\n", "return int(VAR_62[:VAR_84])\n", "return 0\n" ]
[ "def _get_value_kw(kw):...\n", "\"\"\"docstring\"\"\"\n", "i = 0\n", "while kw[i].isdigit():\n", "i += 1\n", "if i > 0:\n", "return int(kw[:i])\n", "return 0\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "AugAssign'", "Condition", "Return'", "Return'" ]
[ "@rest_utils.ajax(data_required=True)...\n", "\"\"\"docstring\"\"\"\n", "if api.base.is_service_enabled(VAR_1, 'compute'):\n", "VAR_35 = quotas.get_disabled_quotas(VAR_1)\n", "VAR_46 = [quota for quota in quotas.NOVA_QUOTA_FIELDS if quota not in VAR_35]\n", "VAR_47 = {key: VAR_1.DATA.get(key, None) for ke...
[ "@rest_utils.ajax(data_required=True)...\n", "\"\"\"docstring\"\"\"\n", "if api.base.is_service_enabled(request, 'compute'):\n", "disabled_quotas = quotas.get_disabled_quotas(request)\n", "filtered_quotas = [quota for quota in quotas.NOVA_QUOTA_FIELDS if quota not in\n disabled_quotas]\n", "request_dat...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@functools.wraps(VAR_0)...\n", "if not self.request.headers.get('X-XSRF-Token-Request'):\n", "return VAR_0(self, *VAR_5, **kwargs)\n" ]
[ "@functools.wraps(f)...\n", "if not self.request.headers.get('X-XSRF-Token-Request'):\n", "return f(self, *args, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Condition", "Return'" ]
[ "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.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n", "VAR_9 = self.pool.get('account.bank.statement')\n", "VAR_10 = self.pool.get('ir....
[ "def open_statement(self, cr, uid, ids, context):...\n", "\"\"\"docstring\"\"\"\n", "list_statement = []\n", "mod_obj = self.pool.get('ir.model.data')\n", "company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n", "statement_obj = self.pool.get('account.bank.statement')\n", "sequenc...
[ 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 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", ...
[ "def __init__(self, VAR_1):...\n", "self.dim_x, self.dim_y = self.calc_dim(VAR_1)\n", "self.g_count, self.v_count, self.z_count = self.calc_monster_count(VAR_1)\n", "self.board = []\n", "self._init_board()\n", "self.generate_board(VAR_1)\n", "self.north_count, self.east_count, self.south_count, self.wes...
[ "def __init__(self, board_str):...\n", "self.dim_x, self.dim_y = self.calc_dim(board_str)\n", "self.g_count, self.v_count, self.z_count = self.calc_monster_count(board_str)\n", "self.board = []\n", "self._init_board()\n", "self.generate_board(board_str)\n", "self.north_count, self.east_count, self.south...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_4(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = self.request.get('url').strip()\n", "VAR_22 = buildbot.ParseBuildUrl(VAR_21)\n", "if not VAR_22:\n", "return {'data': {'success': False}}\n", "VAR_5, VAR_6, VAR_7 = VAR_22\n", "VAR_3 = int(self.request.get('status'))\n", "VAR_8 = self.re...
[ "def HandleGet(self):...\n", "\"\"\"docstring\"\"\"\n", "url = self.request.get('url').strip()\n", "build_info = buildbot.ParseBuildUrl(url)\n", "if not build_info:\n", "return {'data': {'success': False}}\n", "master_name, builder_name, build_number = build_info\n", "cl_status = int(self.request.get(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_8, VAR_9, VAR_10, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = VAR_8.components.netatmo\n", "VAR_13 = CLASS_1(VAR_12.NETATMO_AUTH, VAR_9.get(VAR_2, None))\n", "VAR_14 = []\n", "import pyatmo\n", "if VAR_1 in VAR_9:\n", "return None\n", "VAR_10(VAR_14, True)\n", "for VA...
[ "def setup_platform(hass, config, add_devices, discovery_info=None):...\n", "\"\"\"docstring\"\"\"\n", "netatmo = hass.components.netatmo\n", "data = NetAtmoData(netatmo.NETATMO_AUTH, config.get(CONF_STATION, None))\n", "dev = []\n", "import pyatmo\n", "if CONF_MODULES in config:\n", "return None\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Import'", "Condition", "Return'", "Expr'", "For", "For", "Condition", "For", "Expr'", "For", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "@classmethod...\n", "return [lambda _request: VAR_22]\n" ]
[ "@classmethod...\n", "return [lambda _request: peer_ident]\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_2(VAR_0):...\n", "VAR_3 = FUNC_0()\n", "VAR_4 = VAR_3.cursor()\n", "VAR_4.execute('TRUNCATE ' + VAR_0 + ';')\n", "VAR_3.commit()\n", "VAR_4.close()\n", "VAR_3.close()\n" ]
[ "def truncate(table):...\n", "co = connect()\n", "cu = co.cursor()\n", "cu.execute('TRUNCATE ' + table + ';')\n", "co.commit()\n", "cu.close()\n", "co.close()\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_4(VAR_9):...\n", "if VAR_9['exception']['TYPE'] == UnknownExtraConf.__name__:\n" ]
[ "def _RaiseExceptionForData(data):...\n", "if data['exception']['TYPE'] == UnknownExtraConf.__name__:\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_9(self):...\n", "VAR_25 = self.conn.tpl_mounts.render(this=self)\n", "self.reply(VAR_25.encode('utf-8'))\n" ]
[ "def tx_mounts(self):...\n", "html = self.conn.tpl_mounts.render(this=self)\n", "self.reply(html.encode('utf-8'))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@api.multi...\n", "\"\"\"docstring\"\"\"\n", "self.ensure_one()\n", "for VAR_12 in self:\n", "if not VAR_16 and VAR_14 == 'BULONFER':\n", "VAR_12.state = 'obsolete'\n", "VAR_12.state = 'sellable'\n", "return\n", "if not VAR_18:\n", "VAR_18 = datetime.today().strftime('%Y-%m-%d')\n", "self.inser...
[ "@api.multi...\n", "\"\"\"docstring\"\"\"\n", "self.ensure_one()\n", "for prod in self:\n", "if not cost and vendor_ref == 'BULONFER':\n", "prod.state = 'obsolete'\n", "prod.state = 'sellable'\n", "return\n", "if not date:\n", "date = datetime.today().strftime('%Y-%m-%d')\n", "self.insert_histor...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "For", "Condition", "Assign'", "Assign'", "Return'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_19(self):...\n", "self._diag_interface.OnCursorMoved()\n" ]
[ "def OnCursorMoved(self):...\n", "self._diag_interface.OnCursorMoved()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1():...\n", "VAR_13 = argparse.ArgumentParser(description='Stress tester for CMS')\n", "VAR_13.add_argument('-c', '--contest-id', action='store', type=int,\n required=True, help='ID of the contest to test against')\n", "VAR_13.add_argument('-n', '--actor-num', action='store', type=int, help=\n ...
[ "def main():...\n", "parser = argparse.ArgumentParser(description='Stress tester for CMS')\n", "parser.add_argument('-c', '--contest-id', action='store', type=int,\n required=True, help='ID of the contest to test against')\n", "parser.add_argument('-n', '--actor-num', action='store', type=int, help=\n '...
[ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Assert'", "Assign'", "Assert'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Return'", "Assign'", "A...
[ "def FUNC_13(self, VAR_15):...\n", "self.is_authenticated = True\n", "self.is_active = True\n", "self.is_anonymous = False\n", "self.username = VAR_15\n" ]
[ "def authenticate(self, username):...\n", "self.is_authenticated = True\n", "self.is_active = True\n", "self.is_anonymous = False\n", "self.username = username\n" ]
[ 0, 4, 4, 4, 4 ]
[ "FunctionDef'", "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'...
[ "from base import Field\n", "from primaryKeyField import PrimaryKeyField\n", "from referenceField import ReferenceField\n", "def __init__(self, VAR_0, VAR_1=None, VAR_2=None, VAR_3=False, VAR_4=False,...\n", "super(CLASS_0, self).__init__(*VAR_5, **kwargs)\n", "self.rel_model = VAR_0\n", "self.reference...
[ "from base import Field\n", "from primaryKeyField import PrimaryKeyField\n", "from referenceField import ReferenceField\n", "def __init__(self, rel_model, reference=None, related_name=None, on_delete=...\n", "super(ForeignKeyField, self).__init__(*args, **kwargs)\n", "self.rel_model = rel_model\n", "sel...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Fun...
[ "def FUNC_9(self):...\n", "VAR_5 = [{'loadBalancerName': self.__lb_name, 'networkLoadBalancerName':\n self.__lb_name, 'region': 'us-central1', 'type': 'deleteLoadBalancer',\n 'regions': ['us-central1'], 'credentials': self.bindings[\n 'GCE_CREDENTIALS'], 'cloudProvider': 'gce', 'user': 'integration-tests...
[ "def delete_load_balancer(self):...\n", "job = [{'loadBalancerName': self.__lb_name, 'networkLoadBalancerName': self\n .__lb_name, 'region': 'us-central1', 'type': 'deleteLoadBalancer',\n 'regions': ['us-central1'], 'credentials': self.bindings[\n 'GCE_CREDENTIALS'], 'cloudProvider': 'gce', 'user': 'inte...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "import cgi\n", "import os\n", "import http.cookies\n", "import funct\n", "import sql\n", "from jinja2 import Environment, FileSystemLoader\n", "VAR_0 = Environment(loader=FileSystemLoader('templates/'))\n", "VAR_1 = VAR_0.get_template('config.html')\n", "print('Content-type: text/html\\n')\n", "f...
[ "import cgi\n", "import os\n", "import http.cookies\n", "import funct\n", "import sql\n", "from jinja2 import Environment, FileSystemLoader\n", "env = Environment(loader=FileSystemLoader('templates/'))\n", "template = env.get_template('config.html')\n", "print('Content-type: text/html\\n')\n", "fu...
[ 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "ImportFrom'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", ...
[ "def FUNC_6(self):...\n", "for att in self._['tmpatts']:\n", "os.makedirs('file/%s' % att.key)\n", "os.rename('file/tmp/%s' % att.key, 'file/%s/%s' % (att.key, att.filename))\n", "VAR_29 = AttachmentList(key=att.key, VAR_6=self.ann_id, content_type=att.\n content_type, filename=att.filename)\n", "self....
[ "def parse_att(self):...\n", "for att in self._['tmpatts']:\n", "os.makedirs('file/%s' % att.key)\n", "os.rename('file/tmp/%s' % att.key, 'file/%s/%s' % (att.key, att.filename))\n", "new_att = AttachmentList(key=att.key, ann_id=self.ann_id, content_type=att.\n content_type, filename=att.filename)\n", "...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_14(self):...\n", "\"\"\"docstring\"\"\"\n", "if not FUNC_0(self.request.host):\n" ]
[ "def prepare(self):...\n", "\"\"\"docstring\"\"\"\n", "if not validate_host(self.request.host):\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition" ]
[ "def FUNC_3(VAR_6):...\n", "if VAR_6:\n", "return {'startDate': min(VAR_6).strftime('%Y-%m-%d %H:%M'), 'endDate': max(\n VAR_6).strftime('%Y-%m-%d %H:%M')}\n" ]
[ "def get_date_range(dates):...\n", "if dates:\n", "return {'startDate': min(dates).strftime('%Y-%m-%d %H:%M'), 'endDate': max(\n dates).strftime('%Y-%m-%d %H:%M')}\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_13(VAR_25, VAR_27):...\n", "" ]
[ "def get_renderer(view, method):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_8(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = {}\n", "VAR_5['volumeName'] = VAR_10['name']\n", "VAR_5['prompt'] = 'false'\n", "VAR_27 = self._cliq_get_volume_info(VAR_10['name'])\n", "VAR_0.error('Volume did not exist. It will not be deleted')\n", "self._cliq_run_xml('deleteVol...
[ "def delete_volume(self, volume):...\n", "\"\"\"docstring\"\"\"\n", "cliq_args = {}\n", "cliq_args['volumeName'] = volume['name']\n", "cliq_args['prompt'] = 'false'\n", "volume_info = self._cliq_get_volume_info(volume['name'])\n", "LOG.error('Volume did not exist. It will not be deleted')\n", "self._c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "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_2(self, VAR_2, VAR_4):...\n", "VAR_5 = getattr(VAR_4, self.obj_var, None)\n", "return VAR_5 is None or self.has_object_permission(VAR_2, VAR_4, VAR_5)\n" ]
[ "def has_permission(self, request, view):...\n", "obj = getattr(view, self.obj_var, None)\n", "return obj is None or self.has_object_permission(request, view, obj)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_12(self):...\n", "" ]
[ "def allow_dhcp_broadcast(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@api.require(lambda : True)...\n", "" ]
[ "@api.require(lambda : True)...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_0():...\n", "VAR_1 = User.objects.create_user(username='Karyn', password='specialP@55word')\n", "VAR_2 = User.objects.create_superuser(username='SuperKaryn', password=\n 'specialP@55word', email='me@epa.gov')\n", "VAR_3 = DataSource.objects.create(title='Data Source for Test',\n estimated_reco...
[ "def load_model_objects():...\n", "user = User.objects.create_user(username='Karyn', password='specialP@55word')\n", "superuser = User.objects.create_superuser(username='SuperKaryn', password=\n 'specialP@55word', email='me@epa.gov')\n", "ds = DataSource.objects.create(title='Data Source for Test',\n es...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_3(self, VAR_1, VAR_2, VAR_5, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "VAR_30 = VAR_4.get('states', [])\n", "VAR_31 = VAR_4.get('what', ())\n", "if not VAR_5:\n", "VAR_5 = self.search(VAR_1, VAR_2, [])\n", "VAR_29 = {}.fromkeys(VAR_5, 0.0)\n", ...
[ "def get_product_available(self, cr, uid, ids, context=None):...\n", "\"\"\"docstring\"\"\"\n", "if context is None:\n", "context = {}\n", "states = context.get('states', [])\n", "what = context.get('what', ())\n", "if not ids:\n", "ids = self.search(cr, uid, [])\n", "res = {}.fromkeys(ids, 0.0)\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Expr'", "Condition", "Assign'", "Expr'", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition"...
[ "def FUNC_8(self):...\n", "run_shell_command('super-cool-command', weird_parameter2='abc')\n", "run_shell_command('super-cool-command', universal_newlines=False)\n" ]
[ "def test_run_shell_command_kwargs_delegation(self):...\n", "run_shell_command('super-cool-command', weird_parameter2='abc')\n", "run_shell_command('super-cool-command', universal_newlines=False)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_6(self, VAR_29):...\n", "if VAR_29 is None:\n", "return VAR_101.user.pref_numsites\n", "return VAR_54(VAR_55(int(VAR_29), 1), 250)\n" ]
[ "def run(self, limit):...\n", "if limit is None:\n", "return c.user.pref_numsites\n", "return min(max(int(limit), 1), 250)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_6():...\n", "VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n" ]
[ "def _raise_exception():...\n", "frappe.throw(_('Invalid Search Field'), frappe.DataError)\n" ]
[ 0, 4 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_12(VAR_24):...\n", "VAR_38 = argparse.ArgumentParser(description=\n 'Reads and merges JSON configuration files specified by colon separated environment variable OS_CONFIG_FILES, unless overridden by command line option --metadata. If no files are specified this way, falls back to legacy behavior of s...
[ "def parse_opts(argv):...\n", "parser = argparse.ArgumentParser(description=\n 'Reads and merges JSON configuration files specified by colon separated environment variable OS_CONFIG_FILES, unless overridden by command line option --metadata. If no files are specified this way, falls back to legacy behavior of ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_8(self, VAR_14):...\n", "" ]
[ "def is_file(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_7(self):...\n", "VAR_1 = self.client.get('/qa/extractionscript/5', follow=True)\n", "VAR_1 = self.client.get('/qa/extractedtext/7', follow=True)\n" ]
[ "def test_approval(self):...\n", "response = self.client.get('/qa/extractionscript/5', follow=True)\n", "response = self.client.get('/qa/extractedtext/7', follow=True)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_6(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_3 = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n", "VAR_4 = 'fake_snap_name'\n", "self.driver._eql_execute('volume', 'select', VAR_3['volume_name'],\n 'snapshot', 'create-now').AndRetu...
[ "def test_create_snapshot(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n", "snap_name = 'fake_snap_name'\n", "self.driver._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "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'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "return FUNC_0(self.request, self.request.user)\n" ]
[ "def get_redirect_url(self):...\n", "\"\"\"docstring\"\"\"\n", "return find_nextlocation(self.request, self.request.user)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_11(self, VAR_14=None, VAR_15=False, VAR_16=False, VAR_17=1, VAR_18...\n", "self.global_resources = dict() if VAR_52 is None else VAR_52\n", "self.global_resources['_cores'] = VAR_17\n", "self.global_resources['_nodes'] = VAR_18\n", "def FUNC_2(VAR_87):...\n", "return map(self._rules.__getitem__,...
[ "def execute(self, targets=None, dryrun=False, touch=False, cores=1, nodes=1,...\n", "self.global_resources = dict() if resources is None else resources\n", "self.global_resources['_cores'] = cores\n", "self.global_resources['_nodes'] = nodes\n", "def rules(items):...\n", "return map(self._rules.__getitem...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_10(VAR_32, VAR_34):...\n", "logging.info('Got signal %s', VAR_32)\n" ]
[ "def handler(sig, _):...\n", "logging.info('Got signal %s', sig)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_33(VAR_57, VAR_22):...\n", "if not len(VAR_57):\n", "VAR_56.append('/%s' % ('/'.join(VAR_22),))\n", "if VAR_57[0] == '.':\n", "FUNC_33(VAR_57[1:], VAR_22)\n", "if VAR_57[0] == '..':\n", "FUNC_33(VAR_57[1:], VAR_22[:-1])\n", "VAR_65 = [x[VAR_1] for x in self.get_path('/'.join(VAR_22))]\n", ...
[ "def foo(p, cwd):...\n", "if not len(p):\n", "found.append('/%s' % ('/'.join(cwd),))\n", "if p[0] == '.':\n", "foo(p[1:], cwd)\n", "if p[0] == '..':\n", "foo(p[1:], cwd[:-1])\n", "names = [x[A_NAME] for x in self.get_path('/'.join(cwd))]\n", "matches = [x for x in names if fnmatch.fnmatchcase(x, p[0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "For", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "import os\n", "import unittest\n", "from mock import patch, call\n", "from test.test_support import EnvironmentVarGuard\n", "from paver.easy import BuildFailure\n", "from pavelib.utils.test.suites import BokChoyTestSuite, Pa11yCrawler\n", "VAR_0 = os.getcwd()\n", "\"\"\"\n ...
[ "\"\"\"\nTests for the bok-choy paver commands themselves.\nRun just this test with: paver test_lib -t pavelib/paver_tests/test_paver_bok_choy_cmds.py\n\"\"\"\n", "import os\n", "import unittest\n", "from mock import patch, call\n", "from test.test_support import EnvironmentVarGuard\n", "from paver.easy i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_0(self):...\n", "return self.get_serializer_class().setup_eager_loading(Action.objects.\n filter(published=True))\n" ]
[ "def get_queryset(self):...\n", "return self.get_serializer_class().setup_eager_loading(Action.objects.\n filter(published=True))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(self):...\n", "self.object.restart()\n", "return '/twitter_hunter'\n" ]
[ "def get_success_url(self):...\n", "self.object.restart()\n", "return '/twitter_hunter'\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_18(self, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = self.host.pkg_query(VAR_16)\n", "VAR_33 = self.run_command(VAR_6)\n", "if VAR_33['status'] == 0:\n", "return True\n", "return False\n" ]
[ "def is_installed(self, pkg):...\n", "\"\"\"docstring\"\"\"\n", "cmd = self.host.pkg_query(pkg)\n", "res = self.run_command(cmd)\n", "if res['status'] == 0:\n", "return True\n", "return False\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Return'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.delete_volume(VAR_7)\n", "self.common.client_logout()\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.delete_volume(volume)\n", "self.common.client_logout()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_25(self, VAR_11, VAR_28):...\n", "VAR_12 = \"ssh -t %s 'tmux kill-session -t %s'\" % (VAR_28, VAR_11)\n", "FUNC_7(self.session, VAR_12)\n" ]
[ "def kill_remote_session_by_name(self, name, host):...\n", "cmd = \"ssh -t %s 'tmux kill-session -t %s'\" % (host, name)\n", "send_main_session_command(self.session, cmd)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@permission_required('tournament.add_game')...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = get_modifiable_tournament_or_404(VAR_3, VAR_2.user)\n", "VAR_8 = FUNC_0(VAR_7, VAR_1)\n", "VAR_12 = VAR_8.roundplayer_set.count()\n", "VAR_13 = VAR_12 % 7\n", "if VAR_13 == 0:\n", "return HttpResponseRedirect(rever...
[ "@permission_required('tournament.add_game')...\n", "\"\"\"docstring\"\"\"\n", "t = get_modifiable_tournament_or_404(tournament_id, request.user)\n", "r = get_round_or_404(t, round_num)\n", "count = r.roundplayer_set.count()\n", "sitters = count % 7\n", "if sitters == 0:\n", "return HttpResponseRedire...
[ 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "For", "Assign'", "Assign'", "For", "Return'", "Expr'", "Assign'", "For", "Condition", "Assign'", "Return'", "Assign'", "Conditi...
[ "def FUNC_15(self):...\n", "self.mock(bot_main, 'post_error_task', lambda *VAR_24: self.fail(VAR_24))\n", "def FUNC_24(VAR_14, VAR_23, *VAR_24):...\n", "if VAR_23 == 'on_after_task':\n", "VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n", "self.mock(bot_main, 'call_hook', FUNC_24)\n", "self.assertEqual(self.att...
[ "def test_run_manifest(self):...\n", "self.mock(bot_main, 'post_error_task', lambda *args: self.fail(args))\n", "def call_hook(botobj, name, *args):...\n", "if name == 'on_after_task':\n", "failure, internal_failure, dimensions, summary = args\n", "self.mock(bot_main, 'call_hook', call_hook)\n", "self.a...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_26(VAR_8):...\n", "api.reset_local_state()\n", "return VAR_7.get('/request', extra_environ={'REMOTE_ADDR': ip}).body\n" ]
[ "def call(ip):...\n", "api.reset_local_state()\n", "return app.get('/request', extra_environ={'REMOTE_ADDR': ip}).body\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_3(self):...\n", "VAR_1 = '/api/apps'\n", "VAR_2 = self.client.post(VAR_1)\n", "self.assertEqual(VAR_2.status_code, 201)\n", "VAR_3 = VAR_2.data['id']\n", "VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n", "VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d...
[ "def test_start_chaos(self):...\n", "url = '/api/apps'\n", "response = self.client.post(url)\n", "self.assertEqual(response.status_code, 201)\n", "app_id = response.data['id']\n", "url = '/api/apps/{app_id}/builds'.format(**locals())\n", "body = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile':...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", ...
[ "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_19(self, VAR_20, VAR_24):...\n", "if self._connection is None:\n", "self._connection = self._engine.connect()\n", "return self._connection.execute(VAR_20, VAR_24)\n" ]
[ "def __execute(self, sql, bindings):...\n", "if self._connection is None:\n", "self._connection = self._engine.connect()\n", "return self._connection.execute(sql, bindings)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_1():...\n", "\"\"\"docstring\"\"\"\n", "VAR_9 = 'string'\n", "VAR_11 = get_cursor()\n", "VAR_13 = VAR_11.execute(VAR_9).fetchone()[0]\n", "return VAR_13\n" ]
[ "def get_all_books_count():...\n", "\"\"\"docstring\"\"\"\n", "stmt = \"\"\"\n select count(*) from books as b\n left outer join collaborations as c on c.book_id=b.id\n left outer join authors as a on a.id=c.author_id\n left join series as s on s.id=b.series_id\n \"\"\"\n", ...
[ 0, 0, 4, 0, 4, 4 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Return'" ]