lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_7(self, VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_18.isdigit():\n", "return CLASS_0.INVALID_ID\n", "VAR_19 = self.__con.cursor()\n", "return CLASS_0.SUCCESS if VAR_19.execute(\n 'UPDATE tasks SET completed=TRUE WHERE taskid=%d' % int(VAR_18)\n ) else CLASS_0.DOES_NOT_EXIST\n" ...
[ "def complete_task(self, taskid):...\n", "\"\"\"docstring\"\"\"\n", "if not taskid.isdigit():\n", "return Database.INVALID_ID\n", "cur = self.__con.cursor()\n", "return Database.SUCCESS if cur.execute(\n 'UPDATE tasks SET completed=TRUE WHERE taskid=%d' % int(taskid)\n ) else Database.DOES_NOT_EXIST...
[ 0, 0, 0, 0, 0, 2 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Return'" ]
[ "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_11(self, VAR_9, VAR_10=None):...\n", "if isinstance(VAR_9, str) or callable(VAR_9):\n", "self.params.append(VAR_9)\n", "VAR_48 = len(self.params)\n", "if VAR_10:\n", "for VAR_51 in VAR_9:\n", "self.params.add_name(VAR_10)\n", "self._set_params_item(VAR_51)\n", "if VAR_10:\n", "self.param...
[ "def _set_params_item(self, item, name=None):...\n", "if isinstance(item, str) or callable(item):\n", "self.params.append(item)\n", "start = len(self.params)\n", "if name:\n", "for i in item:\n", "self.params.add_name(name)\n", "self._set_params_item(i)\n", "if name:\n", "self.params.set_name(name...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Condition", "For", "Expr'", "Expr'", "Condition", "Expr'" ]
[ "@Endpoint('GET', '/lsdir')...\n", "if VAR_19 is None:\n", "VAR_19 = '/'\n", "VAR_20 = int(VAR_20)\n", "if VAR_20 > 5:\n", "logger.warning('[NFS] Limiting depth to maximum value of 5: input depth=%s',\n VAR_20)\n", "VAR_19 = '{}/'.format(VAR_19) if not VAR_19.endswith('/') else VAR_19\n", "VAR_20 =...
[ "@Endpoint('GET', '/lsdir')...\n", "if root_dir is None:\n", "root_dir = '/'\n", "depth = int(depth)\n", "if depth > 5:\n", "logger.warning('[NFS] Limiting depth to maximum value of 5: input depth=%s',\n depth)\n", "root_dir = '{}/'.format(root_dir) if not root_dir.endswith('/') else root_dir\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_9(self, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = VAR_9.split()\n", "if not len(VAR_19) == 1:\n", "print('register: incorrect arguments; input only your username')\n", "VAR_15 = VAR_19[0]\n", "return\n", "VAR_20 = FUNC_0('check_username_exists {}'.format(VAR_15))\n", "if VAR_20 =...
[ "def do_register(self, line):...\n", "\"\"\"docstring\"\"\"\n", "linesplit = line.split()\n", "if not len(linesplit) == 1:\n", "print('register: incorrect arguments; input only your username')\n", "username = linesplit[0]\n", "return\n", "response = send_unauthenticated_cmd('check_username_exists {}'....
[ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Assign'", "Expr'" ]
[ "@validate(VUser(), VAR_0=VEditMeetup('id'))...\n", "return BoringPage(pagename='Edit Meetup', VAR_27=EditMeetup(meetup, title=\n meetup.title, description=meetup.description, location=meetup.location,\n latitude=meetup.latitude, longitude=meetup.longitude, timestamp=int(\n meetup.timestamp * 1000), tzof...
[ "@validate(VUser(), meetup=VEditMeetup('id'))...\n", "return BoringPage(pagename='Edit Meetup', content=EditMeetup(meetup, title=\n meetup.title, description=meetup.description, location=meetup.location,\n latitude=meetup.latitude, longitude=meetup.longitude, timestamp=int(\n meetup.timestamp * 1000), tz...
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_23(VAR_38, VAR_39):...\n", "\"\"\"docstring\"\"\"\n", "VAR_65 = cmp(len(VAR_39[1][0]), len(VAR_38[1][0]))\n", "if VAR_65:\n", "return VAR_65\n", "if VAR_38[0].isComposite() and VAR_39[0].isComposite():\n", "VAR_85 = sum(VAR_38[1][1]) / len(VAR_38[1][1])\n", "return cmp(len(str(VAR_39[0])), l...
[ "def _skw_matches_comparator(kw0, kw1):...\n", "\"\"\"docstring\"\"\"\n", "list_comparison = cmp(len(kw1[1][0]), len(kw0[1][0]))\n", "if list_comparison:\n", "return list_comparison\n", "if kw0[0].isComposite() and kw1[0].isComposite():\n", "component_avg0 = sum(kw0[1][1]) / len(kw0[1][1])\n", "return...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_6(self, VAR_3):...\n", "if VAR_3.address == self.master.address:\n", "return 'manager'\n", "if VAR_3.is_installed('ovirt-node-ng-nodectl'):\n", "return 'rhvh'\n", "return 'rhelh'\n" ]
[ "def set_node_label(self, node):...\n", "if node.address == self.master.address:\n", "return 'manager'\n", "if node.is_installed('ovirt-node-ng-nodectl'):\n", "return 'rhvh'\n", "return 'rhelh'\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_14(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "return partial(FUNC_5, VAR_1)\n" ]
[ "def make_token_getter(remote):...\n", "\"\"\"docstring\"\"\"\n", "return partial(token_getter, remote)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_38(self):...\n", "" ]
[ "def _update_default_tester(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@VAR_2.route('/entrants')...\n", "if VAR_0 == None:\n", "FUNC_16()\n", "VAR_8 = 'SELECT base_url FROM analyzed;'\n", "VAR_30 = VAR_0.exec(VAR_8, debug=False)\n", "if VAR_4 == None:\n", "VAR_4 = []\n", "for p in VAR_4:\n", "for p in request.args:\n", "VAR_33 = \"url = '{}' \".format(VAR_30[0][0]) ...
[ "@endpoints.route('/entrants')...\n", "if db == None:\n", "init()\n", "sql = 'SELECT base_url FROM analyzed;'\n", "urls = db.exec(sql, debug=False)\n", "if players == None:\n", "players = []\n", "for p in players:\n", "for p in request.args:\n", "or_clause = \"url = '{}' \".format(urls[0][0]) + ' ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "For", "For", "Assign'", "Return'", "Expr'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_28(self):...\n", "if not self._normalized_jdk_paths:\n", "return ()\n", "VAR_37 = normalize_os_name(os.uname()[0].lower())\n", "if VAR_37 not in self._normalized_jdk_paths:\n", "VAR_0.warning(\n '--jvm-distributions-paths was specified, but has no entry for \"{}\".'.\n format(VAR_37))\n", ...
[ "def _get_explicit_jdk_paths(self):...\n", "if not self._normalized_jdk_paths:\n", "return ()\n", "os_name = normalize_os_name(os.uname()[0].lower())\n", "if os_name not in self._normalized_jdk_paths:\n", "logger.warning(\n '--jvm-distributions-paths was specified, but has no entry for \"{}\".'.\n f...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Expr'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_14(self, VAR_14):...\n", "" ]
[ "def is_boolean(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_7(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n", "time.sleep(mox.IgnoreArg())\n", "VAR_2 = 'True'\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRe...
[ "def testUrlOpenSuccessAfterFailure(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n", "time.sleep(mox.IgnoreArg())\n", "response = 'True'\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=m...
[ 0, 5, 0, 0, 5, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(VAR_9, str):\n", "return VAR_9\n", "if isinstance(VAR_9, unicode):\n", "return VAR_9.encode('utf-8')\n", "return str(VAR_9)\n" ]
[ "def _ConvertToAscii(value):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(value, str):\n", "return value\n", "if isinstance(value, unicode):\n", "return value.encode('utf-8')\n", "return str(value)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_9(VAR_19):...\n", "VAR_33 = []\n", "for cur_root, _subdirs, files in os.walk(VAR_19):\n", "for f in files:\n", "return VAR_33\n", "VAR_46 = os.path.join(cur_root, f), os.path.join(FUNC_10(VAR_19, cur_root), f)\n", "VAR_33.append(VAR_46)\n" ]
[ "def template_paths(root):...\n", "res = []\n", "for cur_root, _subdirs, files in os.walk(root):\n", "for f in files:\n", "return res\n", "inout = os.path.join(cur_root, f), os.path.join(strip_prefix(root, cur_root), f\n )\n", "res.append(inout)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "For", "Return'", "Assign'", "Expr'" ]
[ "def FUNC_17(self, VAR_14):...\n", "" ]
[ "def is_relation(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = self.bindings['TEST_APP_COMPONENT_NAME']\n", "VAR_1 = self.bindings\n", "VAR_9 = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider': 'gce', 'loadBalancerName':\n load_balancer_name, 'region': bind...
[ "def delete_load_balancer(self):...\n", "\"\"\"docstring\"\"\"\n", "load_balancer_name = self.bindings['TEST_APP_COMPONENT_NAME']\n", "bindings = self.bindings\n", "payload = self.agent.make_json_payload_from_kwargs(job=[{'type':\n 'deleteLoadBalancer', 'cloudProvider': 'gce', 'loadBalancerName':\n lo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "@defer.inlineCallbacks...\n", "yield self._services_factory.create_services_from(VAR_13)\n", "if VAR_13.fresh_account:\n", "yield add_welcome_mail(VAR_13.mail_store)\n" ]
[ "@defer.inlineCallbacks...\n", "yield self._services_factory.create_services_from(leap_session)\n", "if leap_session.fresh_account:\n", "yield add_welcome_mail(leap_session.mail_store)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_21(self, VAR_1):...\n", "VAR_16 = [VAR_25.fieldname for VAR_25 in self.meta.get_table_fields() if \n VAR_25.options == VAR_1]\n", "return VAR_16[0] if VAR_16 else None\n" ]
[ "def get_parentfield_of_doctype(self, doctype):...\n", "fieldname = [df.fieldname for df in self.meta.get_table_fields() if df.\n options == doctype]\n", "return fieldname[0] if fieldname else None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "from copy import copy\n", "def FUNC_0(VAR_0, VAR_1, VAR_2):...\n", "VAR_5 = VAR_0['points']\n", "VAR_6 = copy(VAR_0['points_by_difficulty'])\n", "def FUNC_2(VAR_7):...\n", "if isinstance(VAR_7, list):\n", "VAR_15, VAR_16 = zip(*VAR_7)\n", "return VAR_5 >= VAR_7\n", "for i, VAR_21 in enumerate(VAR_1...
[ "from copy import copy\n", "def calculate_grade(total_points, point_limits, pad_points):...\n", "points = total_points['points']\n", "d_points = copy(total_points['points_by_difficulty'])\n", "def pass_limit(bound):...\n", "if isinstance(bound, list):\n", "ds, ls = zip(*bound)\n", "return points >= bo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Assign'", "Return'", "For", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "For", "Assign'", "Assign'", "Condition", "AugAssign'", "AugAssign'", "Assign'...
[ "@staticmethod...\n", "return 1\n" ]
[ "@staticmethod...\n", "return 1\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.delete_snapshot(VAR_9)\n", "self.common.client_logout()\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.delete_snapshot(snapshot)\n", "self.common.client_logout()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self):...\n", "VAR_7 = Pa11yCrawler('')\n", "self.assertEqual(VAR_7.cmd, self._expected_command(VAR_7.pa11y_report_dir,\n VAR_7.start_urls))\n" ]
[ "def test_default(self):...\n", "suite = Pa11yCrawler('')\n", "self.assertEqual(suite.cmd, self._expected_command(suite.pa11y_report_dir,\n suite.start_urls))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_28(self, VAR_5):...\n", "if not self._user_options['seed_identifiers_with_syntax']:\n", "return\n", "VAR_18 = vimsupport.CurrentFiletypes()[0]\n", "if VAR_18 in self._filetypes_with_keywords_loaded:\n", "return\n", "self._filetypes_with_keywords_loaded.add(VAR_18)\n", "VAR_5['syntax_keywords...
[ "def _AddSyntaxDataIfNeeded(self, extra_data):...\n", "if not self._user_options['seed_identifiers_with_syntax']:\n", "return\n", "filetype = vimsupport.CurrentFiletypes()[0]\n", "if filetype in self._filetypes_with_keywords_loaded:\n", "return\n", "self._filetypes_with_keywords_loaded.add(filetype)\n",...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Expr'", "Assign'" ]
[ "import tornado.ioloop\n", "import tornado.web\n", "import tornado.websocket\n", "import tornado.httpclient\n", "import tornado.httpserver\n", "import tornado.gen\n", "import os\n", "from datetime import datetime\n", "import ContentConverter\n", "def FUNC_1(self):...\n", "VAR_6 = ContentConverte...
[ "import tornado.ioloop\n", "import tornado.web\n", "import tornado.websocket\n", "import tornado.httpclient\n", "import tornado.httpserver\n", "import tornado.gen\n", "import os\n", "from datetime import datetime\n", "import ContentConverter\n", "def get(self):...\n", "allPosts = ContentConverte...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 5, 0, 5, 5, 0, 5 ]
[ "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "FunctionDef'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "FunctionDef'", "Return'" ]
[ "def FUNC_13(self, *VAR_13, **VAR_14):...\n", "for VAR_9 in VAR_13:\n", "self._set_log_item(VAR_9)\n", "for VAR_10, VAR_9 in VAR_14.items():\n", "self._set_log_item(VAR_9, VAR_10=name)\n" ]
[ "def set_log(self, *logs, **kwlogs):...\n", "for item in logs:\n", "self._set_log_item(item)\n", "for name, item in kwlogs.items():\n", "self._set_log_item(item, name=name)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "For", "Expr'" ]
[ "def FUNC_24(VAR_36):...\n", "return type(VAR_36).__name__ == 'cython_function_or_method'\n" ]
[ "def check_cython(x):...\n", "return type(x).__name__ == 'cython_function_or_method'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = self.agent.type_to_payload(\n 'registerInstancesWithGoogleLoadBalancerDescription', {\n 'loadBalancerNames': [self.__use_lb_name], 'instanceIds': self.\n use_instance_names[:2], 'region': self.bindings['TEST_GCE_REGION'],\n 'credentials'...
[ "def register_load_balancer_instances(self):...\n", "\"\"\"docstring\"\"\"\n", "payload = self.agent.type_to_payload(\n 'registerInstancesWithGoogleLoadBalancerDescription', {\n 'loadBalancerNames': [self.__use_lb_name], 'instanceIds': self.\n use_instance_names[:2], 'region': self.bindings['TEST_GCE_R...
[ 0, 0, 0, 0, 1, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "@memoized_property...\n", "return self._zinc_factory.tool_classpath_from_products(self._products, self\n .ZINC_EXTRACTOR_TOOL_NAME, VAR_25=self._zinc_factory.options_scope)\n" ]
[ "@memoized_property...\n", "return self._zinc_factory.tool_classpath_from_products(self._products, self\n .ZINC_EXTRACTOR_TOOL_NAME, scope=self._zinc_factory.options_scope)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_14(self):...\n", "\"\"\"docstring\"\"\"\n", "if not FUNC_0(self.request.host):\n" ]
[ "def prepare(self):...\n", "\"\"\"docstring\"\"\"\n", "if not validate_host(self.request.host):\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition" ]
[ "def FUNC_11(self, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "VAR_24 = self.getfile(VAR_21)\n", "return False\n", "return VAR_24[VAR_2] == VAR_13\n" ]
[ "def isfile(self, path):...\n", "\"\"\"docstring\"\"\"\n", "f = self.getfile(path)\n", "return False\n", "return f[A_TYPE] == T_FILE\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'", "Return'" ]
[ "def FUNC_1(self, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_34 = self._accessor.get_by_id(VAR_6)\n", "if not VAR_34 is None:\n", "VAR_37 = get_current_registry()\n", "VAR_40 = None\n", "VAR_39 = VAR_37.getUtility(IDataTraversalProxyFactory)\n", "return VAR_40\n", "VAR_40 = VAR_39.make_proxy(VAR...
[ "def get_matching(self, source_id):...\n", "\"\"\"docstring\"\"\"\n", "value = self._accessor.get_by_id(source_id)\n", "if not value is None:\n", "reg = get_current_registry()\n", "prx = None\n", "prx_fac = reg.getUtility(IDataTraversalProxyFactory)\n", "return prx\n", "prx = prx_fac.make_proxy(valu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'", "Assign'" ]
[ "def FUNC_10(self):...\n", "\"\"\"docstring\"\"\"\n", "settings.SSH_PRIVATE_KEY = ''\n", "VAR_2 = '/api/apps'\n", "VAR_5 = {'id': 'autotest'}\n", "VAR_3 = self.client.post(VAR_2, json.dumps(VAR_5), content_type=\n 'application/json')\n", "self.assertEqual(VAR_3.status_code, 201)\n", "VAR_4 = VAR_3....
[ "def test_run_without_auth(self):...\n", "\"\"\"docstring\"\"\"\n", "settings.SSH_PRIVATE_KEY = ''\n", "url = '/api/apps'\n", "body = {'id': 'autotest'}\n", "response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n", "self.assertEqual(response.status_code, 201)\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_1):...\n", "self.declared_handlers = [('/static/(.*)', tornado.web.StaticFileHandler, {\n 'path': 'static/'}), ('/(favicon.ico)', tornado.web.StaticFileHandler,\n {'path': 'static/img/'}), ('/release/(?P<dataset>[^\\\\/]+)/(?P<file>.*)',\n handlers.AuthorizedStaticNginxFileHanlder...
[ "def __init__(self, settings):...\n", "self.declared_handlers = [('/static/(.*)', tornado.web.StaticFileHandler, {\n 'path': 'static/'}), ('/(favicon.ico)', tornado.web.StaticFileHandler,\n {'path': 'static/img/'}), ('/release/(?P<dataset>[^\\\\/]+)/(?P<file>.*)',\n handlers.AuthorizedStaticNginxFileHanl...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_1():...\n", "VAR_1 = [{'fieldname': 'territory', 'fieldtype': 'Link', 'label': _(\n 'Territory'), 'options': 'Territory', 'width': 100}, {'fieldname':\n 'item_group', 'fieldtype': 'Link', 'label': _('Item Group'), 'options':\n 'Item Group', 'width': 150}, {'fieldname': 'item_name', 'fieldtype':...
[ "def get_columns():...\n", "columns = [{'fieldname': 'territory', 'fieldtype': 'Link', 'label': _(\n 'Territory'), 'options': 'Territory', 'width': 100}, {'fieldname':\n 'item_group', 'fieldtype': 'Link', 'label': _('Item Group'), 'options':\n 'Item Group', 'width': 150}, {'fieldname': 'item_name', 'fiel...
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@FUNC_3.setter...\n", "self._parse('leading_slash', VAR_9)\n" ]
[ "@leading_slash.setter...\n", "self._parse('leading_slash', value)\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_21(VAR_10):...\n", "VAR_9.append(1)\n", "return False\n" ]
[ "def setup_bot(_bot):...\n", "setup_bots.append(1)\n", "return False\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_14(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = 3\n", "VAR_10 = 'string'.format(repo_dir=REPO_DIR, shard_str='/shard_' + self.\n shard if self.shard else '', procs=process_count)\n", "VAR_7 = BokChoyTestSuite('', num_processes=process_count)\n", "self.assertEqual(BokChoyTestSuite.verbos...
[ "def test_verbosity_settings_3_processes(self):...\n", "\"\"\"docstring\"\"\"\n", "process_count = 3\n", "expected_verbosity_string = (\n '--with-xunitmp --xunitmp-file={repo_dir}/reports/bok_choy{shard_str}/xunit.xml --processes={procs} --no-color --process-timeout=1200'\n .format(repo_dir=REPO_DIR, sh...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_6(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "self.logger.error(VAR_1)\n", "self.console.error(VAR_1)\n" ]
[ "def log_error(self, msg):...\n", "\"\"\"docstring\"\"\"\n", "self.logger.error(msg)\n", "self.console.error(msg)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'" ]
[ "import database\n", "from database import cgi\n", "from database import db\n", "def FUNC_0(self):...\n", "VAR_1 = db.GqlQuery('SELECT * FROM Item ORDER BY created_at DESC')\n", "VAR_2 = database.users.is_current_user_admin()\n", "database.render_template(self, 'items/index.html', {'items': VAR_1})\n", ...
[ "import database\n", "from database import cgi\n", "from database import db\n", "def get(self):...\n", "items = db.GqlQuery('SELECT * FROM Item ORDER BY created_at DESC')\n", "is_admin = database.users.is_current_user_admin()\n", "database.render_template(self, 'items/index.html', {'items': items})\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Condition", "Expr'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Expr'", "FunctionDef'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "FunctionDef'", "As...
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.bot.say('https://www.youtube.com/watch?v=miVDKgInzyg')\n" ]
[ "@commands.command()...\n", "\"\"\"docstring\"\"\"\n", "await self.bot.say('https://www.youtube.com/watch?v=miVDKgInzyg')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "def FUNC_11(VAR_5):...\n", "if VAR_5 == []:\n", "return 'true'\n", "VAR_11 = '('\n", "for i in range(0, len(VAR_5) - 1):\n", "VAR_11 += ' hej.year = ' + VAR_5[i] + ' or '\n", "VAR_11 += ' hej.year = ' + VAR_5[len(VAR_5) - 1] + ' ) '\n", "return VAR_11\n" ]
[ "def makeYears(list):...\n", "if list == []:\n", "return 'true'\n", "result = '('\n", "for i in range(0, len(list) - 1):\n", "result += ' hej.year = ' + list[i] + ' or '\n", "result += ' hej.year = ' + list[len(list) - 1] + ' ) '\n", "return result\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "For", "AugAssign'", "AugAssign'", "Return'" ]
[ "async def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n", "while True:\n", "await self.next_activity()\n", "await asyncio.sleep(20)\n" ]
[ "async def activity_update_loop(self):...\n", "\"\"\"docstring\"\"\"\n", "while True:\n", "await self.next_activity()\n", "await asyncio.sleep(20)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Docstring", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_11(self):...\n", "return self._latest_completion_request\n" ]
[ "def GetCurrentCompletionRequest(self):...\n", "return self._latest_completion_request\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_29(self, VAR_77):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.priority = VAR_77\n", "return VAR_101\n" ]
[ "def priority(self, priority):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.priority = priority\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_10(self):...\n", "VAR_19 = []\n", "VAR_18 = threading.Event()\n", "self.mock(VAR_18, 'wait', self.fail)\n", "self.mock(bot_main, 'run_manifest', lambda *VAR_24: VAR_19.append(VAR_24))\n", "self.mock(bot_main, 'update_bot', self.fail)\n", "self.expected_requests([(\n 'https://localhost:1/aut...
[ "def test_poll_server_run(self):...\n", "manifest = []\n", "bit = threading.Event()\n", "self.mock(bit, 'wait', self.fail)\n", "self.mock(bot_main, 'run_manifest', lambda *args: manifest.append(args))\n", "self.mock(bot_main, 'update_bot', self.fail)\n", "self.expected_requests([(\n 'https://localhos...
[ 0, 0, 0, 0, 0, 0, 5, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_7():...\n", "return pathlib.Path(VAR_0['cache_file_32bit']).exists() and pathlib.Path(VAR_0\n ['cache_file_64bit']).exists()\n" ]
[ "def cache_files_exist():...\n", "return pathlib.Path(CONFIG['cache_file_32bit']).exists() and pathlib.Path(\n CONFIG['cache_file_64bit']).exists()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __eq__(self, VAR_35):...\n", "return self.__class__ == VAR_35.__class__ and self.size == VAR_35.size\n" ]
[ "def __eq__(self, other):...\n", "return self.__class__ == other.__class__ and self.size == other.size\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "import itertools\n", "from django.core.exceptions import ObjectDoesNotExist\n", "from django.db.models import Max\n", "from course.models import StudentGroup\n", "from .cache.content import CachedContent\n", "from .models import BaseExercise, Submission\n", "\"\"\"string\"\"\"\n", "def __init__(self,...
[ "import itertools\n", "from django.core.exceptions import ObjectDoesNotExist\n", "from django.db.models import Max\n", "from course.models import StudentGroup\n", "from .cache.content import CachedContent\n", "from .models import BaseExercise, Submission\n", "\"\"\"\n UserExerciseSummary summarises t...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "FunctionDef'", "For", "Ret...
[ "def FUNC_2(self):...\n", "return \"\"\"\nNO DATA DUMP FOR TASK STATEMENTS\n\"\"\"\n" ]
[ "def specific_info(self):...\n", "return \"\"\"\nNO DATA DUMP FOR TASK STATEMENTS\n\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __str__(self):...\n", "return self.raw_chem_name\n" ]
[ "def __str__(self):...\n", "return self.raw_chem_name\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@api.model...\n", "\"\"\"docstring\"\"\"\n", "VAR_62 = super(CLASS_0, self)._notify_prepare_email_values(VAR_43)\n", "VAR_63 = None\n", "if VAR_43.model and self._context.get('custom_layout', False):\n", "VAR_63 = self.env.ref(self._context['custom_layout'], raise_if_not_found=False)\n", "if not VAR_63...
[ "@api.model...\n", "\"\"\"docstring\"\"\"\n", "mail_values = super(ResPartner, self)._notify_prepare_email_values(message)\n", "base_template = None\n", "if message.model and self._context.get('custom_layout', False):\n", "base_template = self.env.ref(self._context['custom_layout'],\n raise_if_not_foun...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_10: str):...\n", "for user in VAR_10.split():\n", "call(VAR_2.format(user))\n" ]
[ "def whitelist(users: str):...\n", "for user in users.split():\n", "call(WHITELIST_COMMAND_TEMPLATE.format(user))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "from dbhelper import BDHelper\n", "from flask import Flask\n", "from flask import render_template\n", "from flask import request\n", "VAR_0 = Flask(__name__)\n", "VAR_1 = DBHelper()\n", "@VAR_0.route('/')...\n", "VAR_2 = VAR_1.get_all_inputs()\n", "print(e)\n", "return render_template('home.html'...
[ "from dbhelper import BDHelper\n", "from flask import Flask\n", "from flask import render_template\n", "from flask import request\n", "app = Flask(__name__)\n", "DB = DBHelper()\n", "@app.route('/')...\n", "data = DB.get_all_inputs()\n", "print(e)\n", "return render_template('home.html', data=data...
[ 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Return'", "Assign'" ]
[ "def FUNC_6(self):...\n", "return self.request.user == self.get_object().author\n" ]
[ "def test_func(self):...\n", "return self.request.user == self.get_object().author\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ "@eqlx.with_timeout...\n", "return 'no timeout'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_8(self):...\n", "VAR_9 = fingerprint(VAR_0)\n", "self.assertEquals(VAR_9, '54:6d:da:1f:91:b5:2b:6f:a2:83:90:c4:f9:73:76:f5')\n" ]
[ "def test_rsa_key_fingerprint(self):...\n", "fp = fingerprint(RSA_PUBKEY)\n", "self.assertEquals(fp, '54:6d:da:1f:91:b5:2b:6f:a2:83:90:c4:f9:73:76:f5')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_36, VAR_14, VAR_34):...\n", "self.base_name = VAR_36\n", "self.name = VAR_14\n", "self.type = VAR_34\n", "self.flattened = '{}.{}'.format(self.base_name, self.name\n ) if self.base_name else self.name\n", "self.escaped = FUNC_0(self.flattened)\n" ]
[ "def __init__(self, base_name, name, type):...\n", "self.base_name = base_name\n", "self.name = name\n", "self.type = type\n", "self.flattened = '{}.{}'.format(self.base_name, self.name\n ) if self.base_name else self.name\n", "self.escaped = escape_col(self.flattened)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_2(self, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = {}\n", "VAR_5['clusterName'] = VAR_8\n", "VAR_5['searchDepth'] = '1'\n", "VAR_5['verbose'] = '0'\n", "VAR_18 = self._cliq_run_xml('getClusterInfo', VAR_5)\n", "return VAR_18\n" ]
[ "def _cliq_get_cluster_info(self, cluster_name):...\n", "\"\"\"docstring\"\"\"\n", "cliq_args = {}\n", "cliq_args['clusterName'] = cluster_name\n", "cliq_args['searchDepth'] = '1'\n", "cliq_args['verbose'] = '0'\n", "result_xml = self._cliq_run_xml('getClusterInfo', cliq_args)\n", "return result_xml\n...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_31(VAR_62):...\n", "\"\"\"docstring\"\"\"\n", "VAR_84 = 0\n", "while VAR_62[VAR_84].isdigit():\n", "VAR_84 += 1\n", "if VAR_84 > 0:\n", "return int(VAR_62[:VAR_84])\n", "return 0\n" ]
[ "def _get_value_kw(kw):...\n", "\"\"\"docstring\"\"\"\n", "i = 0\n", "while kw[i].isdigit():\n", "i += 1\n", "if i > 0:\n", "return int(kw[:i])\n", "return 0\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "AugAssign'", "Condition", "Return'", "Return'" ]
[ "@staticmethod...\n", "return VAR_6.total_run_count\n" ]
[ "@staticmethod...\n", "return obj.total_run_count\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_5(self, VAR_8, VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_1 is None:\n", "VAR_1 = self.order\n", "assert len(VAR_8) > VAR_1, 'Error: Path must be longer than k'\n", "if VAR_1 == 0 and len(VAR_8) == 1:\n", "return ['start', VAR_8[0]]\n", "return [self.separator.join(VAR_8[n:n + VA...
[ "def pathToHigherOrderNodes(self, path, k=None):...\n", "\"\"\"docstring\"\"\"\n", "if k is None:\n", "k = self.order\n", "assert len(path) > k, 'Error: Path must be longer than k'\n", "if k == 0 and len(path) == 1:\n", "return ['start', path[0]]\n", "return [self.separator.join(path[n:n + k]) for n i...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assert'", "Condition", "Return'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import logging\n", "from datetime import timedelta\n", "import voluptuous as vol\n", "from homeassistant.components.sensor import PLATFORM_SCHEMA\n", "from homeassistant.const import TEMP_CELSIUS, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, STATE_UNKNOWN\n", "from homeassis...
[ "\"\"\"\nSupport for the NetAtmo Weather Service.\n\nFor more details about this platform, please refer to the documentation at\nhttps://home-assistant.io/components/sensor.netatmo/\n\"\"\"\n", "import logging\n", "from datetime import timedelta\n", "import voluptuous as vol\n", "from homeassistant.componen...
[ 0, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Impo...
[ "@api.public...\n", "FUNC_31(self, 'PUT')\n" ]
[ "@api.public...\n", "record(self, 'PUT')\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "@retries(5, delay=0.5, backoff=1.5)...\n", "if VAR_11 == 'POST':\n", "return requests.post(FUNC_2(VAR_7), VAR_9=ToUtf8Json(data), headers=_HEADERS)\n", "if VAR_11 == 'GET':\n", "return requests.get(FUNC_2(VAR_7), headers=_HEADERS)\n" ]
[ "@retries(5, delay=0.5, backoff=1.5)...\n", "if method == 'POST':\n", "return requests.post(_BuildUri(handler), data=ToUtf8Json(data), headers=\n _HEADERS)\n", "if method == 'GET':\n", "return requests.get(_BuildUri(handler), headers=_HEADERS)\n" ]
[ 0, 0, 7, 0, 0 ]
[ "Condition", "Condition", "Return'", "Condition", "Return'" ]
[ "def FUNC_13(self):...\n", "self.conditions = []\n", "self.grouped_or_conditions = []\n", "self.build_filter_conditions(self.filters, self.conditions)\n", "self.build_filter_conditions(self.or_filters, self.grouped_or_conditions)\n", "if not self.flags.ignore_permissions:\n", "VAR_58 = self.build_match_...
[ "def build_conditions(self):...\n", "self.conditions = []\n", "self.grouped_or_conditions = []\n", "self.build_filter_conditions(self.filters, self.conditions)\n", "self.build_filter_conditions(self.or_filters, self.grouped_or_conditions)\n", "if not self.flags.ignore_permissions:\n", "match_conditions ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_7(self, VAR_42, VAR_41):...\n", "VAR_42 = ''.join(map(str.strip, VAR_42))\n", "VAR_79 = VAR_42.split('+')\n", "VAR_80 = list(map(lambda x: self._parse_coeff(x, VAR_41), VAR_79))\n", "VAR_81 = [0] * (max(VAR_103 for VAR_47, VAR_103 in VAR_80) + 1)\n", "for value, VAR_103 in VAR_80:\n", "if VAR_...
[ "def _parse_poly(self, pstr, var):...\n", "pstr = ''.join(map(str.strip, pstr))\n", "summands = pstr.split('+')\n", "coefficients = list(map(lambda x: self._parse_coeff(x, var), summands))\n", "cs = [0] * (max(degree for _, degree in coefficients) + 1)\n", "for value, degree in coefficients:\n", "if deg...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Condition", "Assign'" ]
[ "\"\"\" Navigation and localization\n \nAuthor:\n Annaleah Ernst\n\"\"\"\n", "import tf\n", "import rospy\n", "import numpy as np\n", "from copy import deepcopy\n", "from geometry_msgs.msg import Pose, Point, Quaternion\n", "from math import sin, cos, pi\n", "from time import time\n", "from lo...
[ "\"\"\" Navigation and localization\n \nAuthor:\n Annaleah Ernst\n\"\"\"\n", "import tf\n", "import rospy\n", "import numpy as np\n", "from copy import deepcopy\n", "from geometry_msgs.msg import Pose, Point, Quaternion\n", "from math import sin, cos, pi\n", "from time import time\n", "from lo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "FunctionDef'", "...
[ "def FUNC_1(self, VAR_6):...\n", "if VAR_6:\n", "VAR_15 = Announce.by_id(VAR_6, self.sql_session).scalar()\n", "VAR_18 = FUNC_0(self.get_argument('start', '0'), -1, 0, 10000000000000000000)\n", "if not VAR_15:\n", "VAR_19 = FUNC_0(self.get_argument('step', '12'), 0, 1, 20)\n", "if VAR_15.is_private and ...
[ "def get(self, ann_id):...\n", "if ann_id:\n", "ann = Announce.by_id(ann_id, self.sql_session).scalar()\n", "start = _to_int(self.get_argument('start', '0'), -1, 0, 10000000000000000000)\n", "if not ann:\n", "step = _to_int(self.get_argument('step', '12'), 0, 1, 20)\n", "if ann.is_private and not self.i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Condi...
[ "def FUNC_1(VAR_2, VAR_3=False):...\n", "\"\"\"docstring\"\"\"\n", "if FUNC_0(VAR_2):\n", "VAR_0.error('Unable to read from file %s. (%s)' % (VAR_2, ex1.strerror))\n", "VAR_11 = [line.decode('utf-8', 'replace') for line in VAR_24]\n", "if not FUNC_4('pdftotext'):\n", "VAR_24 = open(VAR_2, 'r')\n", "re...
[ "def text_lines_from_local_file(document, remote=False):...\n", "\"\"\"docstring\"\"\"\n", "if is_pdf(document):\n", "log.error('Unable to read from file %s. (%s)' % (document, ex1.strerror))\n", "lines = [line.decode('utf-8', 'replace') for line in filestream]\n", "if not executable_exists('pdftotext'):\...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Return'", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "For", "AugAssign'", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_6(self):...\n", "return 'NOW()'\n" ]
[ "def sqlNowCall(self):...\n", "return 'NOW()'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(self, VAR_1, VAR_2=None, VAR_3=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = 'string'.format(default_store=store, repo_dir=REPO_DIR, shard_str=\n '/shard_' + self.shard if self.shard else '', exp_text=name,\n a11y_custom_file=\n 'node_modules/edx-custom-a11y-rules/lib/custom_a11y_rules...
[ "def _expected_command(self, name, store=None, verify_xss=False):...\n", "\"\"\"docstring\"\"\"\n", "expected_statement = (\n \"DEFAULT_STORE={default_store} SCREENSHOT_DIR='{repo_dir}/test_root/log{shard_str}' BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log{shard_str}/hars' BOKCHOY_A11Y_CUSTOM_RULES_FILE='{repo_...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n" ]
[ "def test_fields(self):...\n", "self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_9(self, VAR_13):...\n", "if not VAR_13:\n" ]
[ "def p_error(self, p):...\n", "if not p:\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __init__(self, VAR_0, VAR_1, VAR_2=[], VAR_3=[], VAR_4={}, VAR_5={},...\n", "self.opcodes = VAR_0\n", "self.functions = VAR_1\n", "self.stack = VAR_2\n", "self.memory = VAR_3\n", "self.storage = VAR_4\n", "self.symbols = VAR_5\n", "self.userIn = VAR_6\n", "self.instrPtr = VAR_7\n", "self.symI...
[ "def __init__(self, opcodes, functions, stack=[], memory=[], storage={},...\n", "self.opcodes = opcodes\n", "self.functions = functions\n", "self.stack = stack\n", "self.memory = memory\n", "self.storage = storage\n", "self.symbols = symbols\n", "self.userIn = userIn\n", "self.instrPtr = instrPtr\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(self):...\n", "VAR_27 = self.db.execute('SELECT * FROM mudb.phrases;').fetchall()\n", "VAR_28 = filter(lambda x: x[-2] in [1, -3], VAR_27)\n", "VAR_29 = filter(lambda x: x[-2] == 2, VAR_27)\n", "VAR_30 = filter(lambda x: x[-2] == -2, VAR_27)\n", "VAR_28 = map(lambda x: (x[3], x[-3], x[-2], x[-...
[ "def sync_usrdb(self):...\n", "mudata = self.db.execute('SELECT * FROM mudb.phrases;').fetchall()\n", "data_u = filter(lambda x: x[-2] in [1, -3], mudata)\n", "data_a = filter(lambda x: x[-2] == 2, mudata)\n", "data_n = filter(lambda x: x[-2] == -2, mudata)\n", "data_u = map(lambda x: (x[3], x[-3], x[-2],...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __str__(self):...\n", "return str(self.title)\n" ]
[ "def __str__(self):...\n", "return str(self.title)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_10(self, VAR_14):...\n", "if not VAR_14:\n", "return\n", "self.model.total_items = VAR_14['total']\n", "if self.num_channels_label:\n", "self.num_channels_label.setText('%d items' % VAR_14['total'])\n", "if VAR_14['first'] >= self.model.rowCount():\n", "self.model.add_items(VAR_14['channels'...
[ "def on_channels(self, response):...\n", "if not response:\n", "return\n", "self.model.total_items = response['total']\n", "if self.num_channels_label:\n", "self.num_channels_label.setText('%d items' % response['total'])\n", "if response['first'] >= self.model.rowCount():\n", "self.model.add_items(res...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_6(self, VAR_74):...\n", "if VAR_74 and (not self.domain_re.match(VAR_74) or VAR_74.endswith(\n", "VAR_101.errors.add(errors.BAD_CNAME)\n", "if VAR_74:\n", "return VAR_100(VAR_74).lower()\n", "VAR_101.errors.add(errors.BAD_CNAME)\n" ]
[ "def run(self, domain):...\n", "if domain and (not self.domain_re.match(domain) or domain.endswith(\n", "c.errors.add(errors.BAD_CNAME)\n", "if domain:\n", "return str(domain).lower()\n", "c.errors.add(errors.BAD_CNAME)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Condition", "Return'", "Expr'" ]
[ "@staticmethod...\n", "VAR_5 = CLASS_0._get_report(VAR_1)\n", "if not VAR_5:\n", "VAR_9 = {'analysis': VAR_5}\n", "VAR_13 = CLASS_0._get_dnsinfo(VAR_5)\n", "VAR_9.update(VAR_13)\n", "return VAR_9\n" ]
[ "@staticmethod...\n", "report = AnalysisController._get_report(task_id)\n", "if not report:\n", "data = {'analysis': report}\n", "dnsinfo = AnalysisController._get_dnsinfo(report)\n", "data.update(dnsinfo)\n", "return data\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_3(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = '/api/apps'\n", "VAR_5 = self.client.post(VAR_4)\n", "self.assertEqual(VAR_5.status_code, 201)\n", "VAR_6 = VAR_5.data['id']\n", "VAR_7 = Container.objects.create(owner=User.objects.get(username='autotest'\n ), app=App.objects.get(id=app_i...
[ "def test_container_state_protected(self):...\n", "\"\"\"docstring\"\"\"\n", "url = '/api/apps'\n", "response = self.client.post(url)\n", "self.assertEqual(response.status_code, 201)\n", "app_id = response.data['id']\n", "c = Container.objects.create(owner=User.objects.get(username='autotest'),\n app...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "@app.errorhandler(500)...\n", "return render_template('500.html'), 500\n" ]
[ "@app.errorhandler(500)...\n", "return render_template('500.html'), 500\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_30(VAR_35):...\n", "self.assertEqual(None, VAR_35)\n", "return 0\n" ]
[ "def run_bot(error):...\n", "self.assertEqual(None, error)\n", "return 0\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_0(self, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "self.app = VAR_1\n", "VAR_1.config.setdefault('OIDC_SCOPES', ['openid', 'email'])\n", "VAR_1.config.setdefault('OIDC_GOOGLE_APPS_DOMAIN', None)\n", "VAR_1.config.setdefault('OIDC_ID_TOKEN_COOKIE_NAME', 'oidc_id_token')\n", "VAR_1.config.setdef...
[ "def init_app(self, app):...\n", "\"\"\"docstring\"\"\"\n", "self.app = app\n", "app.config.setdefault('OIDC_SCOPES', ['openid', 'email'])\n", "app.config.setdefault('OIDC_GOOGLE_APPS_DOMAIN', None)\n", "app.config.setdefault('OIDC_ID_TOKEN_COOKIE_NAME', 'oidc_id_token')\n", "app.config.setdefault('OIDC...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assert'", "Assign'", "Assign'" ]
[ "import logging\n", "import os\n", "import urllib\n", "import requests\n", "from django.contrib.auth.decorators import login_required, permission_required\n", "from django.contrib import messages\n", "from django.conf import settings\n", "from django.core.exceptions import PermissionDenied\n", "from...
[ "import logging\n", "import os\n", "import urllib\n", "import requests\n", "from django.contrib.auth.decorators import login_required, permission_required\n", "from django.contrib import messages\n", "from django.conf import settings\n", "from django.core.exceptions import PermissionDenied\n", "from...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Assign'", "Expr'", "Return'", ...
[ "def FUNC_18(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = VAR_0[:]\n", "for user in self.company.employees:\n", "VAR_11.append((Allow, user.login, ('view_customer', 'edit_customer')))\n", "return VAR_11\n" ]
[ "def get_customer_acl(self):...\n", "\"\"\"docstring\"\"\"\n", "acl = DEFAULT_PERM[:]\n", "for user in self.company.employees:\n", "acl.append((Allow, user.login, ('view_customer', 'edit_customer')))\n", "return acl\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_28(self, VAR_40, VAR_41, VAR_39, VAR_35=(), VAR_36={}):...\n", "VAR_49 = str(VAR_41.__name__)\n", "self.log.info('Starting %s(s)', VAR_49)\n", "if VAR_40 == 0:\n", "if not hasattr(self, 'th_sock'):\n", "if VAR_40 == 1:\n", "self.init_th_sock()\n", "if not hasattr(self, 'th_back_sock'):\n", ...
[ "def spawn_nworkers(self, type_, fun, count, args=(), kvargs={}):...\n", "wname = str(fun.__name__)\n", "self.log.info('Starting %s(s)', wname)\n", "if type_ == 0:\n", "if not hasattr(self, 'th_sock'):\n", "if type_ == 1:\n", "self.init_th_sock()\n", "if not hasattr(self, 'th_back_sock'):\n", "if no...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Condition", "Condition", "Condition", "Expr'", "Condition", "Condition", "For", "Expr'", "Expr'", "Condition", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_10(self, VAR_12, VAR_15=None):...\n", "" ]
[ "def delete(self, table, where=None):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import logging\n", "import os\n", "import random\n", "import re\n", "import tempfile\n", "from cms.grading.languagemanager import filename_to_language\n", "from cmsc...
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import logging\n", "import os\n", "import random\n", "import re\n", "import tempfile\n", "from cms.grading.languagemanager import filename_to_language\n", "from cmsc...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_12(self):...\n", "return self._omnicomp\n" ]
[ "def GetOmniCompleter(self):...\n", "return self._omnicomp\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2():...\n", "VAR_11 = datetime.now()\n", "VAR_12 = '%s-%s-%s %s:%s:%s' % (VAR_11.year, VAR_11.month, VAR_11.day,\n VAR_11.hour, VAR_11.minute, VAR_11.second)\n", "return VAR_12\n" ]
[ "def datePass():...\n", "now = datetime.now()\n", "result = '%s-%s-%s %s:%s:%s' % (now.year, now.month, now.day, now.hour, now\n .minute, now.second)\n", "return result\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_4(VAR_6, VAR_7, **VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "assert VAR_0.name != VAR_6.name, 'Refusing to route reply back to the same network, as this would cause a recursive loop'\n", "log.debug('(%s) networks.remote: re-routing reply %r from network %s',\n VAR_0.name, VAR_7, VAR_6.name)\n", ...
[ "def _remote_reply(placeholder_self, text, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "assert irc.name != placeholder_self.name, 'Refusing to route reply back to the same network, as this would cause a recursive loop'\n", "log.debug('(%s) networks.remote: re-routing reply %r from network %s', irc.\n name...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assert'", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_8():...\n", "populate_test_database()\n", "FUNC_1('first playlist')\n", "FUNC_0(1, 'the title of the video', 'the url of the video', 1)\n", "FUNC_0(1, 'the title of the video', 'the url of the video', 2)\n", "VAR_11 = VAR_3.get('/videos/1')\n", "assert VAR_11.json['status'] == 'OK'\n", "asse...
[ "def test_should_return_all_the_videos_from_a_playlist():...\n", "populate_test_database()\n", "create_playlist('first playlist')\n", "create_video(1, 'the title of the video', 'the url of the video', 1)\n", "create_video(1, 'the title of the video', 'the url of the video', 2)\n", "response = test_app.get...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assert'", "Assert'" ]
[ "VAR_0 = [('E. coli',\n 'https://raw.githubusercontent.com/cheukyin699/genset-training-csvs/master/E_Coli_Training.csv'\n ), ('S. dysenteriae',\n 'https://raw.githubusercontent.com/cheukyin699/genset-training-csvs/master/S_Dysenterae_Training.csv'\n ), ('S. typhimurium', 'string'), ('P. syringae',\n ...
[ "SAMPLE_FILES = [('E. coli',\n 'https://raw.githubusercontent.com/cheukyin699/genset-training-csvs/master/E_Coli_Training.csv'\n ), ('S. dysenteriae',\n 'https://raw.githubusercontent.com/cheukyin699/genset-training-csvs/master/S_Dysenterae_Training.csv'\n ), ('S. typhimurium',\n 'https://raw.githubu...
[ 0, 0, 0, 2, 2, 2, 0, 2 ]
[ "Assign'", "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(self):...\n", "if self._IsServerAlive():\n", "return BaseRequest.PostDataToHandler(BuildRequestData(), 'defined_subcommands')\n", "return []\n" ]
[ "def GetDefinedSubcommands(self):...\n", "if self._IsServerAlive():\n", "return BaseRequest.PostDataToHandler(BuildRequestData(), 'defined_subcommands')\n", "return []\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_11(VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = False\n", "VAR_11 = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "VAR_11.execute('SELECT type FROM achievement_definitions WHERE id = %s', VAR_1)\n", "VAR_9 = VAR_11.fetchone()\n", "if VAR_9['type'] != 'STANDARD':\n", "...
[ "def unlock_achievement(achievement_id, player_id):...\n", "\"\"\"docstring\"\"\"\n", "newly_unlocked = False\n", "cursor = db.connection.cursor(db.pymysql.cursors.DictCursor)\n", "cursor.execute('SELECT type FROM achievement_definitions WHERE id = %s',\n achievement_id)\n", "achievement = cursor.fetch...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_62():...\n", "VAR_37.execute('rollback')\n" ]
[ "def test():...\n", "cnxn.execute('rollback')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "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'...