lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_1(VAR_1, VAR_6):...\n", "" ]
[ "def directory_index(path, fullpath):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@staticmethod...\n", "if not isinstance(VAR_1, int):\n", "VAR_9 = {}\n", "VAR_10 = VAR_0.view_task(VAR_1, details=True)\n", "if VAR_10:\n", "VAR_19 = VAR_10.to_dict()\n", "return Exception('Task not found')\n", "VAR_19['guest'] = {}\n", "if VAR_10.guest:\n", "VAR_19['guest'] = VAR_10.guest.to_dic...
[ "@staticmethod...\n", "if not isinstance(task_id, int):\n", "data = {}\n", "task = db.view_task(task_id, details=True)\n", "if task:\n", "entry = task.to_dict()\n", "return Exception('Task not found')\n", "entry['guest'] = {}\n", "if task.guest:\n", "entry['guest'] = task.guest.to_dict()\n", "en...
[ 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_13(self, VAR_13):...\n", "if VAR_13:\n", "self._update_backend_status()\n", "return self.device_stats\n" ]
[ "def get_volume_stats(self, refresh):...\n", "if refresh:\n", "self._update_backend_status()\n", "return self.device_stats\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_1(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1.value = beamr.interpreters.Heading(VAR_1.value)\n", "return VAR_1\n" ]
[ "def t_HEADING(t):...\n", "\"\"\"docstring\"\"\"\n", "t.value = beamr.interpreters.Heading(t.value)\n", "return t\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_2 or VAR_2 == '/':\n", "return [VAR_1], []\n", "VAR_2 = re.sub('\\\\/+', '/', VAR_2)\n", "if VAR_2.endswith('/'):\n", "VAR_2 = VAR_2[:-1]\n", "if VAR_2.startswith('/'):\n", "VAR_2 = VAR_2[1:]\n", "VAR_2 = VAR_2.split('/')\n",...
[ "def traverse_path(obj, path):...\n", "\"\"\"docstring\"\"\"\n", "if not path or path == '/':\n", "return [obj], []\n", "path = re.sub('\\\\/+', '/', path)\n", "if path.endswith('/'):\n", "path = path[:-1]\n", "if path.startswith('/'):\n", "path = path[1:]\n", "path = path.split('/')\n", "ret = ...
[ 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'" ]
[ "from django.utils.translation import string_concat\n", "from django.utils.translation import ugettext_lazy as _\n", "from django.utils.translation import ungettext_lazy\n", "from horizon import tables\n", "from openstack_dashboard import api\n", "from openstack_dashboard.usage import quotas\n", "VAR_0 ...
[ "from django.utils.translation import string_concat\n", "from django.utils.translation import ugettext_lazy as _\n", "from django.utils.translation import ungettext_lazy\n", "from horizon import tables\n", "from openstack_dashboard import api\n", "from openstack_dashboard.usage import quotas\n", "policy...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_1(self, VAR_1, VAR_2, VAR_5, VAR_6, VAR_4={}):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = self.pool.get('stock.location')\n", "VAR_23 = self.pool.get('account.move')\n", "VAR_24 = self.pool.get('account.move.line')\n", "VAR_25 = VAR_6.get('new_price', 0.0)\n", "VAR_19 = VAR_6.get('stock_outpu...
[ "def do_change_standard_price(self, cr, uid, ids, datas, context={}):...\n", "\"\"\"docstring\"\"\"\n", "location_obj = self.pool.get('stock.location')\n", "move_obj = self.pool.get('account.move')\n", "move_line_obj = self.pool.get('account.move.line')\n", "new_price = datas.get('new_price', 0.0)\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "For", "For", "Return'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Condit...
[ "def FUNC_19(self, *VAR_67):...\n", "self._localrules.update(VAR_67)\n" ]
[ "def localrules(self, *rulenames):...\n", "self._localrules.update(rulenames)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_2(VAR_3, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = VAR_5.copy()\n", "VAR_18 = FUNC_4(VAR_3)\n", "if VAR_18:\n", "VAR_5['data']['registration_form_desc']['fields'] = FUNC_3(VAR_5['data'][\n 'registration_form_desc'])\n", "VAR_5['enable_enterprise_sidebar'] = False\n", "VAR_5.updat...
[ "def update_context_for_enterprise(request, context):...\n", "\"\"\"docstring\"\"\"\n", "context = context.copy()\n", "sidebar_context = enterprise_sidebar_context(request)\n", "if sidebar_context:\n", "context['data']['registration_form_desc']['fields'] = enterprise_fields_only(\n context['data']['reg...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_1(self):...\n", "return self.get_secure_cookie('username')\n" ]
[ "def get_current_user(self):...\n", "return self.get_secure_cookie('username')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_39(VAR_62):...\n", "return json.loads(VAR_62) if VAR_21 else VAR_62\n" ]
[ "def get_str(_str):...\n", "return json.loads(_str) if as_json else _str\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(self):...\n", "VAR_1 = 'sh'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', VAR_1),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/usr/a-dir/', VAR_1),\n '/home/usr/a-dir/')\n", "self.assertEqual(escape_path_argument('/home/us r/a-file with spaces.bl...
[ "def test_escape_path_argument_sh(self):...\n", "_type = 'sh'\n", "self.assertEqual(escape_path_argument('/home/usr/a-file', _type),\n '/home/usr/a-file')\n", "self.assertEqual(escape_path_argument('/home/usr/a-dir/', _type),\n '/home/usr/a-dir/')\n", "self.assertEqual(escape_path_argument('/home/us r...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@VAR_8.event...\n", "print('{0.user} connected to server'.format(VAR_8))\n", "print('Whitelisted channel IDs are: ' + str(VAR_2))\n", "print('Whitelisted role IDs are: ' + str(VAR_4))\n" ]
[ "@bot.event...\n", "print('{0.user} connected to server'.format(bot))\n", "print('Whitelisted channel IDs are: ' + str(chan_whitelist))\n", "print('Whitelisted role IDs are: ' + str(role_whitelist))\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_10, VAR_13, VAR_14, VAR_11=None):...\n", "CLASS_1.__init__(self, VAR_10, VAR_11)\n", "self.username = VAR_13\n", "self.password = VAR_14\n", "self.url = '%slogin' % self.base_url\n", "self.data = {'username': self.username, 'password': self.password, 'next': '/'}\n" ]
[ "def __init__(self, browser, username, password, base_url=None):...\n", "GenericRequest.__init__(self, browser, base_url)\n", "self.username = username\n", "self.password = password\n", "self.url = '%slogin' % self.base_url\n", "self.data = {'username': self.username, 'password': self.password, 'next': '/...
[ 0, 0, 0, 0, 5, 5 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@ndb.transactional...\n", "VAR_14 = WfAnalysis.Get(VAR_5, VAR_6, VAR_7)\n", "if not VAR_14 or not VAR_14.suspected_cls:\n", "return False\n", "VAR_15 = 0\n", "VAR_16 = 0\n", "for VAR_23 in VAR_14.suspected_cls:\n", "if VAR_23['repo_name'] == VAR_0 and VAR_23['revision'] == VAR_1:\n", "if VAR_15 + V...
[ "@ndb.transactional...\n", "analysis = WfAnalysis.Get(master_name, builder_name, build_number)\n", "if not analysis or not analysis.suspected_cls:\n", "return False\n", "num_correct = 0\n", "num_incorrect = 0\n", "for cl in analysis.suspected_cls:\n", "if cl['repo_name'] == repo_name and cl['revision'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "For", "Condition", "Condition", "Assign'", "Condition", "Condition", "Expr'", "AugAssign'", "Condition", "Assign'", "Condition", "Return'", "AugAssign'", "Assign'", "Assign'" ]
[ "def FUNC_0(VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "if __grains__['kernel'] == 'Linux':\n", "VAR_4 = 'df -P'\n", "if __grains__['kernel'] == 'OpenBSD':\n", "if VAR_1:\n", "VAR_4 = 'df -kP'\n", "VAR_4 = 'df'\n", "VAR_4 = VAR_4 + ' -' + VAR_1\n", "VAR_2 = {}\n", "VAR_3 = __salt__['cmd.run'...
[ "def usage(args=None):...\n", "\"\"\"docstring\"\"\"\n", "if __grains__['kernel'] == 'Linux':\n", "cmd = 'df -P'\n", "if __grains__['kernel'] == 'OpenBSD':\n", "if args:\n", "cmd = 'df -kP'\n", "cmd = 'df'\n", "cmd = cmd + ' -' + args\n", "ret = {}\n", "out = __salt__['cmd.run'](cmd).splitlines(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Assign'", "Assign'", "Ass...
[ "def FUNC_6(self, VAR_10, VAR_11, VAR_12=None, VAR_20=None):...\n", "VAR_30 = self.uploadFile(VAR_10, VAR_11, VAR_12)\n", "VAR_31 = self.isASuccessfulUpload(VAR_30[0].text)\n", "VAR_23 = {'uploaded': False, 'codeExec': False}\n", "if VAR_31:\n", "VAR_23['uploaded'] = True\n", "return VAR_23\n", "if se...
[ "def submitTestCase(self, suffix, mime, payload=None, codeExecRegex=None):...\n", "fu = self.uploadFile(suffix, mime, payload)\n", "uploadRes = self.isASuccessfulUpload(fu[0].text)\n", "result = {'uploaded': False, 'codeExec': False}\n", "if uploadRes:\n", "result['uploaded'] = True\n", "return result\n...
[ 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Expr'", "Condition", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", ...
[ "def FUNC_32(VAR_39, VAR_49=None):...\n", "VAR_39.returncode = VAR_1\n", "json.dump(VAR_22, VAR_32)\n", "return 0\n" ]
[ "def wait(self2, timeout=None):...\n", "self2.returncode = returncode\n", "json.dump(result, f)\n", "return 0\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def __repr__(self):...\n", "return self.rule.name\n" ]
[ "def __repr__(self):...\n", "return self.rule.name\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(self, VAR_10):...\n", "VAR_22 = _('local_path not supported')\n" ]
[ "def local_path(self, volume):...\n", "msg = _('local_path not supported')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_34(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.flags.ignore_save_passwords is True:\n", "return\n", "for VAR_25 in self.meta.get('fields', {'fieldtype': ('=', 'Password')}):\n", "if self.flags.ignore_save_passwords and VAR_25.fieldname in self.flags.ignore_save_passwords:\n", "VAR_62 = s...
[ "def _save_passwords(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.flags.ignore_save_passwords is True:\n", "return\n", "for df in self.meta.get('fields', {'fieldtype': ('=', 'Password')}):\n", "if self.flags.ignore_save_passwords and df.fieldname in self.flags.ignore_save_passwords:\n", "new_passwo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "For", "Condition", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_11(VAR_11, VAR_12=0, **VAR_13):...\n", "if VAR_12:\n", "VAR_11[0:0] = [None] * VAR_12\n", "VAR_30 = int(VAR_11.numFound)\n", "VAR_31 = VAR_30 - len(VAR_11)\n", "VAR_11.extend([None] * VAR_31)\n" ]
[ "def padResults(results, start=0, **kw):...\n", "if start:\n", "results[0:0] = [None] * start\n", "found = int(results.numFound)\n", "tail = found - len(results)\n", "results.extend([None] * tail)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "import json\n", "import mock\n", "import requests\n", "from django.test import TransactionTestCase\n", "from api.models import Release\n", "def FUNC_0(*V...
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "import json\n", "import mock\n", "import requests\n", "from django.test import TransactionTestCase\n", "from api.models import Release\n", "def mock_impo...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_12(self):...\n", "return self.current_user()['last_name']\n" ]
[ "def current_last_name(self):...\n", "return self.current_user()['last_name']\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "from utils.admin import load_credentials\n", "import MySQLdb\n", "import json\n", "VAR_0 = load_credentials()\n", "VAR_1 = VAR_0['dbhost'], VAR_0['dbuser'], VAR_0['dbpass'], VAR_0['dbname']\n", "def __init__(self):...\n", "self.conn = MySQLdb.connect(*self.dsn)\n", "self.cur = self.conn.cursor()\n", ...
[ "from utils.admin import load_credentials\n", "import MySQLdb\n", "import json\n", "credentials = load_credentials()\n", "dsn = credentials['dbhost'], credentials['dbuser'], credentials['dbpass'\n ], credentials['dbname']\n", "def __init__(self):...\n", "self.conn = MySQLdb.connect(*self.dsn)\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "Import'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "\"\"\"\n Root factory <=> Acl handling\n\"\"\"\n", "from pyramid.security import Allow, Deny, Everyone, Authenticated, ALL_PERMISSIONS\n", "from sqlalchemy.orm import undefer_group\n", "from autonomie.models.config import ConfigFiles\n", "from autonomie.models.activity import Activity\n", "from autono...
[ "\"\"\"\n Root factory <=> Acl handling\n\"\"\"\n", "from pyramid.security import Allow, Deny, Everyone, Authenticated, ALL_PERMISSIONS\n", "from sqlalchemy.orm import undefer_group\n", "from autonomie.models.config import ConfigFiles\n", "from autonomie.models.activity import Activity\n", "from autono...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", ...
[ "def FUNC_8(VAR_6):...\n", "if 'player1' not in VAR_6.lower() and 'player2' not in VAR_6.lower():\n", "if VAR_1:\n", "if '\"player1\":null' in VAR_6.lower() or '\"player2\":null' in VAR_6.lower():\n", "print('didnt find any players, must be invalid')\n", "return False\n", "if VAR_1:\n", "return True\n...
[ "def bracket_complete(data):...\n", "if 'player1' not in data.lower() and 'player2' not in data.lower():\n", "if debug:\n", "if '\"player1\":null' in data.lower() or '\"player2\":null' in data.lower():\n", "print('didnt find any players, must be invalid')\n", "return False\n", "if debug:\n", "return T...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Condition", "Expr'", "Return'", "Condition", "Return'", "Expr'", "Return'" ]
[ "@api.public...\n", "self.response.write(ipaddr.ip_to_string(api.get_peer_ip()))\n" ]
[ "@api.public...\n", "self.response.write(ipaddr.ip_to_string(api.get_peer_ip()))\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_2(self):...\n", "VAR_17 = \"\"\"\n GROUP BY\n qcp.id,\n chd.date\n \"\"\"\n", "return VAR_17\n" ]
[ "def _group_by(self):...\n", "group_by_str = \"\"\"\n GROUP BY\n qcp.id,\n chd.date\n \"\"\"\n", "return group_by_str\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "from tornado.escape import json_encode\n", "import tornado.web\n", "import tornado.ioloop\n", "import api.aggregation\n", "import api.survey\n", "import api.submission\n", "import api.user\n", "from pages.api.aggregations import AggregationHandler\n", "from pages.auth impo...
[ "\"\"\"\nThis tornado server creates the client app by serving html/css/js and\nit also functions as the wsgi container for accepting survey form post\nrequests back from the client app.\n\"\"\"\n", "from tornado.escape import json_encode\n", "import tornado.web\n", "import tornado.ioloop\n", "import api.ag...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 5, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "Assign'", "...
[ "def __init__(self, VAR_4, VAR_5=False, VAR_6='smash'):...\n", "self.start_time = time.time()\n", "self.testing = VAR_5\n", "self.scenes = VAR_4\n", "VAR_6 = 'smash_test' if VAR_5 else VAR_6\n", "self.db = get_db(db=db_name)\n", "VAR_11 = 'SELECT count(*) FROM matches'\n", "VAR_12 = self.db.exec(VAR_1...
[ "def __init__(self, scenes, testing=False, db_name='smash'):...\n", "self.start_time = time.time()\n", "self.testing = testing\n", "self.scenes = scenes\n", "db_name = 'smash_test' if testing else db_name\n", "self.db = get_db(db=db_name)\n", "sql = 'SELECT count(*) FROM matches'\n", "res = self.db.ex...
[ 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = User(VAR_17=NEW_COMPLETED_SIGNUP_USER_EXAMPLE)\n", "self.app.central_userdb.save(VAR_12, check_sync=False)\n" ]
[ "def init_data(self):...\n", "\"\"\"docstring\"\"\"\n", "test_user = User(data=NEW_COMPLETED_SIGNUP_USER_EXAMPLE)\n", "self.app.central_userdb.save(test_user, check_sync=False)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "@property...\n", "return self.exists and not os.access(self.file, os.W_OK)\n" ]
[ "@property...\n", "return self.exists and not os.access(self.file, os.W_OK)\n" ]
[ 0, 7 ]
[ "Condition", "Return'" ]
[ "def FUNC_1(self, VAR_7):...\n", "VAR_7.is_valid(self)\n", "VAR_11 = VAR_7.save(sent_by=self.request.user, room=self.room)\n", "if not settings.IS_TESTING:\n", "VAR_9 = {'id': VAR_11.id.__str__(), 'timestamp': VAR_11.time_ago,\n 'timestamp_string': VAR_11.timestamp_string, 'user_handle': self.\n reque...
[ "def perform_create(self, serializer):...\n", "serializer.is_valid(self)\n", "instance = serializer.save(sent_by=self.request.user, room=self.room)\n", "if not settings.IS_TESTING:\n", "data = {'id': instance.id.__str__(), 'timestamp': instance.time_ago,\n 'timestamp_string': instance.timestamp_string, '...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(self):...\n", "VAR_6 = BeautifulSoup(self.res_data, 'html.parser')\n", "VAR_7 = {}\n", "VAR_8 = VAR_6.find_all(id='submission_status')[0]\n", "VAR_7['status'] = VAR_8.text.strip()\n", "VAR_9 = VAR_6.find_all(id='compilation')\n", "if VAR_9:\n", "VAR_12 = VAR_9[0]\n", "VAR_7['compile_outp...
[ "def get_submission_info(self):...\n", "soup = BeautifulSoup(self.res_data, 'html.parser')\n", "info = {}\n", "tag = soup.find_all(id='submission_status')[0]\n", "info['status'] = tag.text.strip()\n", "tags = soup.find_all(id='compilation')\n", "if tags:\n", "content = tags[0]\n", "info['compile_out...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Return'" ]
[ "@defer.inlineCallbacks...\n", "self.creds = self._get_creds_from(VAR_5)\n", "VAR_18, VAR_13, VAR_19 = yield self._portal.login(self.creds, None, IResource)\n", "defer.returnValue(VAR_13)\n" ]
[ "@defer.inlineCallbacks...\n", "self.creds = self._get_creds_from(request)\n", "iface, leap_session, logout = yield self._portal.login(self.creds, None,\n IResource)\n", "defer.returnValue(leap_session)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_3(self):...\n", "VAR_2 = self.connect()\n", "VAR_3 = 'DELETE FROM crimes;'\n", "VAR_2.close()\n", "cursor.execute(VAR_3)\n", "VAR_2.commit()\n" ]
[ "def clear_all(self):...\n", "connection = self.connect()\n", "query = 'DELETE FROM crimes;'\n", "connection.close()\n", "cursor.execute(query)\n", "connection.commit()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = None\n", "if VAR_10 in vars(self):\n", "VAR_18 = getattr(self, VAR_10)\n", "return VAR_18\n" ]
[ "def get_val(self, attr_name):...\n", "\"\"\"docstring\"\"\"\n", "value = None\n", "if attr_name in vars(self):\n", "value = getattr(self, attr_name)\n", "return value\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'" ]
[ "import pygame\n", "from draw_utils import Rectangle\n", "from draw_utils import Circle\n", "from draw_utils import Line\n", "from vector2 import Vector2\n", "from a_star import AStar\n", "from graph import Graph\n", "from node import Node\n", "from visual_node import GraphVisual\n", "def FUNC_0()...
[ "import pygame\n", "from draw_utils import Rectangle\n", "from draw_utils import Circle\n", "from draw_utils import Line\n", "from vector2 import Vector2\n", "from a_star import AStar\n", "from graph import Graph\n", "from node import Node\n", "from visual_node import GraphVisual\n", "def main():....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'",...
[ "def FUNC_6(self):...\n", "super().continue_dut('resume')\n" ]
[ "def continue_dut(self):...\n", "super().continue_dut('resume')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_14(self, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = \"DELETE FROM {0} WHERE path='{1}';\".format(VAR_2, VAR_8)\n", "self._run_command(VAR_7)\n" ]
[ "def deleteFile(self, pth):...\n", "\"\"\"docstring\"\"\"\n", "command = \"DELETE FROM {0} WHERE path='{1}';\".format(TABLE_NAME, pth)\n", "self._run_command(command)\n" ]
[ 0, 0, 4, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_6(self, VAR_47):...\n", "if VAR_101.user_is_admin:\n", "return True\n", "if VAR_101.user_is_loggedin:\n", "VAR_18 = Thing._by_fullname(VAR_47, data=True)\n", "abort(403, 'forbidden')\n", "VAR_109 = VAR_18.subreddit_slow\n", "if VAR_109.can_ban(VAR_101.user):\n", "return True\n" ]
[ "def run(self, thing_name):...\n", "if c.user_is_admin:\n", "return True\n", "if c.user_is_loggedin:\n", "item = Thing._by_fullname(thing_name, data=True)\n", "abort(403, 'forbidden')\n", "subreddit = item.subreddit_slow\n", "if subreddit.can_ban(c.user):\n", "return True\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Assign'", "Expr'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_1(self, VAR_2, VAR_4=None):...\n", "VAR_1 = self.current_user\n", "VAR_13 = False\n", "VAR_14 = False\n", "VAR_2 = db.get_dataset(VAR_2)\n", "if VAR_4:\n", "VAR_4 = db.DatasetVersion.select().where(db.DatasetVersion.version == VAR_4,\n db.DatasetVersion.dataset == VAR_2).get()\n", "VAR_4 ...
[ "def get(self, dataset, version=None):...\n", "user = self.current_user\n", "current_version = False\n", "future_version = False\n", "dataset = db.get_dataset(dataset)\n", "if version:\n", "version = db.DatasetVersion.select().where(db.DatasetVersion.version ==\n version, db.DatasetVersion.dataset ==...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_16(VAR_24):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_21(VAR_55):...\n", "@wraps(VAR_55)...\n", "def FUNC_27(VAR_6):...\n", "if callable(VAR_6):\n", "return VAR_6()\n", "if request.method == 'POST':\n", "return VAR_55(*VAR_69, **kwargs)\n", "VAR_10 = json.loads(request.data)\n", "VAR...
[ "def validate_request(schema):...\n", "\"\"\"docstring\"\"\"\n", "def decorator(func):...\n", "@wraps(func)...\n", "def default_encode(value):...\n", "if callable(value):\n", "return value()\n", "if request.method == 'POST':\n", "return func(*args, **kwargs)\n", "body = json.loads(request.data)\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Condition", "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Return'", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_10(self, VAR_12):...\n", "\"\"\"docstring\"\"\"\n", "for t in ids_to_tasks(VAR_12).split(','):\n", "VAR_29 = get_task_module(t)\n", "if hasattr(VAR_29, 'add_cmdline_args'):\n", "VAR_29.add_cmdline_args(self)\n" ]
[ "def add_task_args(self, task):...\n", "\"\"\"docstring\"\"\"\n", "for t in ids_to_tasks(task).split(','):\n", "agent = get_task_module(t)\n", "if hasattr(agent, 'add_cmdline_args'):\n", "agent.add_cmdline_args(self)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_24(self, VAR_28):...\n", "\"\"\"docstring\"\"\"\n", "VAR_58 = VAR_28,\n", "if self.execute('SELECT * FROM history WHERE nzo_id=?', VAR_58):\n", "return VAR_83, VAR_34, VAR_39, VAR_40, VAR_84\n", "VAR_64 = self.c.fetchall()[0]\n", "return '', '', '', '', ''\n", "VAR_83 = VAR_64.get('report')\...
[ "def get_other(self, nzo_id):...\n", "\"\"\"docstring\"\"\"\n", "t = nzo_id,\n", "if self.execute('SELECT * FROM history WHERE nzo_id=?', t):\n", "return dtype, url, pp, script, cat\n", "items = self.c.fetchall()[0]\n", "return '', '', '', '', ''\n", "dtype = items.get('report')\n", "url = items.get...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_18(VAR_32, VAR_33, VAR_5=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_60 = {}\n", "VAR_52 = {}\n", "for VAR_93, _ in VAR_32:\n", "for VAR_83 in VAR_93.fieldcodes:\n", "for VAR_94, _ in VAR_33:\n", "VAR_60.setdefault(VAR_83, set()).add(VAR_93.output(VAR_5))\n", "if len(VAR_94.fieldcodes):...
[ "def _get_fieldcodes(skw_matches, ckw_matches, spires=False):...\n", "\"\"\"docstring\"\"\"\n", "fieldcodes = {}\n", "output = {}\n", "for skw, _ in skw_matches:\n", "for fieldcode in skw.fieldcodes:\n", "for ckw, _ in ckw_matches:\n", "fieldcodes.setdefault(fieldcode, set()).add(skw.output(spires))\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "For", "For", "Expr'", "Condition", "For", "For", "For", "Assign'", "Return'", "Expr'", "For", "Expr'", "Expr'" ]
[ "def FUNC_0(self, VAR_8, VAR_2):...\n", "VAR_14 = self.__cache_map[VAR_8]\n", "return VAR_14.get_by_id(VAR_2)\n" ]
[ "def get_by_id(self, entity_class, entity_id):...\n", "cache = self.__cache_map[entity_class]\n", "return cache.get_by_id(entity_id)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_5():...\n", "self.set_status(404, 'Not Found')\n", "self._headers = tornado.httputil.HTTPHeaders()\n", "self.add_header('Content-Length', '0')\n", "self.flush()\n", "return\n" ]
[ "def invoke_404():...\n", "self.set_status(404, 'Not Found')\n", "self._headers = tornado.httputil.HTTPHeaders()\n", "self.add_header('Content-Length', '0')\n", "self.flush()\n", "return\n" ]
[ 0, 0, 0, 0, 0, 4 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_3(VAR_9, VAR_10):...\n", "VAR_15 = VAR_9.search_fields and VAR_9.search_fields.split(',') or []\n", "VAR_16 = [VAR_9.title_field\n ] if VAR_9.title_field and VAR_9.title_field not in VAR_15 else []\n", "VAR_15 = ['name'] + VAR_15 + VAR_16\n", "if not VAR_10 in VAR_15:\n", "VAR_15 = VAR_15 + [...
[ "def get_std_fields_list(meta, key):...\n", "sflist = meta.search_fields and meta.search_fields.split(',') or []\n", "title_field = [meta.title_field\n ] if meta.title_field and meta.title_field not in sflist else []\n", "sflist = ['name'] + sflist + title_field\n", "if not key in sflist:\n", "sflist =...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def __init__(self, VAR_17):...\n", "self.json = VAR_17\n" ]
[ "def __init__(self, json):...\n", "self.json = json\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "@tornado.web.authenticated...\n", "self.doSettings(False)\n" ]
[ "@tornado.web.authenticated...\n", "self.doSettings(False)\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_16(self, VAR_21, VAR_22, VAR_20=None):...\n", "\"\"\"docstring\"\"\"\n", "if type(VAR_21) == str:\n", "VAR_21 = self.locate(VAR_21)\n", "if type(VAR_22) == str:\n", "VAR_22 = self.locate(VAR_22)\n", "if not VAR_21 or not VAR_22:\n", "return False\n", "VAR_50 = FUNC_16.deepcopy(VAR_21)\n", ...
[ "def copy(self, source, target_parent, new_owner=None):...\n", "\"\"\"docstring\"\"\"\n", "if type(source) == str:\n", "source = self.locate(source)\n", "if type(target_parent) == str:\n", "target_parent = self.locate(target_parent)\n", "if not source or not target_parent:\n", "return False\n", "tar...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def __exit__(self, VAR_27, VAR_28, VAR_29):...\n", "os.dup2(self.backup, self.fd)\n" ]
[ "def __exit__(self, type, value, traceback):...\n", "os.dup2(self.backup, self.fd)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_20(self, VAR_14):...\n", "" ]
[ "def is_relation_one_to_one(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "from osv import osv\n", "from tools.translate import _\n", "VAR_0 = 'pos.close.statement'\n", "VAR_1 = 'Close Statements'\n", "def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n", "VAR_7 = []\...
[ "from osv import osv\n", "from tools.translate import _\n", "_name = 'pos.close.statement'\n", "_description = 'Close Statements'\n", "def close_statement(self, cr, uid, ids, context):...\n", "\"\"\"docstring\"\"\"\n", "company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n", "li...
[ 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 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Condition", "Conditi...
[ "@cached_property...\n", "\"\"\"docstring\"\"\"\n", "return [VAR_46 for VAR_46 in self.composite_fields if getattr(VAR_46,\n 'use_container', False)]\n" ]
[ "@cached_property...\n", "\"\"\"docstring\"\"\"\n", "return [f for f in self.composite_fields if getattr(f, 'use_container', False)]\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_4(VAR_6, VAR_7=3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = list(VAR_6)\n", "VAR_26 = lambda : [VAR_0 for VAR_0 in VAR_6 if not os.path.exists(VAR_0)]\n", "VAR_27 = VAR_26()\n", "if VAR_27:\n", "logger.info('Waiting at most {} seconds for missing files.'.format(VAR_7))\n", "for _ in range(...
[ "def wait_for_files(files, latency_wait=3):...\n", "\"\"\"docstring\"\"\"\n", "files = list(files)\n", "get_missing = lambda : [f for f in files if not os.path.exists(f)]\n", "missing = get_missing()\n", "if missing:\n", "logger.info('Waiting at most {} seconds for missing files.'.format(\n latency_w...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "For", "Condition", "Return'", "Expr'" ]
[ "def FUNC_1(VAR_0, VAR_1):...\n", "VAR_10 = StringIO()\n", "VAR_11 = csv.writer(VAR_10)\n", "VAR_12 = ['#datetime', 'user', 'screen_name', 'text']\n", "VAR_11.writerow(VAR_12)\n", "for tw in tweet.objects.filter(hunt_id=Hunt(id=pk)).order_by('datetime'):\n", "VAR_21 = tw.datetime.astimezone(timezone('As...
[ "def hunt_export(request, pk):...\n", "stream = StringIO()\n", "writer = csv.writer(stream)\n", "header = ['#datetime', 'user', 'screen_name', 'text']\n", "writer.writerow(header)\n", "for tw in tweet.objects.filter(hunt_id=Hunt(id=pk)).order_by('datetime'):\n", "dt = tw.datetime.astimezone(timezone('As...
[ 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 FUNC_24(self, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "VAR_57 = self.getfile(VAR_21, VAR_23=False)\n", "if VAR_57 == False:\n", "self.get_path(os.path.dirname(VAR_21)).remove(VAR_57)\n", "return\n" ]
[ "def remove(self, path):...\n", "\"\"\"docstring\"\"\"\n", "p = self.getfile(path, follow_symlinks=False)\n", "if p == False:\n", "self.get_path(os.path.dirname(path)).remove(p)\n", "return\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_1(self, VAR_6, VAR_7=True, VAR_8=1):...\n", "if not self.sshpool:\n", "VAR_13 = self.configuration.san_password\n", "VAR_12 = None\n", "VAR_14 = self.configuration.san_private_key\n", "VAR_17 = VAR_8\n", "VAR_0.error(_('Error running SSH command: %s') % VAR_6)\n", "VAR_15 = self.configuratio...
[ "def _run_ssh(self, command, check_exit_code=True, attempts=1):...\n", "if not self.sshpool:\n", "password = self.configuration.san_password\n", "last_exception = None\n", "privatekey = self.configuration.san_private_key\n", "total_attempts = attempts\n", "LOG.error(_('Error running SSH command: %s') % ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "AugAssign'", "Assign'", "Return'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_17(VAR_29):...\n", "" ]
[ "def get_option(key):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_11(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = self.clone()\n", "if VAR_15.charset is None:\n", "VAR_17 = b'/'\n", "VAR_17 = '/'\n", "VAR_16 = VAR_17 + VAR_17.join(VAR_15.parts)\n", "if VAR_15._trailing_slash:\n", "VAR_16 += VAR_17\n", "return VAR_16\n" ]
[ "def to_route(self):...\n", "\"\"\"docstring\"\"\"\n", "clone = self.clone()\n", "if clone.charset is None:\n", "slash = b'/'\n", "slash = '/'\n", "route = slash + slash.join(clone.parts)\n", "if clone._trailing_slash:\n", "route += slash\n", "return route\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "AugAssign'", "Return'" ]
[ "def FUNC_1(self, VAR_9):...\n", "VAR_17 = self.get_val('mydict')\n", "VAR_17['package_list'] = VAR_9\n" ]
[ "def set_packages(self, package_list):...\n", "mydict = self.get_val('mydict')\n", "mydict['package_list'] = package_list\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def __init__(self, VAR_1, VAR_2=None):...\n", "super(CLASS_0, self).__init__(VAR_1, VAR_2)\n", "self.TEST_APP = VAR_1['TEST_APP']\n", "self.__path = 'applications/%s/tasks' % self.TEST_APP\n", "self.TEST_STACK = VAR_1['TEST_STACK']\n", "self.TEST_REGION = VAR_1['TEST_GCE_REGION']\n", "self.TEST_ZONE = ...
[ "def __init__(self, bindings, agent=None):...\n", "super(GoogleServerGroupTestScenario, self).__init__(bindings, agent)\n", "self.TEST_APP = bindings['TEST_APP']\n", "self.__path = 'applications/%s/tasks' % self.TEST_APP\n", "self.TEST_STACK = bindings['TEST_STACK']\n", "self.TEST_REGION = bindings['TEST_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_1():...\n", "VAR_3 = FUNC_0()\n", "VAR_4 = VAR_3.cursor()\n", "VAR_4.execute('DROP TABLE IF EXISTS players CASCADE;')\n", "VAR_4.execute('DROP TABLE IF EXISTS matches CASCADE;')\n", "VAR_3.commit()\n", "VAR_4.close()\n", "VAR_3.close()\n", "return 0\n" ]
[ "def drop():...\n", "co = connect()\n", "cu = co.cursor()\n", "cu.execute('DROP TABLE IF EXISTS players CASCADE;')\n", "cu.execute('DROP TABLE IF EXISTS matches CASCADE;')\n", "co.commit()\n", "cu.close()\n", "co.close()\n", "return 0\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "@app.route('/<issue>/articles/', methods=['GET'])...\n", "" ]
[ "@app.route('/<issue>/articles/', methods=['GET'])...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_32(VAR_19):...\n", "return dict((expr, vimsupport.VimExpressionToPythonType(expr)) for expr in\n VAR_19)\n" ]
[ "def BuildExtraConfData(extra_conf_vim_data):...\n", "return dict((expr, vimsupport.VimExpressionToPythonType(expr)) for expr in\n extra_conf_vim_data)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self):...\n", "super(CLASS_0, self).clean()\n", "VAR_13 = {}\n", "if self.cleaned_data['action'] == 'create':\n", "return self.cleaned_data\n", "VAR_13['title'] = self.cleaned_data['title']\n", "VAR_13['content_type'] = self.cleaned_data['content_type']\n", "VAR_13['object_id'] = self.clea...
[ "def clean(self):...\n", "super(ArticleForm, self).clean()\n", "kw = {}\n", "if self.cleaned_data['action'] == 'create':\n", "return self.cleaned_data\n", "kw['title'] = self.cleaned_data['title']\n", "kw['content_type'] = self.cleaned_data['content_type']\n", "kw['object_id'] = self.cleaned_data['obj...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_5(VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_9.status in ['new', 'active']:\n", "return 'inactive'\n", "if VAR_9.status == 'inactive':\n", "VAR_22 = {'scope': VAR_9, 'status': ['active', 'inactive']}\n", "return VAR_9.status\n", "if org_admin_logic.getForFields(VAR_22, unique=True):\n...
[ "def _orgStatusRetriever(entity):...\n", "\"\"\"docstring\"\"\"\n", "if entity.status in ['new', 'active']:\n", "return 'inactive'\n", "if entity.status == 'inactive':\n", "fields = {'scope': entity, 'status': ['active', 'inactive']}\n", "return entity.status\n", "if org_admin_logic.getForFields(field...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Assign'", "Return'", "Condition", "Return'", "Return'" ]
[ "@VAR_0.route('/statistics/<int:cid>')...\n", "VAR_28 = VAR_1.connection.cursor()\n", "VAR_29 = VAR_28.execute('SELECT * FROM Crawls WHERE cid = %s' % VAR_7)\n", "VAR_30 = VAR_28.fetchall()[0]\n", "VAR_28.close()\n", "print(VAR_10.get('stats', None))\n", "print(VAR_30['stats'])\n", "VAR_31 = json.load...
[ "@app.route('/statistics/<int:cid>')...\n", "cur = mysql.connection.cursor()\n", "result = cur.execute('SELECT * FROM Crawls WHERE cid = %s' % cid)\n", "crawl = cur.fetchall()[0]\n", "cur.close()\n", "print(session.get('stats', None))\n", "print(crawl['stats'])\n", "json_stats = json.loads(crawl['stat...
[ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_19(VAR_18, VAR_20, VAR_10, VAR_26, VAR_27, VAR_28):...\n", "VAR_48 = VAR_20, VAR_4[VAR_20]['name']\n", "VAR_34 = FUNC_1(VAR_10)\n", "VAR_49 = SubmitRequest(VAR_34, VAR_48, base_url=CWS_BASE_URL, VAR_26=\n submission_format, VAR_27=filenames, VAR_28=language)\n", "VAR_49.execute()\n", "VAR_29 ...
[ "def cws_submit(contest_id, task_id, user_id, submission_format, filenames,...\n", "task = task_id, created_tasks[task_id]['name']\n", "browser = get_cws_browser(user_id)\n", "sr = SubmitRequest(browser, task, base_url=CWS_BASE_URL, submission_format=\n submission_format, filenames=filenames, language=lang...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Return'" ]
[ "@classmethod...\n", "return ['runtime_classpath', 'zinc_analysis', 'zinc_args']\n" ]
[ "@classmethod...\n", "return ['runtime_classpath', 'zinc_analysis', 'zinc_args']\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "from openerp import api, models, fields\n", "import logging\n", "from datetime import datetime, timedelta\n", "VAR_0 = logging.getLogger(__name__)\n", "VAR_1 = 'product.template'\n", "VAR_2 = fields.Char(help='Code from bulonfer, not shown', select=1)\n", "VAR_3 = fields.Integer(help='Group Wholesaler'...
[ "from openerp import api, models, fields\n", "import logging\n", "from datetime import datetime, timedelta\n", "_logger = logging.getLogger(__name__)\n", "_inherit = 'product.template'\n", "item_code = fields.Char(help='Code from bulonfer, not shown', select=1)\n", "upv = fields.Integer(help='Group Whol...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "self.browser.quit()\n" ]
[ "def tearDown(self):...\n", "self.browser.quit()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_2(VAR_0):...\n", "VAR_1 = VAR_0.index('>')\n", "sys.stdout = open(VAR_0[VAR_1 + 1], 'w')\n", "print('this is a test')\n" ]
[ "def SetUpOutputRedirect(cmd):...\n", "i = cmd.index('>')\n", "sys.stdout = open(cmd[i + 1], 'w')\n", "print('this is a test')\n" ]
[ 0, 6, 6, 6 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_3(self, VAR_3):...\n", "return self._doc['collections'][VAR_3] if VAR_3 in self._doc['collections'\n ] else None\n" ]
[ "def get_collection(self, collectionname):...\n", "return self._doc['collections'][collectionname] if collectionname in self._doc[\n 'collections'] else None\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@session_manager...\n", "\"\"\"docstring\"\"\"\n", "from invenio.modules.accounts.models import User, UserEXT\n", "from invenio.ext.sqlalchemy import db\n", "from ..handlers import token_session_key\n", "from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\n", "import json\n", "import r...
[ "@session_manager...\n", "\"\"\"docstring\"\"\"\n", "from invenio.modules.accounts.models import User, UserEXT\n", "from invenio.ext.sqlalchemy import db\n", "from ..handlers import token_session_key\n", "from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\n", "import json\n", "import r...
[ 0, 0, 0, 0, 0, 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", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", ...
[ "def __init__(self, VAR_19=False, **VAR_4):...\n", "CLASS_1.__init__(self, **kwargs)\n", "self.subscribed = VAR_19\n" ]
[ "def __init__(self, subscribed=False, **kwargs):...\n", "TriblerContentModel.__init__(self, **kwargs)\n", "self.subscribed = subscribed\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'" ]
[ "def __init__(self, VAR_15, VAR_16, VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "self._name = 'Netatmo {} {}'.format(VAR_16, VAR_5[VAR_17][0])\n", "self.netatmo_data = VAR_15\n", "self.module_name = VAR_16\n", "self.type = VAR_17\n", "self._state = None\n", "self._device_class = VAR_5[self.type][3]\n",...
[ "def __init__(self, netatmo_data, module_name, sensor_type):...\n", "\"\"\"docstring\"\"\"\n", "self._name = 'Netatmo {} {}'.format(module_name, SENSOR_TYPES[sensor_type][0])\n", "self.netatmo_data = netatmo_data\n", "self.module_name = module_name\n", "self.type = sensor_type\n", "self._state = None\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "import json\n", "from django.test import TestCase\n", "from api.models import Key\n", "from api.utils import fingerprint\n", "VAR_0 = 'string'\n", "VAR_1...
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "import json\n", "from django.test import TestCase\n", "from api.models import Key\n", "from api.utils import fingerprint\n", "RSA_PUBKEY = (\n 'ssh-rsa ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Expr'", "Assign'", "FunctionDef'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "...
[ "def FUNC_14(VAR_6, VAR_7):...\n", "FUNC_0.timeout = VAR_6['ini'].getint('sessions', 'session_idle_timeout')\n", "FUNC_3.timeout = VAR_6['ini'].getint('sessions', 'cached_page_timeout')\n", "VAR_6.router.add_get('/', FUNC_4)\n", "VAR_6.router.add_get('/index', FUNC_4)\n", "VAR_6.router.add_get('/login', F...
[ "def add_routes(app, secret_key):...\n", "handle_html.timeout = app['ini'].getint('sessions', 'session_idle_timeout')\n", "cache_page.timeout = app['ini'].getint('sessions', 'cached_page_timeout')\n", "app.router.add_get('/', GET_index)\n", "app.router.add_get('/index', GET_index)\n", "app.router.add_get(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_1):...\n", "VAR_12 = self._formatCredentials(VAR_1, VAR_8='current')\n", "VAR_9 = '{} rclone lsjson current:'.format(VAR_12)\n", "VAR_28 = self._execute(VAR_9)\n", "VAR_36 = e.returncode\n", "return {'result': True, 'message': 'Success'}\n", "return {'result': False, 'message': 'Ex...
[ "def verify(self, data):...\n", "credentials = self._formatCredentials(data, name='current')\n", "command = '{} rclone lsjson current:'.format(credentials)\n", "result = self._execute(command)\n", "returncode = e.returncode\n", "return {'result': True, 'message': 'Success'}\n", "return {'result': False,...
[ 0, 0, 2, 2, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'", "Return'" ]
[ "def FUNC_0(self, VAR_5, VAR_6, VAR_7):...\n", "VAR_9 = ''\n", "VAR_10 = ''\n", "for key in VAR_7:\n", "VAR_9 = VAR_9 + ', %s'\n", "VAR_11 = []\n", "VAR_10 = VAR_10 + ', %s'\n", "VAR_12 = []\n", "VAR_11.append(VAR_5)\n", "for key in VAR_7:\n", "VAR_11.append(key)\n", "VAR_11 = VAR_11 + VAR_12\...
[ "def insertData(self, tableName, timeStamp, tableObj):...\n", "cols = ''\n", "vals = ''\n", "for key in tableObj:\n", "cols = cols + ', %s'\n", "nameList = []\n", "vals = vals + ', %s'\n", "valList = []\n", "nameList.append(tableName)\n", "for key in tableObj:\n", "nameList.append(key)\n", "na...
[ 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 4, 4, 0, 0, 4, 0, 4, 4, 0, 4, 4, 4, 4, 0, 4, 0, 0, 4, 0, 0, 4, 4, 0, 4, 0, 4, 4, 4, 0, 0, 4, 0, 0, 0, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "For", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "...
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import os\n", "import re\n", "import sys\n", "import inspect\n", "import sre_constants\n", "from collections import defaultdict\n", "f...
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import os\n", "import re\n", "import sys\n", "import inspect\n", "import sre_constants\n", "from collections import defaultdict\n", "f...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ "Assign'", "Assign'", "Assign'", "Assign'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "FunctionDef...
[ "def FUNC_7(self, VAR_21, VAR_23=True):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_21 == '/':\n", "return self.fs\n", "VAR_55 = VAR_21.strip('/').split('/')\n", "VAR_22 = ''\n", "VAR_57 = self.fs\n", "for VAR_66 in VAR_55:\n", "if VAR_66 not in [x[VAR_1] for x in VAR_57[VAR_8]]:\n", "return VAR_57\...
[ "def getfile(self, path, follow_symlinks=True):...\n", "\"\"\"docstring\"\"\"\n", "if path == '/':\n", "return self.fs\n", "pieces = path.strip('/').split('/')\n", "cwd = ''\n", "p = self.fs\n", "for piece in pieces:\n", "if piece not in [x[A_NAME] for x in p[A_CONTENTS]]:\n", "return p\n", "ret...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "For", "For", "Return'", "Return'", "For", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_7(self, VAR_14):...\n", "" ]
[ "def is_image(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_3(self, VAR_2, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "return True\n" ]
[ "def has_object_permission(self, request, view, obj):...\n", "\"\"\"docstring\"\"\"\n", "return True\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_23(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = []\n", "for VAR_7, VAR_12 in self.all_processes.items():\n", "for VAR_16 in VAR_12:\n", "return VAR_17\n", "if VAR_16.process.poll() is None:\n", "VAR_17.append((VAR_7, VAR_16.process))\n" ]
[ "def live_processes(self):...\n", "\"\"\"docstring\"\"\"\n", "result = []\n", "for process_type, process_infos in self.all_processes.items():\n", "for process_info in process_infos:\n", "return result\n", "if process_info.process.poll() is None:\n", "result.append((process_type, process_info.process))...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "For", "Return'", "Condition", "Expr'" ]
[ "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_1(self, VAR_3):...\n", "VAR_7 = None\n", "VAR_8 = VAR_3.contents\n", "VAR_9 = []\n", "for VAR_5 in VAR_8:\n", "if isinstance(VAR_5, NavigableString):\n", "return VAR_7\n", "if '(' in VAR_5:\n", "if isinstance(VAR_5, Tag) and not VAR_9:\n", "VAR_9.append('(')\n", "if ')' in VAR_5:\n", ...
[ "def parse_tag(self, tag):...\n", "next_wiki = None\n", "contents = tag.contents\n", "stack = []\n", "for element in contents:\n", "if isinstance(element, NavigableString):\n", "return next_wiki\n", "if '(' in element:\n", "if isinstance(element, Tag) and not stack:\n", "stack.append('(')\n", "i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Condition", "Condition", "Expr'", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Condition", "Return'" ]
[ "from sqlalchemy import create_engine\n", "from sqlalchemy.pool import StaticPool\n", "from .serializer import make_row_serializable\n", "from .cache import Cache\n", "from .connection_url import is_sqlite\n", "def __init__(self, VAR_0, VAR_1):...\n", "self.has_rows = VAR_1 is not None\n", "self.keys ...
[ "from sqlalchemy import create_engine\n", "from sqlalchemy.pool import StaticPool\n", "from .serializer import make_row_serializable\n", "from .cache import Cache\n", "from .connection_url import is_sqlite\n", "def __init__(self, keys, rows):...\n", "self.has_rows = rows is not None\n", "self.keys = k...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Return'" ]
[ "@classmethod...\n", "VAR_37 = []\n", "VAR_38 = 1.0\n", "VAR_39 = 0.0\n", "VAR_40 = 0\n", "for elem in (VAR_22 + [None]):\n", "if isinstance(elem, CLASS_4):\n", "VAR_37.append(elem)\n", "if len(VAR_37) > 0:\n", "VAR_38 -= elem.percentage\n", "VAR_37[0].before = VAR_21.begin\n", "if isinstance(...
[ "@classmethod...\n", "currentColumnSet = []\n", "totalSpace = 1.0\n", "totalUnits = 0.0\n", "unspecifiedCount = 0\n", "for elem in (docList + [None]):\n", "if isinstance(elem, Column):\n", "currentColumnSet.append(elem)\n", "if len(currentColumnSet) > 0:\n", "totalSpace -= elem.percentage\n", "c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Expr'", "Condition", "AugAssign'", "Assign'", "Condition", "AugAssign'", "AugAssign'", "Expr'", "AugAssign'", "Condition", "Expr'", "For", "Assign'", "Condition", "Assign'", "Assign'", "AugAss...
[ "def FUNC_6(VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "return hasattr(VAR_8, '__self__') and VAR_8.__self__ is not None\n" ]
[ "def is_class_method(f):...\n", "\"\"\"docstring\"\"\"\n", "return hasattr(f, '__self__') and f.__self__ is not None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "from grokcore.component import baseclass, context\n", "from zope.component import provideSubscriptionAdapter\n", "import argparse\n", "from opennode.oms.endpoint.ssh import cmd\n", "from opennode.oms.endpoint.ssh.completion import Completer\n", "from opennode.oms.endpoint.ssh.cmdline import GroupDictActi...
[ "from grokcore.component import baseclass, context\n", "from zope.component import provideSubscriptionAdapter\n", "import argparse\n", "from opennode.oms.endpoint.ssh import cmd\n", "from opennode.oms.endpoint.ssh.completion import Completer\n", "from opennode.oms.endpoint.ssh.cmdline import GroupDictActi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Expr'", "FunctionDef'", "Return'" ]
[ "def FUNC_30(self, VAR_16):...\n", "" ]
[ "def delete_all(self, items):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_55(self):...\n", "\"\"\"docstring\"\"\"\n", "self.run_example('multiline_statement.py')\n", "self.assertEqual(0, len(self.b_mgr.skipped))\n", "self.assertEqual(1, len(self.b_mgr.files_list))\n", "self.assertTrue(self.b_mgr.files_list[0].endswith('multiline_statement.py'))\n", "VAR_10 = self.b_...
[ "def test_multiline_code(self):...\n", "\"\"\"docstring\"\"\"\n", "self.run_example('multiline_statement.py')\n", "self.assertEqual(0, len(self.b_mgr.skipped))\n", "self.assertEqual(1, len(self.b_mgr.files_list))\n", "self.assertTrue(self.b_mgr.files_list[0].endswith('multiline_statement.py'))\n", "issu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_2=None, VAR_3=None, VAR_4=True):...\n", "self.vars = {}\n", "self.groups = []\n", "self._uuid = None\n", "self.name = VAR_2\n", "self.address = VAR_2\n", "if VAR_3:\n", "self.set_variable('ansible_port', int(VAR_3))\n", "if VAR_4:\n", "self._uuid = get_unique_id()\n", "se...
[ "def __init__(self, name=None, port=None, gen_uuid=True):...\n", "self.vars = {}\n", "self.groups = []\n", "self._uuid = None\n", "self.name = name\n", "self.address = name\n", "if port:\n", "self.set_variable('ansible_port', int(port))\n", "if gen_uuid:\n", "self._uuid = get_unique_id()\n", "se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_0(self, VAR_4):...\n", "return 'hstore'\n" ]
[ "def db_type(self, connection):...\n", "return 'hstore'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "self.default_tag = VAR_8\n" ]
[ "def __init__(self, default_tag):...\n", "\"\"\"docstring\"\"\"\n", "self.default_tag = default_tag\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'" ]