lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = self.bindings\n", "VAR_15 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n", "VAR_12 = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'aws', 'type': 'destroyServerGroup', 'serverGroupNam...
[ "def delete_server_group(self):...\n", "\"\"\"docstring\"\"\"\n", "bindings = self.bindings\n", "group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n", "payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'aws', 'type': 'destroyServerGr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_13(self, VAR_14):...\n", "return [CLASS_2(VAR_14, column.name, CLASS_5(column.type)) for column in\n self.nested_columns]\n" ]
[ "def flatten(self, name):...\n", "return [FlattenedColumn(name, column.name, Array(column.type)) for column in\n self.nested_columns]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_15(self):...\n", "return self.datadocument_set.filter(extracted=True).count()\n" ]
[ "def extracted_docs(self):...\n", "return self.datadocument_set.filter(extracted=True).count()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/logout')...\n", "logout_user()\n", "return Response('<p>Logged out</p>')\n" ]
[ "@app.route('/logout')...\n", "logout_user()\n", "return Response('<p>Logged out</p>')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Return'" ]
[ "@VAR_1.route('/saveAs', methods=['POST'])...\n", "if not 'email' in VAR_18 and not 'social' in VAR_18:\n", "return '', 401\n", "VAR_2 = VAR_6 if VAR_6 else request.form['filename']\n", "if VAR_2:\n", "if VAR_2[-4:] != '.pml':\n", "flash('Invalid File')\n", "VAR_2 += '.pml'\n", "if FUNC_1(VAR_2):\n"...
[ "@app.route('/saveAs', methods=['POST'])...\n", "if not 'email' in session and not 'social' in session:\n", "return '', 401\n", "name = fname if fname else request.form['filename']\n", "if name:\n", "if name[-4:] != '.pml':\n", "flash('Invalid File')\n", "name += '.pml'\n", "if allowed_file(name):\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 ]
[ "Condition", "Condition", "Return'", "Assign'", "Condition", "Condition", "Expr'", "AugAssign'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "For", "Return'", "Return'...
[ "def FUNC_25(self, VAR_38, VAR_39=1, VAR_40=100):...\n", "VAR_33 = 'tag:%s' % VAR_38\n", "return self.search(VAR_33, VAR_39, VAR_40)\n" ]
[ "def get_mails_by_tag(self, tag, page=1, window=100):...\n", "tags = 'tag:%s' % tag\n", "return self.search(tags, page, window)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_17(self, VAR_34):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_34:\n", "return True\n", "if self.tempfiles[VAR_34] is not None:\n", "VAR_70 = hashlib.sha256(FUNC_14(self.tempfiles[VAR_34], 'rb').read()\n ).hexdigest()\n", "return os.close(VAR_34)\n", "VAR_71 = self.cfg.get('honeypot', 'd...
[ "def close(self, fd):...\n", "\"\"\"docstring\"\"\"\n", "if not fd:\n", "return True\n", "if self.tempfiles[fd] is not None:\n", "shasum = hashlib.sha256(open(self.tempfiles[fd], 'rb').read()).hexdigest()\n", "return os.close(fd)\n", "shasumfile = self.cfg.get('honeypot', 'download_path') + '/' + shas...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = self.add_argument_group('ParlAI Model Arguments')\n", "VAR_28.add_argument('-m', '--model', default=None, help=\n 'the model class name. can match parlai/agents/<model> for agents in that directory, or can provide a fully specified module for `...
[ "def add_model_args(self):...\n", "\"\"\"docstring\"\"\"\n", "model_args = self.add_argument_group('ParlAI Model Arguments')\n", "model_args.add_argument('-m', '--model', default=None, help=\n 'the model class name. can match parlai/agents/<model> for agents in that directory, or can provide a fully specif...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_6(self, VAR_23):...\n", "if VAR_23 and self.r_css_name.match(VAR_23):\n", "return VAR_23\n" ]
[ "def run(self, name):...\n", "if name and self.r_css_name.match(name):\n", "return name\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_5(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_1 = {'name': self.volume_name, 'size': 1}\n", "self.driver._eql_execute('volume', 'select', VAR_1['name'], 'show')\n", "self.mox.ReplayAll()\n", "self.driver.ensure_export({}, VAR_1)\n" ]
[ "def test_ensure_export(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "volume = {'name': self.volume_name, 'size': 1}\n", "self.driver._eql_execute('volume', 'select', volume['name'], 'show')\n", "self.mox.ReplayAll()\n", "self.driver.ensure_export({}, volume)...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_7(self):...\n", "VAR_7 = BokChoyTestSuite('', default_store='invalid')\n", "VAR_1 = 'tests'\n", "self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name, VAR_2='invalid')\n )\n" ]
[ "def test_invalid_default_store(self):...\n", "suite = BokChoyTestSuite('', default_store='invalid')\n", "name = 'tests'\n", "self.assertEqual(suite.cmd, self._expected_command(name=name, store='invalid'))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_17(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 2}, 'CONFIDENCE': {'HIGH': 2}}\n", "self.check_example('imports-function.py', VAR_2)\n" ]
[ "def test_imports_function(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 2}, 'CONFIDENCE': {'HIGH': 2}}\n", "self.check_example('imports-function.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n", "self.item = VAR_18\n", "CLASS_0.__init__(self, VAR_18, *VAR_15, **kw)\n" ]
[ "def __init__(self, item, *a, **kw):...\n", "self.item = item\n", "Validator.__init__(self, item, *a, **kw)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "return os.getlogin() in VAR_13.getgrnam('admin').gr_mem\n" ]
[ "def is_admin():...\n", "\"\"\"docstring\"\"\"\n", "return os.getlogin() in grp.getgrnam('admin').gr_mem\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_0(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n", "chaos.CREATE_ERROR_RATE = 0\n", "chaos.DESTROY_ERROR_RATE = 0\n", "chaos.START_ERROR_RATE = 0\n", "chaos.STOP_ERROR_RATE = 0\n", "settings.SCHEDULER_MODULE = 'chaos'\n", "settings.SSH_PRIVATE_K...
[ "def setUp(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n", "chaos.CREATE_ERROR_RATE = 0\n", "chaos.DESTROY_ERROR_RATE = 0\n", "chaos.START_ERROR_RATE = 0\n", "chaos.STOP_ERROR_RATE = 0\n", "settings.SCHEDULER_MODULE = 'chaos'\n", "settings.SSH_PRIVATE_KE...
[ 0, 5, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_8(self, VAR_14):...\n", "" ]
[ "def is_file(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_7(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = inspect.stack()[1][3]\n", "VAR_1 = '[sos_collector:%s] %s' % (VAR_13, VAR_1)\n", "self.logger.debug(VAR_1)\n", "if self.config['verbose']:\n", "self.console.debug(VAR_1)\n" ]
[ "def log_debug(self, msg):...\n", "\"\"\"docstring\"\"\"\n", "caller = inspect.stack()[1][3]\n", "msg = '[sos_collector:%s] %s' % (caller, msg)\n", "self.logger.debug(msg)\n", "if self.config['verbose']:\n", "self.console.debug(msg)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_30(self, VAR_16):...\n", "" ]
[ "def delete_all(self, items):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_2(VAR_1, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = FUNC_3(VAR_1)\n", "VAR_7 = VAR_6.cursor(MySQLdb.cursors.DictCursor)\n", "VAR_8 = 'SELECT * FROM questions WHERE id=' + VAR_3\n", "VAR_7.execute(VAR_8)\n", "VAR_10 = VAR_7.fetchone()\n", "VAR_11 = VAR_10['ts']\n", "if...
[ "def updateAnswer(database, q_id, answer, update_type):...\n", "\"\"\"docstring\"\"\"\n", "conn = dbConnect(database)\n", "curs = conn.cursor(MySQLdb.cursors.DictCursor)\n", "statement = 'SELECT * FROM questions WHERE id=' + q_id\n", "curs.execute(statement)\n", "row = curs.fetchone()\n", "timestamp =...
[ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_0(VAR_0: HttpRequest, VAR_1: str):...\n", "VAR_7 = None\n", "VAR_11: Profile = None\n", "if VAR_0.GET.get('user_id'):\n", "VAR_7 = int(VAR_0.GET['user_id'])\n", "if VAR_7 is not None:\n", "VAR_11 = Profile.objects.get(pk=user_id)\n", "VAR_8 = Form()\n", "VAR_8.action_url = VAR_1\n", "if ...
[ "def render_edit_page(http_request: HttpRequest, action_url: str):...\n", "user_id = None\n", "profile: Profile = None\n", "if http_request.GET.get('user_id'):\n", "user_id = int(http_request.GET['user_id'])\n", "if user_id is not None:\n", "profile = Profile.objects.get(pk=user_id)\n", "f = Form()\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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "FunctionDef'", "Assign'", "AnnAssign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "AnnAssign'", "Expr'", "Condition", "Condition", "Con...
[ "def FUNC_1(self, **VAR_3):...\n", "VAR_5 = super().get_context_data(**kwargs)\n", "VAR_5['search_form'] = SearchForm()\n", "return VAR_5\n" ]
[ "def get_context_data(self, **kwargs):...\n", "context = super().get_context_data(**kwargs)\n", "context['search_form'] = SearchForm()\n", "return context\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "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.assertEqual(self.attributes['dimensions'], VAR_14.dimensions)\n", "self.assertEqual(False, VAR_50)\n", "self.assertEqual(False, VAR_51)\n", "self.assertEqual({'os': 'Amiga',...
[ "def call_hook(botobj, name, *args):...\n", "if name == 'on_after_task':\n", "failure, internal_failure, dimensions, summary = args\n", "self.assertEqual(self.attributes['dimensions'], botobj.dimensions)\n", "self.assertEqual(False, failure)\n", "self.assertEqual(False, internal_failure)\n", "self.asser...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_1(VAR_0, VAR_1):...\n", "VAR_9 = StringIO()\n", "VAR_10 = csv.writer(VAR_9)\n", "VAR_11 = ['#published', 'date', 'info', 'level', 'attribute_count', 'org']\n", "VAR_10.writerow(VAR_11)\n", "for event in Event.objects.filter(id__in=Hunt(id=pk).events.all()).order_by(\n", "VAR_16 = event.publish...
[ "def hunt_export(request, pk):...\n", "stream = StringIO()\n", "writer = csv.writer(stream)\n", "header = ['#published', 'date', 'info', 'level', 'attribute_count', 'org']\n", "writer.writerow(header)\n", "for event in Event.objects.filter(id__in=Hunt(id=pk).events.all()).order_by(\n", "dt = event.publi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_7):...\n", "self._user_options = VAR_7\n", "self._user_notified_about_crash = False\n", "self._diag_interface = DiagnosticInterface(VAR_7)\n", "self._omnicomp = OmniCompleter(VAR_7)\n", "self._latest_completion_request = None\n", "self._latest_file_parse_request = None\n", "sel...
[ "def __init__(self, user_options):...\n", "self._user_options = user_options\n", "self._user_notified_about_crash = False\n", "self._diag_interface = DiagnosticInterface(user_options)\n", "self._omnicomp = OmniCompleter(user_options)\n", "self._latest_completion_request = None\n", "self._latest_file_par...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def _start_event_client(self):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "@detail_route(methods=['post'])...\n", "return self.set_pending_action(pending_actions.REMOVE, *VAR_13, VAR_12=(\n 'delete_project',), **kwargs)\n" ]
[ "@detail_route(methods=['post'])...\n", "return self.set_pending_action(pending_actions.REMOVE, *args, perms=(\n 'delete_project',), **kwargs)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@command...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = VAR_1[0]\n", "if VAR_6 == 'create':\n", "wrapper.todoist.create_project(VAR_1[1])\n", "if VAR_6 == 'complete':\n", "wrapper.todoist.complete_project(VAR_1[1])\n", "if VAR_6 == 'clear':\n", "wrapper.todoist.clear_project(VAR_1[1])\n", "if VAR_6 =...
[ "@command...\n", "\"\"\"docstring\"\"\"\n", "sub_cmd = args[0]\n", "if sub_cmd == 'create':\n", "wrapper.todoist.create_project(args[1])\n", "if sub_cmd == 'complete':\n", "wrapper.todoist.complete_project(args[1])\n", "if sub_cmd == 'clear':\n", "wrapper.todoist.clear_project(args[1])\n", "if sub...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "@VAR_1.route('/run/form/remove/<field>', methods=['POST'])...\n", "VAR_37 = FUNC_15()\n", "VAR_37[VAR_11].pop_entry()\n", "VAR_10 = FUNC_14(VAR_37)\n", "FUNC_16(VAR_37, VAR_10)\n", "return json.dumps({'commands': VAR_10, 'html': render_template(\n 'run_form.html', VAR_9=run_form)})\n" ]
[ "@app.route('/run/form/remove/<field>', methods=['POST'])...\n", "run_form = get_run_form()\n", "run_form[field].pop_entry()\n", "commands = get_commands(run_form)\n", "set_form_defaults(run_form, commands)\n", "return json.dumps({'commands': commands, 'html': render_template(\n 'run_form.html', form=r...
[ 0, 0, 0, 0, 0, 0 ]
[ "For", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_0(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_1:\n", "VAR_1 = ''\n", "VAR_1 = VAR_1.replace('*', '%').replace(' ', '%')\n", "if VAR_1 and VAR_1.startswith('^'):\n", "VAR_1 = VAR_1.replace('^', '')\n", "if VAR_1 and VAR_1.endswith('$'):\n", "VAR_1 += '%'\n", "VAR_1 = VAR_1.repla...
[ "def convert_search(search):...\n", "\"\"\"docstring\"\"\"\n", "if not search:\n", "search = ''\n", "search = search.replace('*', '%').replace(' ', '%')\n", "if search and search.startswith('^'):\n", "search = search.replace('^', '')\n", "if search and search.endswith('$'):\n", "search += '%'\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "Return'", "Assign'" ]
[ "def __getstate__(self):...\n", "return self.serialize()\n" ]
[ "def __getstate__(self):...\n", "return self.serialize()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "\"\"\"View-related code common to the whole app.\"\"\"\n", "import functools\n", "import re\n", "import django.http\n", "import django.utils.decorators\n", "import django.views\n", "import config\n", "import const\n", "import resources\n", "import site_settings\n", "import utils\n", "\"\"\"Ba...
[ "\"\"\"View-related code common to the whole app.\"\"\"\n", "import functools\n", "import re\n", "import django.http\n", "import django.utils.decorators\n", "import django.views\n", "import config\n", "import const\n", "import resources\n", "import site_settings\n", "import utils\n", "\"\"\"Ba...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Expr'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "As...
[ "def FUNC_16(self, VAR_20):...\n", "VAR_0.debug(f'{self.__class__.__name__} form valid')\n", "VAR_25 = super().form_valid(VAR_20)\n", "self.view_action()\n", "return VAR_25\n" ]
[ "def form_valid(self, form):...\n", "logger.debug(f'{self.__class__.__name__} form valid')\n", "output = super().form_valid(form)\n", "self.view_action()\n", "return output\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_3(self):...\n", "VAR_8 = 'test_foo.py'\n", "VAR_7 = BokChoyTestSuite('', test_spec=spec)\n", "VAR_1 = 'tests/{}'.format(VAR_8)\n", "self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name))\n" ]
[ "def test_suite_spec(self):...\n", "spec = 'test_foo.py'\n", "suite = BokChoyTestSuite('', test_spec=spec)\n", "name = 'tests/{}'.format(spec)\n", "self.assertEqual(suite.cmd, self._expected_command(name=name))\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_13(VAR_4, VAR_5):...\n", "VAR_9 = FUNC_0()\n", "VAR_10 = VAR_9.cursor()\n", "VAR_10.execute(\n \"\"\"\n INSERT INTO isalso(name,also) VALUES('{}','{}')\n \"\"\"\n .format(VAR_4, VAR_5))\n", "VAR_2.error('Execution failed with error: {}'.format(e))\n", "VAR_9.commit()\...
[ "def also_add(name, also):...\n", "db = db_connect()\n", "cursor = db.cursor()\n", "cursor.execute(\n \"\"\"\n INSERT INTO isalso(name,also) VALUES('{}','{}')\n \"\"\"\n .format(name, also))\n", "logger.error('Execution failed with error: {}'.format(e))\n", "db.commit()\n", "...
[ 0, 0, 0, 4, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_27(VAR_6):...\n", "if callable(VAR_6):\n", "return VAR_6()\n" ]
[ "def default_encode(value):...\n", "if callable(value):\n", "return value()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'" ]
[ "def FUNC_4(VAR_11):...\n", "VAR_17 = []\n", "for r in VAR_11:\n", "VAR_18 = {'value': r[0], 'description': ', '.join(unique(cstr(d) for d in r if\n d)[1:])}\n", "return VAR_17\n", "VAR_17.append(VAR_18)\n" ]
[ "def build_for_autosuggest(res):...\n", "results = []\n", "for r in res:\n", "out = {'value': r[0], 'description': ', '.join(unique(cstr(d) for d in r if\n d)[1:])}\n", "return results\n", "results.append(out)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "Expr'" ]
[ "def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n", "CLASS_3.__init__(self, VAR_18, errors.BAD_PASSWORD, *VAR_15, **kw)\n" ]
[ "def __init__(self, item, *a, **kw):...\n", "VRequired.__init__(self, item, errors.BAD_PASSWORD, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_3(self):...\n", "return self.headerbar\n" ]
[ "def get_headerbar(self):...\n", "return self.headerbar\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_12(self, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = ['volume', 'create', VAR_16['name'], '%sG' % VAR_16['size']]\n", "VAR_0.error(_('Failed to create volume %s'), VAR_16['name'])\n", "if self.configuration.eqlx_pool != 'default':\n", "VAR_28.append('pool')\n", "if self.configuration....
[ "def create_volume(self, volume):...\n", "\"\"\"docstring\"\"\"\n", "cmd = ['volume', 'create', volume['name'], '%sG' % volume['size']]\n", "LOG.error(_('Failed to create volume %s'), volume['name'])\n", "if self.configuration.eqlx_pool != 'default':\n", "cmd.append('pool')\n", "if self.configuration.sa...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_4(VAR_0):...\n", "return {'linters': get_settings(VAR_0, 'anaconda_go_linters', []),\n 'lint_test': get_settings(VAR_0, 'anaconda_go_lint_test', False),\n 'exclude_regexps': get_settings(VAR_0, 'anaconda_go_exclude_regexps', [\n ]), 'max_line_length': get_settings(VAR_0,\n 'anaconda_go_max_l...
[ "def _get_settings(view):...\n", "return {'linters': get_settings(view, 'anaconda_go_linters', []),\n 'lint_test': get_settings(view, 'anaconda_go_lint_test', False),\n 'exclude_regexps': get_settings(view, 'anaconda_go_exclude_regexps', []\n ), 'max_line_length': get_settings(view, 'anaconda_go_max_line...
[ 0, 1 ]
[ "FunctionDef'", "Return'" ]
[ "@tornado.web.authenticated...\n", "self.render('webInterface/index.html')\n" ]
[ "@tornado.web.authenticated...\n", "self.render('webInterface/index.html')\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_0(VAR_1):...\n", "if isinstance(VAR_1, rdflib.Graph):\n", "return VAR_1\n", "VAR_11 = False\n", "VAR_12 = False\n", "VAR_13 = None\n", "if isinstance(VAR_1, str):\n", "if VAR_1.startswith('file://'):\n", "VAR_14 = rdflib.Graph()\n", "VAR_11 = True\n", "if len(VAR_1) < 240:\n", "if VA...
[ "def _load_into_graph(target):...\n", "if isinstance(target, rdflib.Graph):\n", "return target\n", "target_is_file = False\n", "target_is_text = False\n", "rdf_format = None\n", "if isinstance(target, str):\n", "if target.startswith('file://'):\n", "g = rdflib.Graph()\n", "target_is_file = True\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 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Condition", "Import'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'"...
[ "def FUNC_1(self):...\n", "VAR_1 = self.objects.dg.pk\n", "VAR_2 = self.client.get(f'/datagroup/{VAR_1}/')\n", "self.assertFalse(self.objects.doc.matched,\n 'Document should start w/ matched False')\n", "self.assertFalse(self.objects.doc.extracted,\n 'Document should start w/ extracted False')\n", "...
[ "def test_detail_form_load(self):...\n", "pk = self.objects.dg.pk\n", "response = self.client.get(f'/datagroup/{pk}/')\n", "self.assertFalse(self.objects.doc.matched,\n 'Document should start w/ matched False')\n", "self.assertFalse(self.objects.doc.extracted,\n 'Document should start w/ extracted Fal...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_14(self, VAR_21, VAR_11):...\n", "if VAR_0(VAR_11):\n", "VAR_37, VAR_41 = self.process_lhs(VAR_21, VAR_11)\n", "VAR_42, VAR_43 = self.process_rhs(VAR_21, VAR_11)\n", "assert len(VAR_43) == 1, _('A string must be provided as argument')\n", "VAR_38 = VAR_41 + VAR_43\n", "return '%s ? %s' % (VAR_...
[ "def as_sql(self, compiler, connection):...\n", "if is_postgresql(connection):\n", "lhs, lhs_params = self.process_lhs(compiler, connection)\n", "rhs, rhs_params = self.process_rhs(compiler, connection)\n", "assert len(rhs_params) == 1, _('A string must be provided as argument')\n", "params = lhs_params +...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assert'", "Assign'", "Return'" ]
[ "def FUNC_0(self, VAR_1):...\n", "VAR_15 = self.session.get(VAR_1)\n", "for cookie in VAR_15.cookies:\n", "if cookie.name == '_xsrf':\n", "self.xsrf_token = cookie.value\n" ]
[ "def read_xsrf_token(self, url):...\n", "response = self.session.get(url)\n", "for cookie in response.cookies:\n", "if cookie.name == '_xsrf':\n", "self.xsrf_token = cookie.value\n" ]
[ 0, 5, 5, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Assign'" ]
[ "def FUNC_6(self, VAR_44, VAR_50):...\n", "if not FUNC_2(VAR_44):\n", "return self.error()\n", "if VAR_50 != VAR_44:\n", "return self.error(errors.BAD_PASSWORD_MATCH)\n", "return VAR_44\n" ]
[ "def run(self, password, verify):...\n", "if not chkpass(password):\n", "return self.error()\n", "if verify != password:\n", "return self.error(errors.BAD_PASSWORD_MATCH)\n", "return password\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_31(self):...\n", "\"\"\"docstring\"\"\"\n", "self.cursor.execute('create table t1(i int)')\n", "self.cursor.execute('delete from t1')\n", "self.assertEqual(self.cursor.rowcount, 0)\n" ]
[ "def test_rowcount_nodata(self):...\n", "\"\"\"docstring\"\"\"\n", "self.cursor.execute('create table t1(i int)')\n", "self.cursor.execute('delete from t1')\n", "self.assertEqual(self.cursor.rowcount, 0)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_3):...\n", "VAR_0.info('About to check if ranks need updating for {}'.format(VAR_3))\n", "VAR_8 = 'select count(*) from ranks where scene=\"{}\";'.format(VAR_3)\n", "VAR_11 = self.db.exec(VAR_8)\n", "VAR_12 = VAR_11[0][0]\n", "VAR_13 = (5 if VAR_3 == 'pro' or VAR_3 == 'pro_wiiu' else...
[ "def check_and_update_ranks(self, scene):...\n", "LOG.info('About to check if ranks need updating for {}'.format(scene))\n", "sql = 'select count(*) from ranks where scene=\"{}\";'.format(scene)\n", "res = self.db.exec(sql)\n", "count = res[0][0]\n", "n = (5 if scene == 'pro' or scene == 'pro_wiiu' else c...
[ 0, 0, 4, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Condition", "Expr'"...
[ "import psycopg2\n", "import re\n", "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "return psycopg2.connect('dbname=tournament')\n" ]
[ "import psycopg2\n", "import re\n", "def connect():...\n", "\"\"\"docstring\"\"\"\n", "return psycopg2.connect('dbname=tournament')\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_1(self, VAR_5, VAR_6, VAR_14, VAR_8, VAR_10, VAR_11, VAR_12,...\n", "\"\"\"docstring\"\"\"\n", "if VAR_13 is None:\n", "VAR_13 = {}\n", "VAR_39 = 0.0\n", "VAR_40 = self.pool.get('res.currency')\n", "VAR_42 = self.pool.get('account.move.line')\n", "VAR_43 = self.get_accounts(VAR_5, VAR_6, [VA...
[ "def get_real_values(self, cr, uid, item, periods, company_id, currency_id,...\n", "\"\"\"docstring\"\"\"\n", "if context is None:\n", "context = {}\n", "result = 0.0\n", "currency_obj = self.pool.get('res.currency')\n", "move_line_obj = self.pool.get('account.move.line')\n", "accounts = self.get_acco...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "AugAssign'" ]
[ "def FUNC_0(VAR_0='_Test Event', VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import get_datetime\n", "VAR_2 = frappe.get_doc({'doctype': 'Event', 'subject': VAR_0, 'event_type':\n 'Public', 'starts_on': get_datetime(VAR_1)}).insert(ignore_permissions=True\n )\n", "return VAR_2\n"...
[ "def create_event(subject='_Test Event', starts_on=None):...\n", "\"\"\"docstring\"\"\"\n", "from frappe.utils import get_datetime\n", "event = frappe.get_doc({'doctype': 'Event', 'subject': subject,\n 'event_type': 'Public', 'starts_on': get_datetime(starts_on)}).insert(\n ignore_permissions=True)\n", ...
[ 0, 0, 0, 0, 4 ]
[ "FunctionDef'", "Docstring", "ImportFrom'", "Assign'", "Return'" ]
[ "def FUNC_16(self, VAR_11):...\n", "if not self._IsServerAlive():\n", "return\n", "SendEventNotificationAsync('BufferUnload', {'unloaded_buffer': VAR_11})\n" ]
[ "def OnBufferUnload(self, deleted_buffer_file):...\n", "if not self._IsServerAlive():\n", "return\n", "SendEventNotificationAsync('BufferUnload', {'unloaded_buffer':\n deleted_buffer_file})\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Expr'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.version = VAR_78\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.version = version\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_7(VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "@wraps(VAR_7)...\n", "return VAR_7(*VAR_8, **kwargs)\n", "current_app.logger.warning(e.message, exc_info=True)\n", "return FUNC_16\n", "return FUNC_15(e.remote, e.response, e.code, e.uri, e.description)\n" ]
[ "def oauth_error_handler(f):...\n", "\"\"\"docstring\"\"\"\n", "@wraps(f)...\n", "return f(*args, **kwargs)\n", "current_app.logger.warning(e.message, exc_info=True)\n", "return inner\n", "return oauth2_handle_error(e.remote, e.response, e.code, e.uri, e.description)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_2(self, VAR_8, VAR_9='', VAR_7=10):...\n", "if self.options.debug:\n", "print(colored('getting file...', 'blue'), end='')\n", "VAR_19 = SSHClient()\n", "sys.stdout.flush()\n", "VAR_19.set_missing_host_key_policy(AutoAddPolicy())\n", "for attempt in range(VAR_7):\n", "VAR_19.connect(self.ip_a...
[ "def get_file(self, file_, local_path='', attempts=10):...\n", "if self.options.debug:\n", "print(colored('getting file...', 'blue'), end='')\n", "ssh = SSHClient()\n", "sys.stdout.flush()\n", "ssh.set_missing_host_key_policy(AutoAddPolicy())\n", "for attempt in range(attempts):\n", "ssh.connect(self....
[ 0, 0, 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'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "For", "Expr'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'" ...
[ "def FUNC_3(VAR_13, VAR_14):...\n", "VAR_28.info('writing %s', VAR_13)\n", "if os.path.exists(VAR_13):\n", "VAR_41 = os.stat(VAR_13)\n", "VAR_42, VAR_43, VAR_44 = 420, -1, -1\n", "VAR_42, VAR_43, VAR_44 = VAR_41.st_mode, VAR_41.st_uid, VAR_41.st_gid\n", "VAR_32 = os.path.dirname(VAR_13)\n", "os.path.e...
[ "def write_file(path, contents):...\n", "logger.info('writing %s', path)\n", "if os.path.exists(path):\n", "stat = os.stat(path)\n", "mode, uid, gid = 420, -1, -1\n", "mode, uid, gid = stat.st_mode, stat.st_uid, stat.st_gid\n", "d = os.path.dirname(path)\n", "os.path.exists(d) or os.makedirs(d)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_8(self):...\n", "return FUNC_3(self)\n" ]
[ "def get_current_user(self):...\n", "return login_get_current_user(self)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "import os\n", "import sqlite3\n", "import utils\n", "from os import path\n", "from utils import SQLiteUtils\n", "VAR_0 = SQLiteUtils.getSQLiteType\n", "from threading import Lock\n", "from textual_data import DATABASES_FOLDER_NAME, METADATA_FILENAME\n", "VAR_1 = path.dirname(path.realpath(__file__)...
[ "import os\n", "import sqlite3\n", "import utils\n", "from os import path\n", "from utils import SQLiteUtils\n", "getSQLiteType = SQLiteUtils.getSQLiteType\n", "from threading import Lock\n", "from textual_data import DATABASES_FOLDER_NAME, METADATA_FILENAME\n", "SCRIPT_FOLDER = path.dirname(path.re...
[ 0, 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'", "ImportFrom'", "ImportFrom'", "Assign'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "FunctionDef'", "For", "Expr'", "Docstri...
[ "@VAR_0.route('/flag-check/<level>', methods=['POST'])...\n", "VAR_21 = psycopg2.connect('dbname=unlock user=ubuntu')\n", "VAR_22 = VAR_21.cursor()\n", "VAR_22.execute('SELECT * FROM unlock_flags WHERE level=' + VAR_6 + ';')\n", "VAR_23 = VAR_22.fetchone()\n", "VAR_22.close()\n", "VAR_21.close()\n", "...
[ "@app.route('/flag-check/<level>', methods=['POST'])...\n", "conn = psycopg2.connect('dbname=unlock user=ubuntu')\n", "cur = conn.cursor()\n", "cur.execute('SELECT * FROM unlock_flags WHERE level=' + level + ';')\n", "res = cur.fetchone()\n", "cur.close()\n", "conn.close()\n", "if str(request.form['fl...
[ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "For", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Expr'", "Return'" ]
[ "def __str__(self):...\n", "return str(self.raw_chem_name) if self.raw_chem_name else ''\n" ]
[ "def __str__(self):...\n", "return str(self.raw_chem_name) if self.raw_chem_name else ''\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self):...\n", "self.client = VAR_0.test_client()\n", "self.data = {'username': 'Paul', 'email': 'pkinuthia10@gmail.com',\n 'password': 'password'}\n", "\"\"\" Login to get a JWT token \"\"\"\n", "self.client.post('/api/v1/auth/signup', json=self.data)\n", "VAR_1 = self.client.post('/api/v1/...
[ "def setUp(self):...\n", "self.client = app.test_client()\n", "self.data = {'username': 'Paul', 'email': 'pkinuthia10@gmail.com',\n 'password': 'password'}\n", "\"\"\" Login to get a JWT token \"\"\"\n", "self.client.post('/api/v1/auth/signup', json=self.data)\n", "response = self.client.post('/api/v1/...
[ 0, 4, 4, 4, 4, 4, 4, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_1(self, *VAR_4, **VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = self.REQUEST\n", "VAR_12 = VAR_11.RESPONSE\n", "VAR_12.setHeader('Content-Type', 'text/css')\n", "VAR_13 = []\n", "for stylesheet in self.getStylesheets():\n", "return '\\n'.join(VAR_13)\n", "VAR_24 = stylesheet(self)\n"...
[ "def zmi_manage_css(self, *args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "request = self.REQUEST\n", "response = request.RESPONSE\n", "response.setHeader('Content-Type', 'text/css')\n", "css = []\n", "for stylesheet in self.getStylesheets():\n", "return '\\n'.join(css)\n", "s = stylesheet(self)...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Return'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_5(self, VAR_1, VAR_2, VAR_8=None, VAR_9='form', VAR_4=None, VAR_14...\n", "VAR_29 = super(CLASS_0, self).fields_view_get(VAR_1, VAR_2, VAR_8, VAR_9,\n VAR_4, VAR_14=toolbar, VAR_15=submenu)\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "if 'location' in VAR_4 and VAR_4['location']:\n", "VAR_51 =...
[ "def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=...\n", "res = super(product_product, self).fields_view_get(cr, uid, view_id,\n view_type, context, toolbar=toolbar, submenu=submenu)\n", "if context is None:\n", "context = {}\n", "if 'location' in context and context['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 ]
[ "For", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Condition...
[ "def __init__(self, VAR_3, VAR_4):...\n", "self.model = VAR_3\n", "self.model.on_sort.connect(self._on_view_sort)\n", "self.table_view = VAR_4\n", "self.table_view.setModel(self.model)\n", "self.table_view.verticalScrollBar().valueChanged.connect(self._on_list_scroll)\n", "self.request_mgr = None\n" ]
[ "def __init__(self, model, table_view):...\n", "self.model = model\n", "self.model.on_sort.connect(self._on_view_sort)\n", "self.table_view = table_view\n", "self.table_view.setModel(self.model)\n", "self.table_view.verticalScrollBar().valueChanged.connect(self._on_list_scroll)\n", "self.request_mgr = N...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_0():...\n", "VAR_4 = configparser.ConfigParser()\n", "VAR_4.read('config.ini')\n", "return queries.Query(host=config['database']['host'], dbname=config[\n 'database']['dbname'], VAR_19=config['database']['user'], password=\n config['database']['pass'])\n" ]
[ "def init():...\n", "config = configparser.ConfigParser()\n", "config.read('config.ini')\n", "return queries.Query(host=config['database']['host'], dbname=config[\n 'database']['dbname'], user=config['database']['user'], password=config\n ['database']['pass'])\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "@functools.wraps(VAR_3)...\n", "VAR_23 = VAR_5.pop('timeout', None)\n", "VAR_24 = eventlet.spawn(VAR_3, self, *VAR_4, **kwargs)\n", "if VAR_23 is None:\n", "return VAR_24.wait()\n", "VAR_36 = eventlet.spawn_after(VAR_23, VAR_24.kill)\n", "VAR_48 = VAR_24.wait()\n", "VAR_36.cancel()\n", "return VAR_...
[ "@functools.wraps(f)...\n", "timeout = kwargs.pop('timeout', None)\n", "gt = eventlet.spawn(f, self, *args, **kwargs)\n", "if timeout is None:\n", "return gt.wait()\n", "kill_thread = eventlet.spawn_after(timeout, gt.kill)\n", "res = gt.wait()\n", "kill_thread.cancel()\n", "return res\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "@route('GET', '/-test/jquery.js', VAR_1=website)...\n", "get_current_http_response().set_header('Content-Type',\n 'text/javascript; charset=utf-8')\n", "return (as_path(__file__).dirname() / 'jquery.js').text()\n" ]
[ "@route('GET', '/-test/jquery.js', website=website)...\n", "get_current_http_response().set_header('Content-Type',\n 'text/javascript; charset=utf-8')\n", "return (as_path(__file__).dirname() / 'jquery.js').text()\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Return'" ]
[ "def FUNC_4(self):...\n", "if self.closed:\n", "def FUNC_26():...\n", "return self.closed\n" ]
[ "def iter_messages(self):...\n", "if self.closed:\n", "def stop():...\n", "return self.closed\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "FunctionDef'", "Return'" ]
[ "def FUNC_7(VAR_13):...\n", "VAR_32 = BeautifulSoup(VAR_13, 'html.parser')\n", "VAR_21 = VAR_32.find_all('form')\n", "VAR_33 = []\n", "if len(VAR_21) > 0:\n", "for VAR_46 in VAR_21:\n", "return VAR_33\n", "VAR_42 = VAR_46.findChildren('input', {'type': 'file'})\n", "if len(VAR_42) > 0:\n", "VAR_33...
[ "def detectForms(html):...\n", "soup = BeautifulSoup(html, 'html.parser')\n", "detectedForms = soup.find_all('form')\n", "returnForms = []\n", "if len(detectedForms) > 0:\n", "for f in detectedForms:\n", "return returnForms\n", "fileInputs = f.findChildren('input', {'type': 'file'})\n", "if len(file...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "For", "Return'", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_11(self, VAR_12):...\n", "VAR_5 = {}\n", "VAR_5['serverName'] = VAR_12['host']\n", "VAR_16 = self._cliq_run_xml('getServerInfo', VAR_5, False)\n", "VAR_33 = VAR_16.find('response')\n", "VAR_34 = VAR_33.attrib.get('result')\n", "if VAR_34 != '0':\n", "VAR_5 = {}\n", "VAR_5['serverName'] = V...
[ "def _create_server(self, connector):...\n", "cliq_args = {}\n", "cliq_args['serverName'] = connector['host']\n", "out = self._cliq_run_xml('getServerInfo', cliq_args, False)\n", "response = out.find('response')\n", "result = response.attrib.get('result')\n", "if result != '0':\n", "cliq_args = {}\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_8(VAR_12, VAR_8, VAR_7, VAR_13, VAR_27, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = VAR_14 = VAR_20 = FUNC_0()\n", "VAR_16 = {'cost_usd': VAR_13 * (VAR_20 - VAR_27) / 60.0 / 60.0, 'id': VAR_8\n .bot_id, 'task_id': VAR_8.task_id}\n", "FUNC_4(VAR_12, VAR_16, None, '', 0)\n", "if VAR_8....
[ "def run_command(swarming_server, task_details, work_dir, cost_usd_hour,...\n", "\"\"\"docstring\"\"\"\n", "last_packet = start = now = monotonic_time()\n", "params = {'cost_usd': cost_usd_hour * (now - task_start) / 60.0 / 60.0,\n 'id': task_details.bot_id, 'task_id': task_details.task_id}\n", "post_upd...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Expr'", "AugAssign'", "For", "Expr'", "Condition", "Assign'", "Assign'"...
[ "def FUNC_20(self):...\n", "VAR_16 = self.mox.CreateMock(paramiko.SSHClient)\n", "VAR_12 = self.mox.CreateMock(paramiko.Channel)\n", "VAR_17 = self.mox.CreateMock(paramiko.Transport)\n", "self.mox.StubOutWithMock(self.driver, '_get_output')\n", "self.mox.StubOutWithMock(VAR_16, 'get_transport')\n", "sel...
[ "def test_ssh_execute_error(self):...\n", "ssh = self.mox.CreateMock(paramiko.SSHClient)\n", "chan = self.mox.CreateMock(paramiko.Channel)\n", "transport = self.mox.CreateMock(paramiko.Transport)\n", "self.mox.StubOutWithMock(self.driver, '_get_output')\n", "self.mox.StubOutWithMock(ssh, 'get_transport')\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_0.route('/', methods=['GET'])...\n", "VAR_8 = FUNC_2()\n", "if VAR_8['search'] is None:\n", "VAR_0 = ProductsRepository.get_products(VAR_8)\n", "VAR_0 = ProductsRepository.search_products(VAR_8, VAR_8['search'])\n", "VAR_10 = ProductsRepository.get_total_products(VAR_8)\n", "VAR_10 = ProductsRepos...
[ "@products.route('/', methods=['GET'])...\n", "filters = get_filters()\n", "if filters['search'] is None:\n", "products = ProductsRepository.get_products(filters)\n", "products = ProductsRepository.search_products(filters, filters['search'])\n", "total_products = ProductsRepository.get_total_products(filt...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_10(self, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = ['volume', 'select', VAR_16['name'], 'show']\n", "self._eql_execute(*VAR_11)\n", "if err.stdout.find('does not exist.\\n') > -1:\n", "VAR_0.debug(_('Volume %s does not exist, it may have already been deleted'),\n VAR_16['name'])\n"...
[ "def _check_volume(self, volume):...\n", "\"\"\"docstring\"\"\"\n", "command = ['volume', 'select', volume['name'], 'show']\n", "self._eql_execute(*command)\n", "if err.stdout.find('does not exist.\\n') > -1:\n", "LOG.debug(_('Volume %s does not exist, it may have already been deleted'),\n volume['name...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_15(self):...\n", "\"\"\"docstring\"\"\"\n", "if not self.opt:\n", "self.parse_args(VAR_16=False)\n", "VAR_35 = {}\n", "for VAR_39, VAR_0 in self.opt.items():\n", "VAR_35[VAR_38(VAR_39)] = VAR_38(VAR_0)\n", "for group in self._action_groups:\n", "VAR_40 = {a.dest: getattr(self.args, a.dest,...
[ "def print_args(self):...\n", "\"\"\"docstring\"\"\"\n", "if not self.opt:\n", "self.parse_args(print_args=False)\n", "values = {}\n", "for key, value in self.opt.items():\n", "values[str(key)] = str(value)\n", "for group in self._action_groups:\n", "group_dict = {a.dest: getattr(self.args, a.dest, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Assign'", "For", "Assign'", "For", "Assign'", "Assign'", "Assign'", "For", "Condition", "Condition", "Expr'", "AugAssign'", "Expr'" ]
[ "def FUNC_7(VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "@wraps(VAR_7)...\n", "return VAR_7(*VAR_8, **kwargs)\n", "current_app.logger.warning(e.message, exc_info=True)\n", "return FUNC_16\n", "return FUNC_15(e.remote, e.response, e.code, e.uri, e.description)\n" ]
[ "def oauth_error_handler(f):...\n", "\"\"\"docstring\"\"\"\n", "@wraps(f)...\n", "return f(*args, **kwargs)\n", "current_app.logger.warning(e.message, exc_info=True)\n", "return inner\n", "return oauth2_handle_error(e.remote, e.response, e.code, e.uri, e.description)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_4(VAR_4, VAR_5):...\n", "print(VAR_1)\n", "VAR_12 = VAR_1[0]\n", "print(VAR_12)\n", "print(VAR_4)\n", "for dev in VAR_1:\n", "for ap in dev.AccessPoints:\n", "print(VAR_26)\n", "if ap.Ssid == VAR_4:\n", "VAR_13 = {'802-11-wireless': {'security': '802-11-wireless-security'},\n '802-11-...
[ "def add_newWifiConn(wifiname, wifipass):...\n", "print(wlans)\n", "wlan0 = wlans[0]\n", "print(wlan0)\n", "print(wifiname)\n", "for dev in wlans:\n", "for ap in dev.AccessPoints:\n", "print(currentwifi)\n", "if ap.Ssid == wifiname:\n", "params = {'802-11-wireless': {'security': '802-11-wireless-s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'", "For", "For", "Expr'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'default_scoped_affiliation')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'default_scoped_affiliation')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_3(VAR_0, VAR_1, VAR_2):...\n", "VAR_1['VMWARE_USER'] = VAR_0.get_input('username', default='')\n", "VAR_1['VMWARE_PASSWORD'] = VAR_0.get_input('password', default='')\n", "VAR_1['VMWARE_HOST'] = VAR_0.get_input('host', default='')\n", "VAR_1['VMWARE_VALIDATE_CERTS'] = str(settings.VMWARE_VALIDATE_...
[ "def vmware(cred, env, private_data_dir):...\n", "env['VMWARE_USER'] = cred.get_input('username', default='')\n", "env['VMWARE_PASSWORD'] = cred.get_input('password', default='')\n", "env['VMWARE_HOST'] = cred.get_input('host', default='')\n", "env['VMWARE_VALIDATE_CERTS'] = str(settings.VMWARE_VALIDATE_CER...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_1 and not VAR_2:\n", "VAR_8 = []\n", "for taken_dir in VAR_1:\n", "if isinstance(taken_dir, tuple):\n", "VAR_1 = VAR_8\n", "VAR_8.append(taken_dir[0])\n", "VAR_8.append(taken_dir)\n", "if not VAR_3:\n", "VAR_3 = AnalysisController.get_...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "if not taken_dirs and not taken_files:\n", "taken_dirs_tmp = []\n", "for taken_dir in taken_dirs:\n", "if isinstance(taken_dir, tuple):\n", "taken_dirs = taken_dirs_tmp\n", "taken_dirs_tmp.append(taken_dir[0])\n", "taken_dirs_tmp.append(taken_dir)\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 ]
[ "Condition", "Docstring", "Condition", "Assign'", "For", "Condition", "Assign'", "Expr'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "For", "Condition", "Expr'", "Condition", "For", "Expr'", "Expr'", "...
[ "def FUNC_2(self):...\n", "print('TOTAL: %5d' % self.total, file=sys.stderr)\n", "print('SUCCESS: %5d' % self.success, file=sys.stderr)\n", "print('FAIL: %5d' % self.failure, file=sys.stderr)\n", "print('ERROR: %5d' % self.error, file=sys.stderr)\n", "print('UNDECIDED: ...
[ "def print_stats(self):...\n", "print('TOTAL: %5d' % self.total, file=sys.stderr)\n", "print('SUCCESS: %5d' % self.success, file=sys.stderr)\n", "print('FAIL: %5d' % self.failure, file=sys.stderr)\n", "print('ERROR: %5d' % self.error, file=sys.stderr)\n", "print('UNDECID...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_4():...\n", "def FUNC_7(VAR_6):...\n", "return 'dir2' not in VAR_6\n" ]
[ "def test_it_filters_on_directories():...\n", "def directory_filter(path):...\n", "return 'dir2' not in path\n" ]
[ 0, 0, 1 ]
[ "FunctionDef'", "FunctionDef'", "Return'" ]
[ "async def FUNC_0(VAR_6):...\n", "return response.text('')\n" ]
[ "async def favicon(request):...\n", "return response.text('')\n" ]
[ 0, 0 ]
[ "AsyncFunctionDef'", "Return'" ]
[ "def FUNC_4(self, VAR_10):...\n", "VAR_16 = VAR_10.get_base_urls()\n", "VAR_17 = VAR_10.get_users()\n", "VAR_8 = VAR_10.get_name()\n", "VAR_3.info('found the following users for scene {}: {}'.format(VAR_8, VAR_17))\n", "for user in VAR_17:\n", "VAR_11 = \"SELECT * FROM user_analyzed WHERE user='{}';\".f...
[ "def analyze_scene(self, scene):...\n", "base_urls = scene.get_base_urls()\n", "users = scene.get_users()\n", "name = scene.get_name()\n", "LOG.info('found the following users for scene {}: {}'.format(name, users))\n", "for user in users:\n", "sql = \"SELECT * FROM user_analyzed WHERE user='{}';\".forma...
[ 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, 0, 0...
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "For", "Assign'", "For", "Assign'", "Expr'", "Condition", "Condition", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "For", "For", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Assign'",...
[ "def FUNC_10(self):...\n", "VAR_2 = EngineAuthRequest.blank('/auth/google')\n", "VAR_2._load_session()\n", "VAR_2.set_redirect_uri()\n", "VAR_2._config = {'success_uri': '/callback'}\n", "VAR_19 = VAR_2.get_redirect_uri()\n", "self.assertEqual(VAR_19, '/callback')\n", "VAR_2 = EngineAuthRequest.blank(...
[ "def test_set_redirect_uri(self):...\n", "req = EngineAuthRequest.blank('/auth/google')\n", "req._load_session()\n", "req.set_redirect_uri()\n", "req._config = {'success_uri': '/callback'}\n", "redirect_uri = req.get_redirect_uri()\n", "self.assertEqual(redirect_uri, '/callback')\n", "req = EngineAuth...
[ 0, 0, 0, 6, 6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(VAR_0):...\n", "VAR_0.clear_filters()\n", "for arg in request.args:\n", "VAR_8 = re.findall('_flt_(\\\\d)_(.*)', arg)\n", "if VAR_8:\n", "VAR_0.add_filter_index(VAR_8[0][1], int(VAR_8[0][0]), request.args.get(arg))\n" ]
[ "def get_filter_args(filters):...\n", "filters.clear_filters()\n", "for arg in request.args:\n", "re_match = re.findall('_flt_(\\\\d)_(.*)', arg)\n", "if re_match:\n", "filters.add_filter_index(re_match[0][1], int(re_match[0][0]), request.args.\n get(arg))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "For", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_15(self):...\n", "self._test_strtype('text', None, 100)\n" ]
[ "def test_text_null(self):...\n", "self._test_strtype('text', None, 100)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@tornado.web.asynchronous...\n", "VAR_6 = tornado.concurrent.Future()\n", "def FUNC_6(VAR_12, VAR_2, VAR_5):...\n", "VAR_26 = VAR_12.request.body\n", "VAR_2 = FUNC_1(VAR_2)\n", "def FUNC_8(VAR_4):...\n", "if not os.path.exists('D:' + VAR_4):\n", "return VAR_4\n", "VAR_28 = 1\n", "while VAR_28 < 1...
[ "@tornado.web.asynchronous...\n", "future = tornado.concurrent.Future()\n", "def save_file_async(alter_ego, target_path, file_name):...\n", "upload_data = alter_ego.request.body\n", "target_path = decode_hexed_b64_to_str(target_path)\n", "def get_non_duplicate_path(file_path):...\n", "if not os.path.exi...
[ 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4 ]
[ "Condition", "Assign'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Return'", "Assign'" ]
[ "@VAR_0.filter...\n", "return VAR_4['publish'] <= VAR_5\n" ]
[ "@register.filter...\n", "return entry['publish'] <= now\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_8(self, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "def __init__(self, VAR_15):...\n", "self._store = []\n", "self._ds = VAR_15\n", "def FUNC_13(self, VAR_16):...\n", "return VAR_6 in VAR_16.bookmarks\n" ]
[ "def get_bookmark_parameters(self, bookmark):...\n", "\"\"\"docstring\"\"\"\n", "def __init__(self, dirstructure):...\n", "self._store = []\n", "self._ds = dirstructure\n", "def does_intersect_rule(self, rulectx):...\n", "return bookmark in rulectx.bookmarks\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_6(VAR_20):...\n", "VAR_29 = bisect(VAR_7, int(time.time()) - VAR_12)\n", "for expired_reporter in range(VAR_29):\n", "VAR_5.pop(expired_reporter)\n", "VAR_7 = VAR_7[VAR_29:]\n", "VAR_6 = VAR_6[VAR_29:]\n", "VAR_30 = VAR_20 in VAR_5\n", "logging.info('is_recent_reporter: %d returns %r', VAR_2...
[ "def is_recent_reporter(sender_id):...\n", "least_recent_index = bisect(last_submitted_times, int(time.time()) -\n report_cooldown)\n", "for expired_reporter in range(least_recent_index):\n", "reporters_dict.pop(expired_reporter)\n", "last_submitted_times = last_submitted_times[least_recent_index:]\n", ...
[ 0, 0, 4, 4, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_14(self):...\n", "VAR_16 = 3\n", "VAR_17 = scrape(limit=test_limit, test=True, since='week_ago')\n", "self.assertEqual(len(VAR_17), VAR_16)\n", "VAR_18 = 'SELECT * FROM df_dilfo WHERE closed=0 LIMIT 1'\n", "VAR_34 = pd.read_sql(VAR_18, conn).iloc[0]\n", "communicate(VAR_17, VAR_34, test=True)\...
[ "def test_scarpe_to_communicate(self):...\n", "test_limit = 3\n", "web_df = scrape(limit=test_limit, test=True, since='week_ago')\n", "self.assertEqual(len(web_df), test_limit)\n", "match_first_query = 'SELECT * FROM df_dilfo WHERE closed=0 LIMIT 1'\n", "dilfo_row = pd.read_sql(match_first_query, conn).il...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = self.stdout_interceptor\n", "VAR_3 = self.stderr_interceptor\n", "return max([self._last_update_time, VAR_2.last_write_time if VAR_2 else 0, \n VAR_3.last_write_time if VAR_3 else 0])\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "stdout = self.stdout_interceptor\n", "stderr = self.stderr_interceptor\n", "return max([self._last_update_time, stdout.last_write_time if stdout else 0,\n stderr.last_write_time if stderr else 0])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'default_eppn_scope')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'default_eppn_scope')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_5(self, VAR_2, VAR_3):...\n", "self.assertEqual(len(VAR_2.providers), len(VAR_3))\n", "def FUNC_21(VAR_12, VAR_13):...\n", "for VAR_7 in VAR_2.providers:\n", "if VAR_7.id == VAR_12 and VAR_7.url == VAR_13:\n", "self.fail('Provider: %s not found' % VAR_12)\n", "return\n", "for provider_tuple ...
[ "def _assert_providers(self, cluster_api, provider_tuples):...\n", "self.assertEqual(len(cluster_api.providers), len(provider_tuples))\n", "def _assert_provider(pid, purl):...\n", "for provider in cluster_api.providers:\n", "if provider.id == pid and provider.url == purl:\n", "self.fail('Provider: %s not ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "FunctionDef'", "For", "Condition", "Expr'", "Return'", "For", "Expr'" ]
[ "def FUNC_5(VAR_11):...\n", "" ]
[ "def delete_expense(txn_id):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __str__(self):...\n", "VAR_23 = 'BDI3000 at ' + self.options.debugger_ip_address + ' port ' + str(self\n .port)\n", "return VAR_23\n" ]
[ "def __str__(self):...\n", "string = 'BDI3000 at ' + self.options.debugger_ip_address + ' port ' + str(self\n .port)\n", "return string\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def __hash__(self):...\n", "return hash(self.name)\n" ]
[ "def __hash__(self):...\n", "return hash(self.name)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_38(self, VAR_84):...\n", "return [VAR_82 for job in VAR_84.jobs for VAR_82 in job.subworkflow_input if\n job.subworkflow_input[VAR_82] is self]\n" ]
[ "def targets(self, dag):...\n", "return [f for job in dag.jobs for f in job.subworkflow_input if job.\n subworkflow_input[f] is self]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import json\n", "import mysql.connector as mysql\n", "import src.settings as conf\n", "\"\"\"\n MySQL class:\n \tTodas as funções para manipulação do DB\n \"\"\"\n", "def __init__(self):...\n", "self.__connection = mysql.connect(**conf.DATABASE)\n", "self.c...
[ "\"\"\" mysql File\n\n Arquivo onde se encontra todas as funções para trabalhar com o db\nTodo:\n\n None\n\n\"\"\"\n", "import json\n", "import mysql.connector as mysql\n", "import src.settings as conf\n", "\"\"\"\n MySQL class:\n \tTodas as funções para manipulação do DB\n \"\"\"\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Expr'", "Expr'", "Return'" ]