lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "import psycopg2\n", "import datetime\n", "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = psycopg2.connect('dbname=forum')\n", "VAR_2 = VAR_1.cursor()\n", "VAR_2.execute('select content, time from posts order by time desc')\n", "VAR_3 = VAR_2.fetchall()\n", "VAR_1.close()\n", "return VAR...
[ "import psycopg2\n", "import datetime\n", "def get_posts():...\n", "\"\"\"docstring\"\"\"\n", "conn = psycopg2.connect('dbname=forum')\n", "cursor = conn.cursor()\n", "cursor.execute('select content, time from posts order by time desc')\n", "all_posts = cursor.fetchall()\n", "conn.close()\n", "ret...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def __eq__(self, VAR_35):...\n", "return self.__class__ == VAR_35.__class__ and self.name == VAR_35.name and self.type == VAR_35.type\n" ]
[ "def __eq__(self, other):...\n", "return self.__class__ == other.__class__ and self.name == other.name and self.type == other.type\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "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_10(self, VAR_5=False, VAR_6=False):...\n", "\"\"\"docstring\"\"\"\n", "assert self._raylet_socket_name is None\n", "self._raylet_socket_name = (self._ray_params.raylet_socket_name or\n get_raylet_socket_name())\n", "self.prepare_socket_file(self._raylet_socket_name)\n", "VAR_14, VAR_15 = new_...
[ "def start_raylet(self, use_valgrind=False, use_profiler=False):...\n", "\"\"\"docstring\"\"\"\n", "assert self._raylet_socket_name is None\n", "self._raylet_socket_name = (self._ray_params.raylet_socket_name or\n get_raylet_socket_name())\n", "self.prepare_socket_file(self._raylet_socket_name)\n", "st...
[ 0, 0, 0, 0, 0, 6, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assert'", "Assign'", "Expr'", "Assign'", "Assign'", "Assert'", "Assign'" ]
[ "def FUNC_17(*VAR_20, **VAR_7):...\n", "return DebugAdapter.start_wrapper_script(VAR_10, *VAR_20, **kwargs)\n" ]
[ "def start(*args, **kwargs):...\n", "return DebugAdapter.start_wrapper_script(script, *args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_7, VAR_14=errors.USER_DOESNT_EXIST, *VAR_15, **VAR_16):...\n", "CLASS_3.__init__(self, VAR_7, VAR_14, *VAR_15, **kw)\n" ]
[ "def __init__(self, param, error=errors.USER_DOESNT_EXIST, *a, **kw):...\n", "VRequired.__init__(self, param, error, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4(self, VAR_9=None):...\n", "if VAR_9 is None:\n", "VAR_9 = self\n", "VAR_21 = VAR_20.path.join(self.parlai_home, 'data')\n", "VAR_9.add_argument('-dp', '--datapath', default=default_data_path, help=\n 'path to datasets, defaults to {parlai_dir}/data')\n" ]
[ "def add_parlai_data_path(self, argument_group=None):...\n", "if argument_group is None:\n", "argument_group = self\n", "default_data_path = os.path.join(self.parlai_home, 'data')\n", "argument_group.add_argument('-dp', '--datapath', default=default_data_path,\n help='path to datasets, defaults to {parla...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed('string', VAR_2='EmuNAND Recommendation')\n" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed(\n \"If you want to set up an EmuNAND the first thing to know is that you probably don't need it; if you don't know what an EmuNAND is, you don't need one.\"\n , title='EmuNAND Recommendation')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "def FUNC_1(self):...\n", "return self.session.query(self.model)\n" ]
[ "def get_query(self):...\n", "return self.session.query(self.model)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_27(self, VAR_75):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.threads = VAR_75\n", "return VAR_101\n" ]
[ "def threads(self, threads):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.threads = threads\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "@VAR_0.route('/index', methods=['POST'])...\n", "print(request.form)\n", "VAR_9 = {}\n", "VAR_9['document_id'] = random.randint(1, 10000)\n", "VAR_9['pagerank'] = random.random()\n", "VAR_9['position'] = random.random()\n", "VAR_9['frequency'] = random.random()\n", "VAR_9['section'] = 'body'\n", "V...
[ "@app.route('/index', methods=['POST'])...\n", "print(request.form)\n", "spoofFeatures = {}\n", "spoofFeatures['document_id'] = random.randint(1, 10000)\n", "spoofFeatures['pagerank'] = random.random()\n", "spoofFeatures['position'] = random.random()\n", "spoofFeatures['frequency'] = random.random()\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def __init__(self):...\n", "self.login_url = VAR_1\n", "self.login_api = VAR_2\n", "self.login_data = VAR_3.copy()\n", "self.session = requests.session()\n", "self.session.headers = VAR_0.copy()\n", "self.session.cookies = cookiejar.LWPCookieJar(filename='./cookies.txt')\n" ]
[ "def __init__(self):...\n", "self.login_url = LOGIN_URL\n", "self.login_api = LOGIN_API\n", "self.login_data = FORM_DATA.copy()\n", "self.session = requests.session()\n", "self.session.headers = HEADERS.copy()\n", "self.session.cookies = cookiejar.LWPCookieJar(filename='./cookies.txt')\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(self, VAR_4, *VAR_5, **VAR_6):...\n", "VAR_12 = None\n", "VAR_13 = None\n", "VAR_14 = False\n", "VAR_15 = False\n", "VAR_16 = False\n", "VAR_17 = []\n", "VAR_18 = [self.profile]\n", "if self.exercise.is_submittable:\n", "VAR_27 = self.exercise.SUBMIT_STATUS\n", "if self.exercise.stat...
[ "def get(self, request, *args, **kwargs):...\n", "exercisecollection = None\n", "exercisecollection_title = None\n", "submission_allowed = False\n", "disable_submit = False\n", "should_enroll = False\n", "issues = []\n", "students = [self.profile]\n", "if self.exercise.is_submittable:\n", "SUBMIT_...
[ 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Condition...
[ "\"\"\"\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", "from django.test import TestCase\n", "from api.models import Key\n", "from api.utils import fingerprint\n", "VAR_0 = 'string'\n", "VAR_1...
[ "\"\"\"\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", "from django.test import TestCase\n", "from api.models import Key\n", "from api.utils import fingerprint\n", "RSA_PUBKEY = (\n 'ssh-rsa ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 5, 0, 0, 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 ]
[ "Expr'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Expr'", "Assign'", "FunctionDef'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "...
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = f.read().split('\\n')\n", "VAR_18 = VAR_17[4].split('=')[1].strip('\"')\n", "return VAR_18\n" ]
[ "def get_osversion():...\n", "\"\"\"docstring\"\"\"\n", "osfilecontent = f.read().split('\\n')\n", "version = osfilecontent[4].split('=')[1].strip('\"')\n", "return version\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_5(self, VAR_13, VAR_14=1):...\n", "utils.check_ssh_injection(VAR_13)\n", "VAR_11 = ' '.join(VAR_13)\n", "if not self.sshpool:\n", "VAR_39 = self.configuration.san_password\n", "VAR_43 = VAR_14\n", "VAR_0.error(_('Error running SSH command: %s') % VAR_11)\n", "VAR_40 = self.configuration.san_...
[ "def _run_ssh(self, cmd_list, attempts=1):...\n", "utils.check_ssh_injection(cmd_list)\n", "command = ' '.join(cmd_list)\n", "if not self.sshpool:\n", "password = self.configuration.san_password\n", "total_attempts = attempts\n", "LOG.error(_('Error running SSH command: %s') % command)\n", "privatekey...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "AugAssign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_16(self, VAR_2, VAR_3, VAR_4, VAR_26, VAR_6, VAR_7):...\n", "VAR_2.execute(\n 'SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id in %s GROUP BY task_id'\n , (tuple(VAR_4),))\n", "VAR_41 = dict(VAR_2.fetchall())\n", "VAR_34 = {}\n", "for VAR_23 in self.browse(VAR_2, ...
[ "def _hours_get(self, cr, uid, ids, field_names, args, context):...\n", "cr.execute(\n 'SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id in %s GROUP BY task_id'\n , (tuple(ids),))\n", "hours = dict(cr.fetchall())\n", "res = {}\n", "for task in self.browse(cr, uid, ids, conte...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_17(VAR_25):...\n", "\"\"\"docstring\"\"\"\n", "VAR_43 = subprocess.check_output(['vmstat', '-s'])\n", "VAR_25 = VAR_25.encode('ascii')\n", "for VAR_54 in VAR_43.split(b'\\n'):\n", "VAR_54 = VAR_54.strip()\n", "if VAR_25 in VAR_54:\n", "return int(VAR_54.split(b' ')[0])\n" ]
[ "def vmstat(stat):...\n", "\"\"\"docstring\"\"\"\n", "out = subprocess.check_output(['vmstat', '-s'])\n", "stat = stat.encode('ascii')\n", "for line in out.split(b'\\n'):\n", "line = line.strip()\n", "if stat in line:\n", "return int(line.split(b' ')[0])\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Assign'", "Condition", "Return'" ]
[ "def FUNC_23(VAR_31, VAR_32, VAR_3, VAR_33, VAR_34=apply_wildcards, VAR_35=None...\n", "for VAR_10, VAR_9 in VAR_32.allitems():\n", "VAR_48 = len(VAR_31)\n", "VAR_49 = True\n", "if callable(VAR_9):\n", "if not_iterable(VAR_9):\n", "VAR_9 = VAR_9(VAR_33)\n", "if not_iterable(VAR_9):\n", "VAR_9 = [VAR...
[ "def _apply_wildcards(newitems, olditems, wildcards, wildcards_obj,...\n", "for name, item in olditems.allitems():\n", "start = len(newitems)\n", "is_iterable = True\n", "if callable(item):\n", "if not_iterable(item):\n", "item = item(wildcards_obj)\n", "if not_iterable(item):\n", "item = [item]\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "For", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Assign'", "For", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Assig...
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed('string', VAR_2='How to clear Home Menu extdata')\n" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed(\n \"\"\"1. Navigate to the following folder on your SD card: `/Nintendo 3DS/(32 Character ID)/(32 Character ID)/extdata/00000000/`\n2. Delete the corresponding folder for your region:\n USA: `0000008f`\n EUR: `00000098`\n J...
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "def FUNC_17(self):...\n", "VAR_7 = [('x', 'y'), (1, 2)]\n", "VAR_8 = [('key', 'filename', 'file data')]\n", "VAR_9, VAR_10 = url_helper.EncodeMultipartFormData()\n", "self.assertTrue(VAR_9.startswith('multipart/form-data; boundary='))\n", "self.assertEqual('', VAR_10)\n", "VAR_9, VAR_10 = url_helper.En...
[ "def testEncodeMultipartFormData(self):...\n", "fields = [('x', 'y'), (1, 2)]\n", "files = [('key', 'filename', 'file data')]\n", "content_type, body = url_helper.EncodeMultipartFormData()\n", "self.assertTrue(content_type.startswith('multipart/form-data; boundary='))\n", "self.assertEqual('', body)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "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_4(self, VAR_14=VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "self.check_app_installed()\n", "self._do_start_app()\n", "for _ in range(VAR_14):\n", "time.sleep(1)\n", "if self._is_app_running():\n", "self._log.debug('Successfully started %s', self.app_name)\n", "return\n" ]
[ "def start_app(self, wait_time=APP_START_WAIT_TIME):...\n", "\"\"\"docstring\"\"\"\n", "self.check_app_installed()\n", "self._do_start_app()\n", "for _ in range(wait_time):\n", "time.sleep(1)\n", "if self._is_app_running():\n", "self._log.debug('Successfully started %s', self.app_name)\n", "return\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "For", "Expr'", "Condition", "Expr'", "Return'" ]
[ "@detail_route(methods=['get'])...\n", "\"\"\"docstring\"\"\"\n", "get_and_check_project(VAR_9, VAR_11)\n", "VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n", "VAR_23 = max(0, int(VAR_9.query_params.get('line', 0)))\n", "VAR_24 = VAR_28.console_output or ''\n", "return Response('\\n'.join(VAR_...
[ "@detail_route(methods=['get'])...\n", "\"\"\"docstring\"\"\"\n", "get_and_check_project(request, project_pk)\n", "task = self.queryset.get(pk=pk, project=project_pk)\n", "line_num = max(0, int(request.query_params.get('line', 0)))\n", "output = task.console_output or ''\n", "return Response('\\n'.join(...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_10, VAR_11):...\n", "VAR_7 = VAR_10.find_where({'session_name': VAR_11})\n", "VAR_7.kill_session()\n" ]
[ "def kill_session_by_name(server, name):...\n", "session = server.find_where({'session_name': name})\n", "session.kill_session()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@click.command(help='Update an existing monitor')...\n", "if VAR_13['no_validation_string']:\n", "if VAR_13['validation_string']:\n", "if VAR_13['validation_string']:\n", "VAR_13['validation_string'] = False\n", "VAR_13['bypass_head_request'] = True\n", "if VAR_13['clear_locations'] and not VAR_13['add...
[ "@click.command(help='Update an existing monitor')...\n", "if kwargs['no_validation_string']:\n", "if kwargs['validation_string']:\n", "if kwargs['validation_string']:\n", "kwargs['validation_string'] = False\n", "kwargs['bypass_head_request'] = True\n", "if kwargs['clear_locations'] and not kwargs['add...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Return'", "Expr'", "Expr'", "Expr'" ]
[ "@detail_route(methods=['post'])...\n", "return self.set_pending_action(pending_actions.RESTART, *VAR_13, **kwargs)\n" ]
[ "@detail_route(methods=['post'])...\n", "return self.set_pending_action(pending_actions.RESTART, *args, **kwargs)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_2(self):...\n", "self.uut.output_regex = 'string'\n", "self.uut.severity_map = {'I': RESULT_SEVERITY.INFO}\n", "VAR_1 = list(self.uut.process_output(['info_msg|1.0|2.3|I: Info message\\n'],\n 'a/file.py', ['original_file_lines_placeholder']))\n", "self.assertEqual(len(VAR_1), 1)\n", "self.ass...
[ "def test_custom_regex(self):...\n", "self.uut.output_regex = (\n '(?P<origin>\\\\w+)\\\\|(?P<line>\\\\d+)\\\\.(?P<column>\\\\d+)\\\\|(?P<end_line>\\\\d+)\\\\.(?P<end_column>\\\\d+)\\\\|(?P<severity>\\\\w+): (?P<message>.*)'\n )\n", "self.uut.severity_map = {'I': RESULT_SEVERITY.INFO}\n", "out = list(se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_3(self, VAR_5):...\n", "VAR_9 = []\n", "for question in entry_form_config:\n", "VAR_10 = VAR_5.cleaned_data.get(str(question['id']), False)\n", "return self.render_to_response({'form': VAR_5, 'submitted': True,\n 'claimable_benefits': Benefit.objects.find_claimable(VAR_9)})\n", "if VAR_10:\n"...
[ "def form_valid(self, form):...\n", "selected_flags = []\n", "for question in entry_form_config:\n", "flag = form.cleaned_data.get(str(question['id']), False)\n", "return self.render_to_response({'form': form, 'submitted': True,\n 'claimable_benefits': Benefit.objects.find_claimable(selected_flags)})\n",...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Condition", "Expr'" ]
[ "def FUNC_8(self):...\n", "VAR_21 = self.agent.type_to_payload('deleteGoogleLoadBalancerDescription',\n {'region': self.bindings['TEST_GCE_REGION'], 'credentials': self.\n bindings['GCE_CREDENTIALS'], 'loadBalancerName': self.__use_lb_name})\n", "VAR_20 = gcp.GceContractBuilder(self.gce_observer)\n", "V...
[ "def delete_load_balancer(self):...\n", "payload = self.agent.type_to_payload('deleteGoogleLoadBalancerDescription',\n {'region': self.bindings['TEST_GCE_REGION'], 'credentials': self.\n bindings['GCE_CREDENTIALS'], 'loadBalancerName': self.__use_lb_name})\n", "builder = gcp.GceContractBuilder(self.gce_ob...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_11(VAR_4):...\n", "VAR_12 = FUNC_10(VAR_4)\n", "VAR_9 = FUNC_0()\n", "VAR_10 = VAR_9.cursor()\n", "if VAR_12 is None:\n", "VAR_12 = VAR_12 + 1\n", "VAR_10.execute(\n \"\"\"\n INSERT INTO people(name,karma,shame) VALUES('{}',0,1)\n \"\"\"\n .format(VAR_4))\n"...
[ "def shame_add(name):...\n", "shame = shame_ask(name)\n", "db = db_connect()\n", "cursor = db.cursor()\n", "if shame is None:\n", "shame = shame + 1\n", "cursor.execute(\n \"\"\"\n INSERT INTO people(name,karma,shame) VALUES('{}',0,1)\n \"\"\"\n .format(name))\n", "...
[ 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'", "Return'" ]
[ "def __init__(self):...\n", "self.connect()\n", "VAR_7.signal(VAR_7.SIGTERM, self.exit)\n", "log.info('Worker starting')\n" ]
[ "def __init__(self):...\n", "self.connect()\n", "signal.signal(signal.SIGTERM, self.exit)\n", "log.info('Worker starting')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_0(self, VAR_2):...\n", "return getHTML(VAR_2)\n" ]
[ "def get(self, name):...\n", "return getHTML(name)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "from flask import Flask\n", "from flask import redirect\n", "from flask import url_for\n", "from routes.topic_routes import topic_routes\n", "from routes.auth_routes import auth_routes\n", "from routes.reply_routes import reply_routes\n", "VAR_0 = Flask(__name__)\n", "VAR_0.secret_key = 'for test'\n"...
[ "from flask import Flask\n", "from flask import redirect\n", "from flask import url_for\n", "from routes.topic_routes import topic_routes\n", "from routes.auth_routes import auth_routes\n", "from routes.reply_routes import reply_routes\n", "app = Flask(__name__)\n", "app.secret_key = 'for test'\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def __repr__(self):...\n", "return super().__repr__() + 'Backend: ' + self.backend + '\\n'\n" ]
[ "def __repr__(self):...\n", "return super().__repr__() + 'Backend: ' + self.backend + '\\n'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, *VAR_11, **VAR_12):...\n", "if 'health' not in VAR_12 and 'infohash' in VAR_12:\n", "VAR_12['health'] = VAR_0.TorrentState.get(VAR_2=kwargs['infohash']\n ) or VAR_0.TorrentState(VAR_2=kwargs['infohash'])\n", "if 'xxx' not in VAR_12:\n", "VAR_12['xxx'] = default_xxx_filter.isXXXTorrent...
[ "def __init__(self, *args, **kwargs):...\n", "if 'health' not in kwargs and 'infohash' in kwargs:\n", "kwargs['health'] = db.TorrentState.get(infohash=kwargs['infohash']\n ) or db.TorrentState(infohash=kwargs['infohash'])\n", "if 'xxx' not in kwargs:\n", "kwargs['xxx'] = default_xxx_filter.isXXXTorrentMe...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_0():...\n", "VAR_12 = f'string{VAR_0}\\n '\n", "VAR_14 = create_connection()\n", "VAR_14.close()\n", "VAR_15 = VAR_14.cursor()\n", "VAR_15.execute(VAR_12)\n", "return VAR_15.fetchall()\n" ]
[ "def get_users():...\n", "sql_query = f\"\"\"\n SELECT id, first_name, last_name, username, email, password, INET_NTOA(ip_address)\n as ip_address, registration_date, activated\n FROM {USERS_TABLE}\n \"\"\"\n", "connection = create_connection()\n", "connection.close...
[ 0, 4, 0, 0, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "@FUNC_5...\n", "\"\"\"docstring\"\"\"\n", "log.debug('Check how many users also have this feature: %s...', VAR_5)\n", "VAR_17 = (\"SELECT DISTINCT chat_id FROM photo_queries_table2 WHERE {}='{}'\"\n .format(VAR_6, VAR_5))\n", "VAR_42 = db.execute_query(VAR_17)\n", "log.error('Cannot check how many use...
[ "@cache_number_users_with_same_feature...\n", "\"\"\"docstring\"\"\"\n", "log.debug('Check how many users also have this feature: %s...', feature)\n", "query = (\"SELECT DISTINCT chat_id FROM photo_queries_table2 WHERE {}='{}'\".\n format(feature_type, feature))\n", "cursor = db.execute_query(query)\n", ...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "Condition", "Return'", "Expr'", "Expr'", "Return'", "Return'" ]
[ "@app.route('/achievements/updateMultiple', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = request.json['player_id']\n", "VAR_7 = request.json['updates']\n", "VAR_8 = dict(updated_achievements=[])\n", "for update in VAR_7:\n", "VAR_1 = update['achievement_id']\n", "return VAR_8\n", "VA...
[ "@app.route('/achievements/updateMultiple', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "player_id = request.json['player_id']\n", "updates = request.json['updates']\n", "result = dict(updated_achievements=[])\n", "for update in updates:\n", "achievement_id = update['achievement_id']\n", "retu...
[ 0, 0, 0, 0, 0, 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'", "For", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", ...
[ "def __init__(self, VAR_7, VAR_71=20, **VAR_16):...\n", "self.num = VAR_71\n", "CLASS_0.__init__(self, VAR_7=param, **kw)\n" ]
[ "def __init__(self, param, num=20, **kw):...\n", "self.num = num\n", "Validator.__init__(self, param=param, **kw)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_5(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters={'name': ['like', 'J%']}))\n" ]
[ "def test_filters_3(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters={'name': ['like', 'J%']}))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11, VAR_16={\n 'orthophoto_area': Envelope(Cast('orthophoto', GeometryField()))})\n", "VAR_30 = get_tile_json(VAR_28.name, [\n '/api/projects/{}/tasks/{}/tiles/{{z}...
[ "def get(self, request, pk=None, project_pk=None):...\n", "\"\"\"docstring\"\"\"\n", "task = self.get_and_check_task(request, pk, project_pk, annotate={\n 'orthophoto_area': Envelope(Cast('orthophoto', GeometryField()))})\n", "json = get_tile_json(task.name, [\n '/api/projects/{}/tasks/{}/tiles/{{z}}/{{...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "@staticmethod...\n", "return ['|id', \"=cmd|'cmd'!''\", ';id', '\\n\\rid', '`id`', '${id}', '\\x00`id`']\n" ]
[ "@staticmethod...\n", "return ['|id', \"=cmd|'cmd'!''\", ';id', '\\n\\rid', '`id`', '${id}', '\\x00`id`']\n" ]
[ 2, 2 ]
[ "Condition", "Return'" ]
[ "def FUNC_2(self):...\n", "return self.HandlePost()\n" ]
[ "def HandleGet(self):...\n", "return self.HandlePost()\n" ]
[ 0, 5 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(self):...\n", "" ]
[ "def solve(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(self, *VAR_4, **VAR_5):...\n", "VAR_11 = self.REQUEST\n", "VAR_12 = VAR_11.RESPONSE\n", "return self.getBodyContent(VAR_11)\n" ]
[ "def zmi_body_content(self, *args, **kwargs):...\n", "request = self.REQUEST\n", "response = request.RESPONSE\n", "return self.getBodyContent(request)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_27(self, *VAR_33):...\n", "self._run_tracker.log(Report.DEBUG, *VAR_33)\n" ]
[ "def debug(self, *msg_elements):...\n", "self._run_tracker.log(Report.DEBUG, *msg_elements)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_5(VAR_3, VAR_7, VAR_8=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = {'currentProvider': None, 'providers': [], 'secondaryProviders': [],\n 'finishAuthUrl': None, 'errorMessage': None}\n", "if third_party_auth.is_enabled():\n", "if not enterprise_customer_for_request(VAR_3):\n", "return VA...
[ "def _third_party_auth_context(request, redirect_to, tpa_hint=None):...\n", "\"\"\"docstring\"\"\"\n", "context = {'currentProvider': None, 'providers': [], 'secondaryProviders':\n [], 'finishAuthUrl': None, 'errorMessage': None}\n", "if third_party_auth.is_enabled():\n", "if not enterprise_customer_for_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "For", "Return'", "For", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "For", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "For", "Assign'" ]
[ "def FUNC_3(self, VAR_10, VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = {}\n", "if not int(VAR_11['simulated-human-interaction']):\n", "VAR_17['human'] = int(VAR_11['simulated-human-interaction'])\n", "return emit_options(VAR_17)\n" ]
[ "def translate_options(self, info, options):...\n", "\"\"\"docstring\"\"\"\n", "ret = {}\n", "if not int(options['simulated-human-interaction']):\n", "ret['human'] = int(options['simulated-human-interaction'])\n", "return emit_options(ret)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'" ]
[ "@app.route('/achievements/updateMultiple', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = request.json['player_id']\n", "VAR_7 = request.json['updates']\n", "VAR_8 = dict(updated_achievements=[])\n", "for update in VAR_7:\n", "VAR_1 = update['achievement_id']\n", "return VAR_8\n", "VA...
[ "@app.route('/achievements/updateMultiple', methods=['POST'])...\n", "\"\"\"docstring\"\"\"\n", "player_id = request.json['player_id']\n", "updates = request.json['updates']\n", "result = dict(updated_achievements=[])\n", "for update in updates:\n", "achievement_id = update['achievement_id']\n", "retu...
[ 0, 0, 0, 0, 0, 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'", "For", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", ...
[ "def __init__(self, VAR_0, VAR_1, VAR_2):...\n", "super(CLASS_4, self).__init__(VAR_0, VAR_1, VAR_2, 'PUT')\n" ]
[ "def __init__(self, connection, args, logger):...\n", "super(HttpPut, self).__init__(connection, args, logger, 'PUT')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_18(self, VAR_11, VAR_12, VAR_13):...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = '/usr/bin/tmsh create net route {0}/{1} gw {2}'.format(VAR_11,\n VAR_12, VAR_13)\n", "return shellutil.run(VAR_15, VAR_8=False)\n" ]
[ "def route_add(self, net, mask, gateway):...\n", "\"\"\"docstring\"\"\"\n", "cmd = '/usr/bin/tmsh create net route {0}/{1} gw {2}'.format(net, mask, gateway\n )\n", "return shellutil.run(cmd, chk_err=False)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_19(self, VAR_6, VAR_17=180, VAR_18=False, VAR_19=False):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_6.startswith('sosreport'):\n", "VAR_6 = VAR_6.replace('sosreport', self.host.sos_bin_path)\n", "if VAR_19:\n", "VAR_19 = True\n", "VAR_18 = True\n", "self.log_debug('Running command %s' % VAR_6...
[ "def run_command(self, cmd, timeout=180, get_pty=False, need_root=False):...\n", "\"\"\"docstring\"\"\"\n", "if cmd.startswith('sosreport'):\n", "cmd = cmd.replace('sosreport', self.host.sos_bin_path)\n", "if need_root:\n", "need_root = True\n", "get_pty = True\n", "self.log_debug('Running command %s'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'"...
[ "@VAR_0.route('/profiles')...\n", "return jsonify(db_getProfilesInfo())\n" ]
[ "@profile_module.route('/profiles')...\n", "return jsonify(db_getProfilesInfo())\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_8(self, VAR_1, VAR_2):...\n", "return self.stateMap[VAR_1][VAR_2]\n" ]
[ "def getUnit(self, x, y):...\n", "return self.stateMap[x][y]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_29(VAR_13):...\n", "" ]
[ "def failing(request):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_2(VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_1.enabled:\n", "FUNC_0(VAR_2)\n", "if VAR_1.use_tls:\n", "VAR_3 = FTP_TLS(VAR_1.server)\n", "VAR_3 = FTP(VAR_1.server)\n", "VAR_3.login(VAR_1.username, VAR_1.password)\n", "VAR_3.login(VAR_1.username, VAR_1.password)\n", "VAR_3.p...
[ "def fetch_data_via_ftp(ftp_config, local_directory):...\n", "\"\"\"docstring\"\"\"\n", "if ftp_config.enabled:\n", "create_directory_tree(local_directory)\n", "if ftp_config.use_tls:\n", "ftp = FTP_TLS(ftp_config.server)\n", "ftp = FTP(ftp_config.server)\n", "ftp.login(ftp_config.username, ftp_config...
[ 0, 0, 0, 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", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "E...
[ "def __init__(self, VAR_65, VAR_7, *VAR_15, **VAR_16):...\n", "self.cache_prefix = VAR_65\n", "CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n" ]
[ "def __init__(self, cache_prefix, param, *a, **kw):...\n", "self.cache_prefix = cache_prefix\n", "Validator.__init__(self, param, *a, **kw)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_9(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_3 = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n", "self.driver._eql_execute('volume', 'select', VAR_3['volume_name'],\n 'snapshot', 'delete', VAR_3['name'])\n", "self.mox.ReplayAll()\...
[ "def test_delete_snapshot(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n", "self.driver._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'delete', snapshot['name'])\n", ...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_6(self, VAR_48):...\n", "VAR_80 = CLASS_5.run(self, VAR_48)\n", "if VAR_80 and not (VAR_101.user_is_loggedin and VAR_80.can_submit(VAR_101.user)\n", "abort(403, 'forbidden')\n", "return VAR_80\n" ]
[ "def run(self, link_name):...\n", "link = VLink.run(self, link_name)\n", "if link and not (c.user_is_loggedin and link.can_submit(c.user)):\n", "abort(403, 'forbidden')\n", "return link\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_5(VAR_12):...\n", "def FUNC_9(self, *VAR_15, **VAR_75):...\n", "for validator in VAR_0:\n", "if VAR_102.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n", "return FUNC_9\n", "validator(VAR_75)\n", "VAR_16 = self.build_arg_list(VAR_12, VAR_75)\n", "return self.ajax_login_redirect(...
[ "def val(fn):...\n", "def newfn(self, *a, **env):...\n", "for validator in simple_vals:\n", "if request.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n", "return newfn\n", "validator(env)\n", "kw = self.build_arg_list(fn, env)\n", "return self.ajax_login_redirect('/')\n", "return self.i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "For", "Condition", "Return'", "Expr'", "Assign'", "Return'", "Return'", "For", "Assign'", "Return'" ]
[ "def FUNC_8(self):...\n", "user_should_have_perm(self.tester, self.permission)\n" ]
[ "def setUp(self):...\n", "user_should_have_perm(self.tester, self.permission)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4():...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = FUNC_0()\n", "VAR_7 = VAR_6.cursor()\n", "VAR_7.execute('SELECT COUNT(*) from players;')\n", "VAR_8 = VAR_7.fetchone()[0]\n", "VAR_6.close()\n", "return VAR_8\n" ]
[ "def countPlayers():...\n", "\"\"\"docstring\"\"\"\n", "c = connect()\n", "cur = c.cursor()\n", "cur.execute('SELECT COUNT(*) from players;')\n", "res = cur.fetchone()[0]\n", "c.close()\n", "return res\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_5():...\n", "self.set_status(404, 'Not Found')\n", "self._headers = tornado.httputil.HTTPHeaders()\n", "self.add_header('Content-Length', '0')\n", "self.flush()\n", "return\n" ]
[ "def invoke_404():...\n", "self.set_status(404, 'Not Found')\n", "self._headers = tornado.httputil.HTTPHeaders()\n", "self.add_header('Content-Length', '0')\n", "self.flush()\n", "return\n" ]
[ 0, 0, 5, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_4(VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = tldextract.extract(VAR_4)\n", "return VAR_17.subdomain not in ('', 'www')\n" ]
[ "def validate_subdomain(url):...\n", "\"\"\"docstring\"\"\"\n", "parsed_domain = tldextract.extract(url)\n", "return parsed_domain.subdomain not in ('', 'www')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "@tornado.web.authenticated...\n", "VAR_9 = get_json_request_body(self)\n", "self.write(api.user.generate_token(VAR_9))\n" ]
[ "@tornado.web.authenticated...\n", "data = get_json_request_body(self)\n", "self.write(api.user.generate_token(data))\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'" ]
[ "def FUNC_8(self):...\n", "clear_cache('writers')\n" ]
[ "def on_update(self):...\n", "clear_cache('writers')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_6(self, VAR_16):...\n", "for line in filter(lambda error: bool(error.strip()), VAR_16):\n", "self.warn(line)\n" ]
[ "def _print_errors(self, errors):...\n", "for line in filter(lambda error: bool(error.strip()), errors):\n", "self.warn(line)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_2(VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = VAR_4.encode('ascii', 'replace')\n", "VAR_4 = re.sub('[^- a-zA-Z0-9]', '_', VAR_4)\n", "VAR_4 = VAR_4.replace(u' ', u'-')\n", "VAR_4 = re.sub('([-_])[-_]+', '\\\\1', VAR_4)\n", "return VAR_4\n" ]
[ "def _gitiles_slugify(value, _separator):...\n", "\"\"\"docstring\"\"\"\n", "value = value.encode('ascii', 'replace')\n", "value = re.sub('[^- a-zA-Z0-9]', '_', value)\n", "value = value.replace(u' ', u'-')\n", "value = re.sub('([-_])[-_]+', '\\\\1', value)\n", "return value\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@VAR_13.whitelist()...\n", "FUNC_2(VAR_1, VAR_2, VAR_3, VAR_0=searchfield, VAR_5=page_length, VAR_4=filters\n )\n", "VAR_13.response['results'] = FUNC_4(VAR_13.response['values'])\n" ]
[ "@frappe.whitelist()...\n", "search_widget(doctype, txt, query, searchfield=searchfield, page_length=\n page_length, filters=filters)\n", "frappe.response['results'] = build_for_autosuggest(frappe.response['values'])\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Assign'" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed('string', VAR_3=discord.Color.red())\n" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.simple_embed(\n 'While on 2.1, **NEVER** shut the N3DS lid, update any model, format a 2DS or attempt to play a game on a cartridge. Doing any of these things *will* brick your system.'\n , color=discord.Color.red())\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "@VAR_0.route('/api/issue/<int:id>', methods=['DELETE'])...\n", "return 'Not implemented.', 501\n" ]
[ "@app.route('/api/issue/<int:id>', methods=['DELETE'])...\n", "return 'Not implemented.', 501\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_1(self):...\n", "logging.debug('Parsing SSH config file {}'.format(str(self.file)))\n", "if not self.file.is_file():\n", "logging.debug('SSH config does not exist')\n", "VAR_2 = self.new_host()\n", "return\n", "for line in ssh_config.readlines():\n", "VAR_11 = line.strip(' \\t\\n')\n", "if...
[ "def parse(self):...\n", "logging.debug('Parsing SSH config file {}'.format(str(self.file)))\n", "if not self.file.is_file():\n", "logging.debug('SSH config does not exist')\n", "host = self.new_host()\n", "return\n", "for line in ssh_config.readlines():\n", "stripped_line = line.strip(' \\t\\n')\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Expr'", "Assign'", "Return'", "For", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_37(self, VAR_29):...\n", "VAR_12.append('authorization_error')\n", "super(CLASS_7, self).authorization_error(VAR_29)\n" ]
[ "def authorization_error(self, err):...\n", "calls.append('authorization_error')\n", "super(Handler, self).authorization_error(err)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_3(self):...\n", "VAR_37 = os.path.join(self._leap_home, self._uuid)\n", "shutil.rmtree(VAR_37)\n" ]
[ "def cleanup(self):...\n", "soledad_test_folder = os.path.join(self._leap_home, self._uuid)\n", "shutil.rmtree(soledad_test_folder)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_6(self, VAR_5):...\n", "VAR_10 = ds.PathTraversalContext({}, {}, self._root, {}, None, None, None)\n", "VAR_11 = self._doc['rules']['ROOT']\n", "VAR_12 = self\n", "return ds._traverse(VAR_5, VAR_11, VAR_10, VAR_12)\n" ]
[ "def traverse(self, searcher):...\n", "ctx = ds.PathTraversalContext({}, {}, self._root, {}, None, None, None)\n", "rule = self._doc['rules']['ROOT']\n", "client = self\n", "return ds._traverse(searcher, rule, ctx, client)\n" ]
[ 0, 1, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_1(self, VAR_4='done'):...\n", "self.finished.callback(self.json_buffer[1:])\n" ]
[ "def connectionLost(self, reason='done'):...\n", "self.finished.callback(self.json_buffer[1:])\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_9(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_faculty_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_3(self, VAR_3, VAR_4, VAR_8):...\n", "if not isinstance(VAR_8, CourseModule):\n", "return True\n", "if VAR_8.status == CourseModule.STATUS.HIDDEN:\n", "return False\n", "if not VAR_8.is_after_open():\n", "self.error_msg(_('The module will open for submissions at {date}.'), format\n ={'date'...
[ "def has_object_permission(self, request, view, module):...\n", "if not isinstance(module, CourseModule):\n", "return True\n", "if module.status == CourseModule.STATUS.HIDDEN:\n", "return False\n", "if not module.is_after_open():\n", "self.error_msg(_('The module will open for submissions at {date}.'), ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Condition", "Expr'", "Condition", "Return'", "Assign'", "Return'", "Return'" ]
[ "\"\"\"\nVarious utilities.\n\"\"\"\n", "import functools\n", "from django.dispatch import receiver\n", "from django.conf import settings\n", "from django.core.mail import send_mail\n", "from django.template import loader, Context\n", "from core.common.mongo import c_onboarding_status, c_onboarding_sett...
[ "\"\"\"\nVarious utilities.\n\"\"\"\n", "import functools\n", "from django.dispatch import receiver\n", "from django.conf import settings\n", "from django.core.mail import send_mail\n", "from django.template import loader, Context\n", "from core.common.mongo import c_onboarding_status, c_onboarding_sett...
[ 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "FunctionDef'", "Condition", "Condition", ...
[ "def FUNC_14(self):...\n", "self.run_test_case(self.scenario.delete_app(), retry_interval_secs=8,\n max_retries=8)\n" ]
[ "def test_z_delete_app(self):...\n", "self.run_test_case(self.scenario.delete_app(), retry_interval_secs=8,\n max_retries=8)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "from django.conf.urls import url, include\n", "from .projects import ProjectViewSet\n", "from .tasks import TaskViewSet, TaskTiles, TaskTilesJson, TaskAssets\n", "from .processingnodes import ProcessingNodeViewSet\n", "from rest_framework_nested import routers\n", "VAR_0 = routers.DefaultRouter()\n", "...
[ "from django.conf.urls import url, include\n", "from .projects import ProjectViewSet\n", "from .tasks import TaskViewSet, TaskTiles, TaskTilesJson, TaskAssets\n", "from .processingnodes import ProcessingNodeViewSet\n", "from rest_framework_nested import routers\n", "router = routers.DefaultRouter()\n", ...
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.obj.__name__\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.obj.__name__\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "@api_view(['GET'])...\n", "return FUNC_7(VAR_0, 'stp')\n" ]
[ "@api_view(['GET'])...\n", "return _measure_by_org(request, 'stp')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_18(self, VAR_4, VAR_5, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_11 is None:\n", "VAR_11 = {}\n", "return self.proxy_class(self._data, VAR_4, VAR_5, **options)\n" ]
[ "def make_proxy(self, accessor, relationship_direction, options=None):...\n", "\"\"\"docstring\"\"\"\n", "if options is None:\n", "options = {}\n", "return self.proxy_class(self._data, accessor, relationship_direction, **options\n )\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Return'" ]
[ "def FUNC_4(self):...\n", "self.assertIn('USER', os.environ)\n", "VAR_18 = subprocess.check_output('env', shell=True).decode('utf-8')\n", "self.assertNotIn('USER=', VAR_18)\n", "self.assertIn('AAA', os.environ)\n", "self.assertEqual(os.environ['AAA'], '333')\n", "self.assertIn('USER', os.environ)\n", ...
[ "def test_hermetic_environment_subprocesses(self):...\n", "self.assertIn('USER', os.environ)\n", "output = subprocess.check_output('env', shell=True).decode('utf-8')\n", "self.assertNotIn('USER=', output)\n", "self.assertIn('AAA', os.environ)\n", "self.assertEqual(os.environ['AAA'], '333')\n", "self.ass...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_0(self, VAR_12):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = self.env['stock.quant']\n", "return VAR_21.search([('product_tmpl_id', '=', VAR_12.id), (\n 'location_id.usage', '=', 'internal')], order='in_date', limit=1)\n" ]
[ "def oldest_quant(self, prod):...\n", "\"\"\"docstring\"\"\"\n", "quant_obj = self.env['stock.quant']\n", "return quant_obj.search([('product_tmpl_id', '=', prod.id), (\n 'location_id.usage', '=', 'internal')], order='in_date', limit=1)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "@functools.wraps(VAR_9)...\n", "VAR_19 = {'$schema': 'http://json-schema.org/draft-07/schema#',\n 'definitions': {'tag': {'type': 'object', 'required': ['namespace',\n 'predicate', 'value'], 'properties': {'namespace': {'type': 'string'},\n 'predicate': {'type': 'string'}, 'value': {'type': ['number', '...
[ "@functools.wraps(func)...\n", "request_schema = {'$schema': 'http://json-schema.org/draft-07/schema#',\n 'definitions': {'tag': {'type': 'object', 'required': ['namespace',\n 'predicate', 'value'], 'properties': {'namespace': {'type': 'string'},\n 'predicate': {'type': 'string'}, 'value': {'type': ['num...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def __hash__(self):...\n", "return self._hash\n" ]
[ "def __hash__(self):...\n", "return self._hash\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(self):...\n", "return self.name\n" ]
[ "def get_name(self):...\n", "return self.name\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "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_11(self):...\n", "VAR_20 = []\n", "for VAR_2 in self.query_order.split('.'):\n", "VAR_23 = VAR_2.replace('-', '')\n", "return self.get_url_with_query_params({self.ordering_query_param: '.'.join(\n VAR_20)})\n", "if not int(VAR_23) == self.column_id:\n", "VAR_20.append(VAR_2)\n" ]
[ "def get_remove_sort_by(self):...\n", "new_query = []\n", "for column in self.query_order.split('.'):\n", "c = column.replace('-', '')\n", "return self.get_url_with_query_params({self.ordering_query_param: '.'.join(\n new_query)})\n", "if not int(c) == self.column_id:\n", "new_query.append(column)\n"...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Condition", "Expr'" ]
[ "def FUNC_6(self, VAR_2):...\n", "VAR_4 = 'delete from post where post.postid=%d' % VAR_2\n", "VAR_5 = sql.deleteDB(self.conn, VAR_4)\n", "return VAR_5\n" ]
[ "def deletePost(self, postid):...\n", "sqlText = 'delete from post where post.postid=%d' % postid\n", "result = sql.deleteDB(self.conn, sqlText)\n", "return result\n" ]
[ 0, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_16(VAR_12):...\n", "VAR_16 = JarDependency('missing spec', ' //:{}'.format(VAR_12))\n", "VAR_4.register_jvm_tool(VAR_8, VAR_4._key_for_tool_version(VAR_12, 'custom'\n ), VAR_15=[dummy_jardep])\n" ]
[ "def register_custom_tool(key):...\n", "dummy_jardep = JarDependency('missing spec', ' //:{}'.format(key))\n", "cls.register_jvm_tool(register, cls._key_for_tool_version(key, 'custom'),\n classpath=[dummy_jardep])\n" ]
[ 0, 0, 7 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_1():...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = getattr(g, 'database', None)\n", "if VAR_10 is None:\n", "g.database = sqlite3.connect(VAR_1)\n", "return VAR_10\n", "VAR_10 = g.database\n", "VAR_10.row_factory = sqlite3.Row\n" ]
[ "def get_database_connection():...\n", "\"\"\"docstring\"\"\"\n", "connection = getattr(g, 'database', None)\n", "if connection is None:\n", "g.database = sqlite3.connect(DATABASE_FILE)\n", "return connection\n", "connection = g.database\n", "connection.row_factory = sqlite3.Row\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'" ]
[ "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_14(VAR_1, VAR_3, VAR_7):...\n", "VAR_21 = VAR_3 + '-' + VAR_7\n", "VAR_18 = \"UPDATE {} SET count=count+1 WHERE name_option = '{}';\".format(CFG\n ('options_table_name'), VAR_21)\n", "VAR_1.execute(VAR_18)\n" ]
[ "def incrementOption(cursor, poll_name, option):...\n", "key = poll_name + '-' + option\n", "req = \"UPDATE {} SET count=count+1 WHERE name_option = '{}';\".format(CFG(\n 'options_table_name'), key)\n", "cursor.execute(req)\n" ]
[ 0, 0, 4, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "\"\"\" Views for a student's account information. \"\"\"\n", "import json\n", "import logging\n", "import urlparse\n", "from datetime import datetime\n", "from django.conf import settings\n", "from django.contrib import messages\n", "from django.contrib.auth import get_user_model\n", "from django.c...
[ "\"\"\" Views for a student's account information. \"\"\"\n", "import json\n", "import logging\n", "import urlparse\n", "from datetime import datetime\n", "from django.conf import settings\n", "from django.contrib import messages\n", "from django.contrib.auth import get_user_model\n", "from django.c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", ...
[ "def FUNC_10(self):...\n", "" ]
[ "def local_edit(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_6(self):...\n", "return self.title\n" ]
[ "def get_feed(self):...\n", "return self.title\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]